|
|
@@ -79,12 +79,15 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
* 页面数据的初始化
|
|
|
*/
|
|
|
fun init() {
|
|
|
- roleTypeSelectData.postValue(
|
|
|
- SelectData(
|
|
|
- id = data1.roletype ?: "",
|
|
|
- value = data1.rolename ?: ""
|
|
|
+ viewModel.queryAccMgrRole()
|
|
|
+ if (type != "1"){
|
|
|
+ roleTypeSelectData.postValue(
|
|
|
+ SelectData(
|
|
|
+ id = data1.roletype ?: "",
|
|
|
+ value = data1.rolename ?: ""
|
|
|
+ )
|
|
|
)
|
|
|
- )
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -99,7 +102,7 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
commonLeftButton()
|
|
|
commonTitle {
|
|
|
if (type == "1"){
|
|
|
- text = "新增角色"
|
|
|
+ text = "新增管理员"
|
|
|
}else if (type == "2"){
|
|
|
text = "角色详情"
|
|
|
}else if (type == "3"){
|
|
|
@@ -117,7 +120,6 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
|
textView {
|
|
|
- visibility = View.INVISIBLE
|
|
|
text = "*"
|
|
|
textColorInt = R.color.rma_star_color
|
|
|
textSizeAuto = 31
|
|
|
@@ -133,7 +135,7 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
}
|
|
|
|
|
|
editText {
|
|
|
- isEnabled = type == "1" || type == "3"
|
|
|
+ isEnabled = type == "1"//登录账号只能在新增时修改
|
|
|
if (type != "1"){
|
|
|
setText(data1.rolename)
|
|
|
}
|
|
|
@@ -157,7 +159,6 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
|
textView {
|
|
|
- visibility = View.INVISIBLE
|
|
|
text = "*"
|
|
|
textColorInt = R.color.rma_star_color
|
|
|
textSizeAuto = 31
|
|
|
@@ -193,11 +194,15 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
itemView()
|
|
|
|
|
|
linearLayout {
|
|
|
+ if (type == "1"){
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ }else{
|
|
|
+ visibility = View.GONE
|
|
|
+ }
|
|
|
background = resources.getDrawable(R.color.white)
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
|
textView {
|
|
|
- visibility = View.INVISIBLE
|
|
|
text = "*"
|
|
|
textColorInt = R.color.rma_star_color
|
|
|
textSizeAuto = 31
|
|
|
@@ -239,7 +244,6 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
|
textView {
|
|
|
- visibility = View.INVISIBLE
|
|
|
text = "*"
|
|
|
textColorInt = R.color.rma_star_color
|
|
|
textSizeAuto = 31
|
|
|
@@ -262,7 +266,7 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
}else{
|
|
|
setText(data1.mobile)
|
|
|
}
|
|
|
- hint = "非必填,用于找回密码"
|
|
|
+ hint = "可用于找回密码"
|
|
|
background = null
|
|
|
inputType = EditorInfo.TYPE_CLASS_PHONE
|
|
|
// setDecimalInputType()
|
|
|
@@ -283,12 +287,11 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
if (type == "2"){
|
|
|
return@onThrottleFirstClick
|
|
|
}
|
|
|
- creatBottomSheetDialog("请选择合同类型", getSelectDataList()) {
|
|
|
+ creatBottomSheetDialog("请选择账户权限", getSelectDataList()) {
|
|
|
roleTypeSelectData.postValue(this)
|
|
|
}
|
|
|
}
|
|
|
textView {
|
|
|
- visibility = View.INVISIBLE
|
|
|
text = "*"
|
|
|
textColorInt = R.color.rma_star_color
|
|
|
textSizeAuto = 31
|
|
|
@@ -297,7 +300,7 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
- text = "账户角色"
|
|
|
+ text = "账户权限"
|
|
|
textSizeAuto = 31
|
|
|
textColorInt = R.color.rma_black_33
|
|
|
}.lparams(wrapContent, wrapContent) {
|
|
|
@@ -319,9 +322,9 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
|
|
|
imageView {
|
|
|
if (type == "1"){
|
|
|
- visibility = View.GONE
|
|
|
- }else{
|
|
|
visibility = View.VISIBLE
|
|
|
+ }else{
|
|
|
+ visibility = View.GONE
|
|
|
}
|
|
|
imageResource = R.mipmap.rma_more
|
|
|
}.lparams(autoSize(36), autoSize(36)) {
|
|
|
@@ -356,6 +359,8 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
}else if (type == "3"){//修改
|
|
|
viewModel.LoginaccountOperateReq(
|
|
|
operatetype = 4,
|
|
|
+ userid = data1.userid?.toLong() ?: 0,
|
|
|
+ loginid = data1.loginid?.toLong() ?: 0,
|
|
|
logincode = login_account.text.toString(),
|
|
|
accountname = account_name.text.toString(),
|
|
|
password = login_password.text.toString(),
|
|
|
@@ -384,12 +389,9 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
*/
|
|
|
fun getSelectDataList(): List<SelectData> {
|
|
|
val selectList = arrayListOf<SelectData>()
|
|
|
-// seletType.forEach {
|
|
|
-// selectList.add(SelectData(id = it.roleid ?: "", value = it.rolename ?: ""))
|
|
|
-// }
|
|
|
- selectList.add(SelectData(id = "22",value = "业务员"))
|
|
|
- selectList.add(SelectData(id = "23",value = "跟单员"))
|
|
|
-// selectList.add(SelectData(id = "24",value = "交易员"))
|
|
|
+ viewModel.roleSetDataList.value?.forEach {
|
|
|
+ selectList.add(SelectData(id = it.autoid ?: "",value = it.rolename ?: ""))
|
|
|
+ }
|
|
|
return selectList
|
|
|
}
|
|
|
|