Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
67014c68
Commit
67014c68
authored
Jun 11, 2021
by
shiyuelong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 员工管理页面搭建完成
parent
205d0c15
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
467 additions
and
118 deletions
+467
-118
AndroidManifest.xml
Components/newscontent/src/main/AndroidManifest.xml
+1
-0
NewsContentApplication.kt
...an/shenghuoquan/newscontent/app/NewsContentApplication.kt
+6
-6
MyStaffListAdapter.kt
...oquan/newscontent/personnel/adapter/MyStaffListAdapter.kt
+11
-4
AccountListDto.kt
...shenghuoquan/newscontent/personnel/bean/AccountListDto.kt
+38
-37
PersonalRemoteDataSource.kt
...an/newscontent/personnel/http/PersonalRemoteDataSource.kt
+40
-4
ManagerChangeActivity.kt
...huoquan/newscontent/personnel/ui/ManagerChangeActivity.kt
+2
-2
MyStaffActivity.kt
.../shenghuoquan/newscontent/personnel/ui/MyStaffActivity.kt
+12
-0
StaffInfoActivity.kt
...henghuoquan/newscontent/personnel/ui/StaffInfoActivity.kt
+51
-0
StaffManageActivity.kt
...nghuoquan/newscontent/personnel/ui/StaffManageActivity.kt
+67
-0
LoginLifeCircleActivity.kt
...an/shenghuoquan/newscontent/ui/LoginLifeCircleActivity.kt
+1
-0
HintDialog.kt
...m/yidian/shenghuoquan/newscontent/ui/dialog/HintDialog.kt
+71
-54
activity_staff_info.xml
...s/newscontent/src/main/res/layout/activity_staff_info.xml
+83
-4
activity_staff_manage.xml
...newscontent/src/main/res/layout/activity_staff_manage.xml
+83
-4
strings.xml
Components/newscontent/src/main/res/values/strings.xml
+1
-3
No files found.
Components/newscontent/src/main/AndroidManifest.xml
View file @
67014c68
...
@@ -98,6 +98,7 @@
...
@@ -98,6 +98,7 @@
<activity
<activity
android:name=
".personnel.ui.MyStaffActivity"
android:name=
".personnel.ui.MyStaffActivity"
android:launchMode=
"singleTask"
android:theme=
"@style/Transparent"
/>
android:theme=
"@style/Transparent"
/>
<activity
<activity
android:name=
".personnel.ui.ManagerInfoActivity"
android:name=
".personnel.ui.ManagerInfoActivity"
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/app/NewsContentApplication.kt
View file @
67014c68
...
@@ -90,7 +90,7 @@ class NewsContentApplication : YdBaseApplication() {
...
@@ -90,7 +90,7 @@ class NewsContentApplication : YdBaseApplication() {
intent
.
putExtra
(
XRouterPathConstants
.
ParamsKey
,
params
as
HashMap
)
intent
.
putExtra
(
XRouterPathConstants
.
ParamsKey
,
params
as
HashMap
)
}
}
intent
.
setClass
(
context
,
LoginLifeCircleActivity
::
class
.
java
)
intent
.
setClass
(
context
,
LoginLifeCircleActivity
::
class
.
java
)
intent
.
flags
=
Intent
.
FLAG_ACTIVITY_NEW_TASK
intent
.
flags
=
(
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
or
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
context
.
startActivity
(
intent
)
context
.
startActivity
(
intent
)
}
}
}),
}),
...
@@ -259,7 +259,7 @@ class NewsContentApplication : YdBaseApplication() {
...
@@ -259,7 +259,7 @@ class NewsContentApplication : YdBaseApplication() {
context
.
startActivity
(
intent
)
context
.
startActivity
(
intent
)
}
}
}),
}),
XPageNode
(
PERSONAL_MANAGER_CHANGE
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
XPageNode
(
PERSONAL_MANAGER_CHANGE
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
val
intent
=
Intent
()
val
intent
=
Intent
()
if
(
params
!=
null
)
{
if
(
params
!=
null
)
{
...
@@ -270,7 +270,7 @@ class NewsContentApplication : YdBaseApplication() {
...
@@ -270,7 +270,7 @@ class NewsContentApplication : YdBaseApplication() {
context
.
startActivity
(
intent
)
context
.
startActivity
(
intent
)
}
}
}),
}),
XPageNode
(
PERSONAL_STAFF_INFO
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
XPageNode
(
PERSONAL_STAFF_INFO
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
val
intent
=
Intent
()
val
intent
=
Intent
()
if
(
params
!=
null
)
{
if
(
params
!=
null
)
{
...
@@ -281,7 +281,7 @@ class NewsContentApplication : YdBaseApplication() {
...
@@ -281,7 +281,7 @@ class NewsContentApplication : YdBaseApplication() {
context
.
startActivity
(
intent
)
context
.
startActivity
(
intent
)
}
}
}),
}),
XPageNode
(
PERSONAL_STAFF_MANAGE
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
XPageNode
(
PERSONAL_STAFF_MANAGE
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
val
intent
=
Intent
()
val
intent
=
Intent
()
if
(
params
!=
null
)
{
if
(
params
!=
null
)
{
...
@@ -292,7 +292,7 @@ class NewsContentApplication : YdBaseApplication() {
...
@@ -292,7 +292,7 @@ class NewsContentApplication : YdBaseApplication() {
context
.
startActivity
(
intent
)
context
.
startActivity
(
intent
)
}
}
}),
}),
XPageNode
(
PERSONAL_ADD_STAFF
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
XPageNode
(
PERSONAL_ADD_STAFF
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
val
intent
=
Intent
()
val
intent
=
Intent
()
if
(
params
!=
null
)
{
if
(
params
!=
null
)
{
...
@@ -303,7 +303,7 @@ class NewsContentApplication : YdBaseApplication() {
...
@@ -303,7 +303,7 @@ class NewsContentApplication : YdBaseApplication() {
context
.
startActivity
(
intent
)
context
.
startActivity
(
intent
)
}
}
}),
}),
XPageNode
(
SYSTEM_SETTING
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
XPageNode
(
SYSTEM_SETTING
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
val
intent
=
Intent
()
val
intent
=
Intent
()
if
(
params
!=
null
)
{
if
(
params
!=
null
)
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/adapter/MyStaffListAdapter.kt
View file @
67014c68
...
@@ -3,9 +3,11 @@ package com.yidian.shenghuoquan.newscontent.personnel.adapter
...
@@ -3,9 +3,11 @@ package com.yidian.shenghuoquan.newscontent.personnel.adapter
import
android.widget.TextView
import
android.widget.TextView
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.yidian.common.XRouterPathConstants
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountUser
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountUser
import
com.yidian.utils.ToastUtil
import
com.yidian.utils.ToastUtil
import
com.yidian.xpage.XPageManager
/**
/**
* 我的员工列表的适配器
* 我的员工列表的适配器
...
@@ -17,15 +19,20 @@ class MyStaffListAdapter : BaseQuickAdapter<AccountUser, BaseViewHolder>(R.layou
...
@@ -17,15 +19,20 @@ class MyStaffListAdapter : BaseQuickAdapter<AccountUser, BaseViewHolder>(R.layou
holder
.
getView
<
TextView
>(
R
.
id
.
tv_mobile
).
text
=
item
.
mobile
holder
.
getView
<
TextView
>(
R
.
id
.
tv_mobile
).
text
=
item
.
mobile
if
(!
item
.
roleList
.
isNullOrEmpty
())
{
if
(!
item
.
roleList
.
isNullOrEmpty
())
{
val
sb
=
StringBuilder
()
val
sb
=
StringBuilder
()
item
.
roleList
.
forEach
{
item
.
roleList
.
forEachIndexed
{
index
,
s
->
sb
.
append
(
"$it|"
)
sb
.
append
(
s
)
if
(
index
<
item
.
roleList
.
size
-
1
)
{
sb
.
append
(
"|"
)
}
}
}
holder
.
getView
<
TextView
>(
R
.
id
.
tv_role_list
).
text
=
sb
holder
.
getView
<
TextView
>(
R
.
id
.
tv_role_list
).
text
=
sb
}
}
// 点击管理,进入员工
信息
// 点击管理,进入员工
管理
holder
.
getView
<
TextView
>(
R
.
id
.
tv_manage
).
setOnClickListener
{
holder
.
getView
<
TextView
>(
R
.
id
.
tv_manage
).
setOnClickListener
{
ToastUtil
.
showToast
(
context
,
"点击${item.nickName}"
)
val
hashMap
=
HashMap
<
String
,
Any
?>()
hashMap
[
"staffInfo"
]
=
item
XPageManager
.
push
(
XRouterPathConstants
.
PERSONAL_STAFF_MANAGE
,
hashMap
)
}
}
}
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/bean/AccountListDto.kt
View file @
67014c68
...
@@ -34,6 +34,7 @@ data class AccountAdmin(
...
@@ -34,6 +34,7 @@ data class AccountAdmin(
val
userId
:
Long
?
=
null
val
userId
:
Long
?
=
null
)
:
Parcelable
)
:
Parcelable
@Parcelize
data class
AccountUser
(
data class
AccountUser
(
@SerializedName
(
"life_account_id"
)
@SerializedName
(
"life_account_id"
)
val
lifeAccountId
:
Long
?
=
null
,
val
lifeAccountId
:
Long
?
=
null
,
...
@@ -51,4 +52,4 @@ data class AccountUser(
...
@@ -51,4 +52,4 @@ data class AccountUser(
val
showButton
:
Int
?
=
null
,
val
showButton
:
Int
?
=
null
,
@SerializedName
(
"user_id"
)
@SerializedName
(
"user_id"
)
val
userId
:
Int
?
=
null
val
userId
:
Int
?
=
null
)
)
:
Parcelable
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/http/PersonalRemoteDataSource.kt
View file @
67014c68
...
@@ -6,10 +6,7 @@ import com.yidian.common.http.HttpResultSubscriber
...
@@ -6,10 +6,7 @@ import com.yidian.common.http.HttpResultSubscriber
import
com.yidian.common.http.TransformUtil
import
com.yidian.common.http.TransformUtil
import
com.yidian.http.ServiceFactory
import
com.yidian.http.ServiceFactory
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountListDto
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountListDto
import
com.yidian.shenghuoquan.newscontent.personnel.http.callback.IPersonalAccountListCallback
import
com.yidian.shenghuoquan.newscontent.personnel.http.callback.*
import
com.yidian.shenghuoquan.newscontent.personnel.http.callback.IPersonalChangeAccountCallBack
import
com.yidian.shenghuoquan.newscontent.personnel.http.callback.IPersonalCheckSmsCodeCallBack
import
com.yidian.shenghuoquan.newscontent.personnel.http.callback.IPersonalGetSmsCodeCallBack
/**
/**
* 人员管理远程数据源
* 人员管理远程数据源
...
@@ -100,4 +97,43 @@ object PersonalRemoteDataSource {
...
@@ -100,4 +97,43 @@ object PersonalRemoteDataSource {
})
})
}
}
/**
* 添加非管理员
*/
fun
postAddUser
(
apiCallback
:
IPersonalAddUserCallBack
,
requestParams
:
HashMap
<
String
,
String
?
>)
{
val
timeStamp
=
System
.
currentTimeMillis
()
val
publicParamsMap
=
HttpParamsUtils
.
getPublicParamsMap
(
timeStamp
)
val
privateParamsMap
=
HttpParamsUtils
.
getPrivateParamsMap
(
requestParams
,
timeStamp
)
api
.
postAddUser
(
publicParamsMap
,
privateParamsMap
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
Any
?>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
Any
?
>?)
{
apiCallback
.
addUserSuccess
()
}
override
fun
onFailer
(
result
:
HttpResult
<
Any
?
>?)
{
}
})
}
/**
* 解除关系
*/
fun
getDissolveRelationship
(
apiCallback
:
IPersonalDissolveCallBack
,
requestParams
:
HashMap
<
String
,
String
?
>)
{
val
timeStamp
=
System
.
currentTimeMillis
()
val
publicParamsMap
=
HttpParamsUtils
.
getPublicParamsMap
(
timeStamp
)
val
privateParamsMap
=
HttpParamsUtils
.
getPrivateParamsMap
(
requestParams
,
timeStamp
)
api
.
getDissolveRelationship
(
publicParamsMap
,
privateParamsMap
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
Any
?>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
Any
?
>?)
{
apiCallback
.
dissolveSuccess
()
}
override
fun
onFailer
(
result
:
HttpResult
<
Any
?
>?)
{
}
})
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/ui/ManagerChangeActivity.kt
View file @
67014c68
...
@@ -301,10 +301,10 @@ class ManagerChangeActivity : BaseActivity<ActivityManagerChangeBinding>() {
...
@@ -301,10 +301,10 @@ class ManagerChangeActivity : BaseActivity<ActivityManagerChangeBinding>() {
}
}
override
fun
onRightOption
()
{
override
fun
onRightOption
()
{
XPageManager
.
push
(
XRouterPathConstants
.
LOGIN_LIFE_CIRCLE
,
null
)
ToastUtil
.
showToast
(
this
@ManagerChangeActivity
,
"进入登录页面"
)
ToastUtil
.
showToast
(
this
@ManagerChangeActivity
,
"进入登录页面"
)
}
}
}).
show
()
})
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/ui/MyStaffActivity.kt
View file @
67014c68
...
@@ -10,6 +10,7 @@ import com.yidian.shenghuoquan.newscontent.databinding.ActivityMyStaffBinding
...
@@ -10,6 +10,7 @@ import com.yidian.shenghuoquan.newscontent.databinding.ActivityMyStaffBinding
import
com.yidian.shenghuoquan.newscontent.personnel.adapter.MyStaffListAdapter
import
com.yidian.shenghuoquan.newscontent.personnel.adapter.MyStaffListAdapter
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountAdmin
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountAdmin
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountListDto
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountListDto
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountUser
import
com.yidian.shenghuoquan.newscontent.personnel.http.callback.IPersonalAccountListCallback
import
com.yidian.shenghuoquan.newscontent.personnel.http.callback.IPersonalAccountListCallback
import
com.yidian.shenghuoquan.newscontent.personnel.http.PersonalRemoteDataSource
import
com.yidian.shenghuoquan.newscontent.personnel.http.PersonalRemoteDataSource
import
com.yidian.xpage.XPageManager
import
com.yidian.xpage.XPageManager
...
@@ -35,6 +36,10 @@ class MyStaffActivity : BaseActivity<ActivityMyStaffBinding>(), IPersonalAccount
...
@@ -35,6 +36,10 @@ class MyStaffActivity : BaseActivity<ActivityMyStaffBinding>(), IPersonalAccount
super
.
init
(
savedInstanceState
)
super
.
init
(
savedInstanceState
)
initClick
()
initClick
()
initView
()
initView
()
}
override
fun
onResume
()
{
super
.
onResume
()
requestAccountList
()
requestAccountList
()
}
}
...
@@ -70,6 +75,13 @@ class MyStaffActivity : BaseActivity<ActivityMyStaffBinding>(), IPersonalAccount
...
@@ -70,6 +75,13 @@ class MyStaffActivity : BaseActivity<ActivityMyStaffBinding>(), IPersonalAccount
viewBind
.
tvAddStaff
.
setOnClickListener
{
viewBind
.
tvAddStaff
.
setOnClickListener
{
XPageManager
.
push
(
XRouterPathConstants
.
PERSONAL_ADD_STAFF
,
null
)
XPageManager
.
push
(
XRouterPathConstants
.
PERSONAL_ADD_STAFF
,
null
)
}
}
// 点击员工信息
myStaffAdapter
.
setOnItemChildClickListener
{
adapter
,
_
,
position
->
val
user
=
adapter
.
data
[
position
]
as
AccountUser
val
hashMap
=
HashMap
<
String
,
Any
?>()
hashMap
[
"staffInfo"
]
=
user
XPageManager
.
push
(
XRouterPathConstants
.
PERSONAL_STAFF_INFO
,
hashMap
)
}
}
}
override
fun
getAccountListSuccess
(
response
:
AccountListDto
?)
{
override
fun
getAccountListSuccess
(
response
:
AccountListDto
?)
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/ui/StaffInfoActivity.kt
View file @
67014c68
package
com.yidian.shenghuoquan.newscontent.personnel.ui
package
com.yidian.shenghuoquan.newscontent.personnel.ui
import
android.content.Intent
import
android.os.Bundle
import
androidx.core.content.ContextCompat
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.XRouterPathConstants.Companion.PERSONAL_STAFF_INFO
import
com.yidian.common.XRouterPathConstants.Companion.PERSONAL_STAFF_INFO
import
com.yidian.common.base.BaseActivity
import
com.yidian.common.base.BaseActivity
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityStaffInfoBinding
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityStaffInfoBinding
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountUser
import
com.yidian.shenghuoquan.newscontent.utils.SensitiveInfoUtil
import
com.yidian.xpage.XPageManager
/**
/**
* 员工信息
* 员工信息
*/
*/
class
StaffInfoActivity
:
BaseActivity
<
ActivityStaffInfoBinding
>()
{
class
StaffInfoActivity
:
BaseActivity
<
ActivityStaffInfoBinding
>()
{
private
var
staffInfo
:
AccountUser
?
=
null
override
fun
createViewBinding
():
ActivityStaffInfoBinding
{
override
fun
createViewBinding
():
ActivityStaffInfoBinding
{
return
ActivityStaffInfoBinding
.
inflate
(
layoutInflater
)
return
ActivityStaffInfoBinding
.
inflate
(
layoutInflater
)
}
}
...
@@ -16,4 +26,45 @@ class StaffInfoActivity : BaseActivity<ActivityStaffInfoBinding>() {
...
@@ -16,4 +26,45 @@ class StaffInfoActivity : BaseActivity<ActivityStaffInfoBinding>() {
override
fun
getXPageName
():
String
{
override
fun
getXPageName
():
String
{
return
PERSONAL_STAFF_INFO
return
PERSONAL_STAFF_INFO
}
}
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
super
.
init
(
savedInstanceState
)
initTitle
()
getIntentData
(
intent
)
}
private
fun
initTitle
()
{
viewBind
.
include
.
tvTitle
.
text
=
"员工信息"
viewBind
.
include
.
ivBack
.
setOnClickListener
{
XPageManager
.
pop
(
null
)
}
viewBind
.
include
.
tvMenu
.
text
=
"管理"
viewBind
.
include
.
tvMenu
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_1852F1
))
viewBind
.
include
.
tvMenu
.
setOnClickListener
{
val
hashMap
=
HashMap
<
String
,
Any
?>()
hashMap
[
"staffInfo"
]
=
staffInfo
XPageManager
.
push
(
XRouterPathConstants
.
PERSONAL_STAFF_MANAGE
,
hashMap
)
}
}
private
fun
getIntentData
(
intent
:
Intent
?)
{
val
paramsMap
=
intent
?.
getSerializableExtra
(
XRouterPathConstants
.
ParamsKey
)
if
(
paramsMap
!=
null
)
{
paramsMap
as
HashMap
<*,
*>
staffInfo
=
paramsMap
[
"staffInfo"
]
as
AccountUser
viewBind
.
tvUserName
.
text
=
staffInfo
?.
nickName
viewBind
.
tvLoginAccount
.
text
=
staffInfo
?.
mobile
?.
let
{
SensitiveInfoUtil
.
mobileEncrypt
(
it
)
}
val
sb
=
StringBuilder
()
staffInfo
?.
roleList
?.
forEachIndexed
{
index
,
s
->
sb
.
append
(
s
)
if
(
index
<
staffInfo
!!
.
roleList
!!
.
size
-
1
)
{
sb
.
append
(
"|"
)
}
}
viewBind
.
tvCurrentRole
.
text
=
sb
}
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/ui/StaffManageActivity.kt
View file @
67014c68
package
com.yidian.shenghuoquan.newscontent.personnel.ui
package
com.yidian.shenghuoquan.newscontent.personnel.ui
import
android.content.Intent
import
android.os.Bundle
import
androidx.core.content.ContextCompat
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.XRouterPathConstants.Companion.PERSONAL_STAFF_MANAGE
import
com.yidian.common.XRouterPathConstants.Companion.PERSONAL_STAFF_MANAGE
import
com.yidian.common.base.BaseActivity
import
com.yidian.common.base.BaseActivity
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.bean.HintOptionBean
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityStaffManageBinding
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityStaffManageBinding
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountUser
import
com.yidian.shenghuoquan.newscontent.ui.dialog.HintDialog
import
com.yidian.shenghuoquan.newscontent.utils.SensitiveInfoUtil
import
com.yidian.xpage.XPageManager
/**
/**
* 人员管理 —— 员工管理页面
* 人员管理 —— 员工管理页面
...
@@ -16,4 +26,61 @@ class StaffManageActivity : BaseActivity<ActivityStaffManageBinding>() {
...
@@ -16,4 +26,61 @@ class StaffManageActivity : BaseActivity<ActivityStaffManageBinding>() {
override
fun
getXPageName
():
String
{
override
fun
getXPageName
():
String
{
return
PERSONAL_STAFF_MANAGE
return
PERSONAL_STAFF_MANAGE
}
}
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
super
.
init
(
savedInstanceState
)
initTitle
()
getIntentData
(
intent
)
}
private
fun
initTitle
()
{
viewBind
.
include
.
tvTitle
.
text
=
"员工管理"
viewBind
.
include
.
ivBack
.
setOnClickListener
{
XPageManager
.
pop
(
null
)
}
viewBind
.
include
.
tvMenu
.
text
=
"解除关系"
viewBind
.
include
.
tvMenu
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_FFFF3A3A
))
viewBind
.
include
.
tvMenu
.
setOnClickListener
{
showConfirmDialog
()
}
}
private
fun
getIntentData
(
intent
:
Intent
?)
{
val
paramsMap
=
intent
?.
getSerializableExtra
(
XRouterPathConstants
.
ParamsKey
)
if
(
paramsMap
!=
null
)
{
paramsMap
as
HashMap
<*,
*>
val
staffInfo
=
paramsMap
[
"staffInfo"
]
as
AccountUser
viewBind
.
tvUserName
.
text
=
staffInfo
.
nickName
viewBind
.
tvLoginAccount
.
text
=
staffInfo
.
mobile
?.
let
{
SensitiveInfoUtil
.
mobileEncrypt
(
it
)
}
val
sb
=
StringBuilder
()
staffInfo
.
roleList
?.
forEachIndexed
{
index
,
s
->
sb
.
append
(
s
)
if
(
index
<
staffInfo
.
roleList
.
size
-
1
)
{
sb
.
append
(
"|"
)
}
}
viewBind
.
tvCurrentRole
.
text
=
sb
}
}
private
fun
showConfirmDialog
()
{
val
dialog
=
HintDialog
(
this
,
resources
.
getString
(
R
.
string
.
dissolve_relationship
),
arrayListOf
(
HintOptionBean
(
"关闭"
),
HintOptionBean
(
"解除关系"
)),
object
:
HintDialog
.
OnHintOptionCallback
{
override
fun
onLeftOption
()
{
}
override
fun
onRightOption
()
{
// 返回员工列表并刷新
XPageManager
.
push
(
XRouterPathConstants
.
PERSONAL_MY_STAFF
,
null
)
}
})
dialog
.
setRightBtnColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_FFFF3A3A
))
dialog
.
show
()
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/LoginLifeCircleActivity.kt
View file @
67014c68
...
@@ -47,6 +47,7 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>() {
...
@@ -47,6 +47,7 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>() {
}
}
private
fun
initView
()
{
private
fun
initView
()
{
Hawk
.
put
(
HawkConfig
.
LoginStatus
,
false
)
setLoginButtonStatus
(
false
)
setLoginButtonStatus
(
false
)
mCountDownTimerUtils
=
CountDownTimerUtils
(
viewBind
.
tvGetCode
,
60000
,
1000
)
mCountDownTimerUtils
=
CountDownTimerUtils
(
viewBind
.
tvGetCode
,
60000
,
1000
)
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/dialog/HintDialog.kt
View file @
67014c68
...
@@ -4,6 +4,8 @@ import android.content.Context
...
@@ -4,6 +4,8 @@ import android.content.Context
import
android.os.Bundle
import
android.os.Bundle
import
android.view.View
import
android.view.View
import
android.view.WindowManager
import
android.view.WindowManager
import
androidx.annotation.ColorInt
import
androidx.core.content.ContextCompat
import
androidx.core.view.isVisible
import
androidx.core.view.isVisible
import
com.yidian.common.base.BaseDialog
import
com.yidian.common.base.BaseDialog
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.R
...
@@ -22,8 +24,7 @@ class HintDialog(
...
@@ -22,8 +24,7 @@ class HintDialog(
val
content
:
String
,
val
content
:
String
,
val
options
:
ArrayList
<
HintOptionBean
>,
val
options
:
ArrayList
<
HintOptionBean
>,
val
callback
:
OnHintOptionCallback
?
val
callback
:
OnHintOptionCallback
?
)
:
)
:
BaseDialog
<
DialogHintBinding
>(
context
),
View
.
OnClickListener
{
BaseDialog
<
DialogHintBinding
>(
context
),
View
.
OnClickListener
{
override
fun
createViewBinding
():
DialogHintBinding
{
override
fun
createViewBinding
():
DialogHintBinding
{
return
DialogHintBinding
.
inflate
(
layoutInflater
)
return
DialogHintBinding
.
inflate
(
layoutInflater
)
...
@@ -68,6 +69,8 @@ class HintDialog(
...
@@ -68,6 +69,8 @@ class HintDialog(
}
else
if
(
v
?.
id
==
R
.
id
.
btn_right
)
{
}
else
if
(
v
?.
id
==
R
.
id
.
btn_right
)
{
callback
?.
onRightOption
()
callback
?.
onRightOption
()
}
}
// 点击左右均要关闭弹框
dismiss
()
}
}
interface
OnHintOptionCallback
{
interface
OnHintOptionCallback
{
...
@@ -82,4 +85,18 @@ class HintDialog(
...
@@ -82,4 +85,18 @@ class HintDialog(
fun
onRightOption
()
fun
onRightOption
()
}
}
/***
* 设置左侧按钮颜色
*/
fun
setLeftBtnColor
(
@ColorInt
color
:
Int
)
{
viewBinding
.
btnLeft
.
setTextColor
(
color
)
}
/***
* 设置右侧按钮颜色
*/
fun
setRightBtnColor
(
@ColorInt
color
:
Int
)
{
viewBinding
.
btnRight
.
setTextColor
(
color
)
}
}
}
Components/newscontent/src/main/res/layout/activity_staff_info.xml
View file @
67014c68
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_height=
"match_parent"
>
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:fitsSystemWindows=
"true"
android:orientation=
"vertical"
>
</androidx.constraintlayout.widget.ConstraintLayout>
<include
\ No newline at end of file
android:id=
"@+id/include"
layout=
"@layout/layout_toolbar_menu"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"@dimen/dp120"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"用户名"
android:textColor=
"@color/color_666666"
android:textSize=
"@dimen/sp16"
/>
<TextView
android:id=
"@+id/tv_user_name"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
tools:text=
"店老大"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"@dimen/dp120"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"登录账号"
android:textColor=
"@color/color_666666"
android:textSize=
"@dimen/sp16"
/>
<TextView
android:id=
"@+id/tv_login_account"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
tools:text=
"店老大"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"@dimen/dp120"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"当前角色"
android:textColor=
"@color/color_666666"
android:textSize=
"@dimen/sp16"
/>
<TextView
android:id=
"@+id/tv_current_role"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
tools:text=
"超级管理员"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Components/newscontent/src/main/res/layout/activity_staff_manage.xml
View file @
67014c68
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_height=
"match_parent"
>
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:fitsSystemWindows=
"true"
android:orientation=
"vertical"
>
</androidx.constraintlayout.widget.ConstraintLayout>
<include
\ No newline at end of file
android:id=
"@+id/include"
layout=
"@layout/layout_toolbar_menu"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"@dimen/dp120"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"用户名"
android:textColor=
"@color/color_666666"
android:textSize=
"@dimen/sp16"
/>
<TextView
android:id=
"@+id/tv_user_name"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
tools:text=
"店老大"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"@dimen/dp120"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"登录账号"
android:textColor=
"@color/color_666666"
android:textSize=
"@dimen/sp16"
/>
<TextView
android:id=
"@+id/tv_login_account"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
tools:text=
"店老大"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"@dimen/dp120"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"当前角色"
android:textColor=
"@color/color_666666"
android:textSize=
"@dimen/sp16"
/>
<TextView
android:id=
"@+id/tv_current_role"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
tools:text=
"超级管理员"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Components/newscontent/src/main/res/values/strings.xml
View file @
67014c68
...
@@ -147,8 +147,6 @@
...
@@ -147,8 +147,6 @@
<string
name=
"my_staff"
>
我的员工
</string>
<string
name=
"my_staff"
>
我的员工
</string>
<string
name=
"manager_account_change_tips"
>
管理员账号替换后,原账户将无法操作生活号所有功能,同时将自动退出当前登录状态,新账号将继承原账号所有权益。
</string>
<string
name=
"manager_account_change_tips"
>
管理员账号替换后,原账户将无法操作生活号所有功能,同时将自动退出当前登录状态,新账号将继承原账号所有权益。
</string>
<string
name=
"manager_register_tips"
>
未注册生活圈的手机号,登录时将自动注册,且代表你已经同意《用户协议》《隐私政策》。
</string>
<string
name=
"manager_register_tips"
>
未注册生活圈的手机号,登录时将自动注册,且代表你已经同意《用户协议》《隐私政策》。
</string>
<string
name=
"manager_register_tips1"
>
未注册生活圈的手机号,登录时将自动注册,且代表你
</string>
<string
name=
"dissolve_relationship"
>
解除关系后此账号将不再有权限管理企业信息,账号已产生内容仍属企业
</string>
<string
name=
"manager_register_tips2"
>
已经同意
</string>
<string
name=
"manager_privacy_policy"
>
《隐私政策》
</string>
</resources>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment