Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
multiSystem
Project
Project
Details
Activity
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
Yulun Yao
multiSystem
Commits
fadafc1e
Commit
fadafc1e
authored
May 19, 2021
by
程卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户管理bug修改
parent
6869437e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
52 deletions
+53
-52
api.js
src/server/api.js
+3
-3
edit.vue
src/views/personal/InternalStaff/edit.vue
+50
-49
No files found.
src/server/api.js
View file @
fadafc1e
...
@@ -37,9 +37,9 @@ case 'huangpu-prod':
...
@@ -37,9 +37,9 @@ case 'huangpu-prod':
default
:
// 默认环境下(开发环境)
default
:
// 默认环境下(开发环境)
// BASE_URL = 'http://31.0.161.39/apiv2'
// BASE_URL = 'http://31.0.161.39/apiv2'
// BASE_URL = 'http://211.136.105.193/apiv2'
// BASE_URL = 'http://211.136.105.193/apiv2'
// BASE_URL = 'http://yangpu.
hm.omniview.pro/api/v2'
BASE_URL
=
'http://yangpu-
hm.omniview.pro/api/v2'
// BASE_URL = 'http://huangpu
-
hm.omniview.pro/api/v2'
// BASE_URL = 'http://huangpu
.
hm.omniview.pro/api/v2'
BASE_URL
=
'http://xuhui.hm.omniview.pro/api/v2'
//
BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2'
// BASE_URL = 'http://pudong.hm.omniview.pro/api/v2'
// BASE_URL = 'http://pudong.hm.omniview.pro/api/v2'
// BASE_URL = 'http://211.136.105.193/apiv2'
// BASE_URL = 'http://211.136.105.193/apiv2'
break
break
...
...
src/views/personal/InternalStaff/edit.vue
View file @
fadafc1e
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
<a-row
class=
"formItemLine"
>
<a-row
class=
"formItemLine"
>
<a-col
span=
"8"
>
<a-col
span=
"8"
>
<a-form-item
label=
"机构类型"
v-bind=
"colSpe"
>
<a-form-item
label=
"机构类型"
v-bind=
"colSpe"
>
<a-select
placeholder=
"请选择"
allowClear
mode=
"multip"
@
change=
"changeType"
v-decorator=
"['orgType',
{initialValue:'2',
<a-select
placeholder=
"请选择"
allowClear
mode=
"multip"
@
select=
"changeType"
v-decorator=
"['orgType',
{
validateTrigger: 'change', rules: [ { required: true, message: '请选择机构类型!' } ]
validateTrigger: 'change', rules: [ { required: true, message: '请选择机构类型!' } ]
}]">
}]">
<a-select-option
value=
"2"
>
房办
</a-select-option>
<a-select-option
value=
"2"
>
房办
</a-select-option>
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
<a-row
class=
"formItemLine"
>
<a-row
class=
"formItemLine"
>
<a-col
span=
"8"
>
<a-col
span=
"8"
>
<a-form-item
label=
"角色名称"
v-bind=
"colSpe"
>
<a-form-item
label=
"角色名称"
v-bind=
"colSpe"
>
<a-select
placeholder=
"请选择"
@
change=
"roleChange"
allowClear
mode=
"multiple"
show-search
labelInValue
v-decorator=
"['notes']
<a-select
placeholder=
"请选择"
@
change=
"roleChange"
allowClear
mode=
"multiple"
show-search
v-decorator=
"['notes']
"
>
"
>
<a-select-option
v-for=
"(item,index) in roleList"
:key=
"index"
:value=
"item.roleName+'#'+item.id"
>
{{
item
.
roleName
}}
</a-select-option>
<a-select-option
v-for=
"(item,index) in roleList"
:key=
"index"
:value=
"item.roleName+'#'+item.id"
>
{{
item
.
roleName
}}
</a-select-option>
</a-select>
</a-select>
...
@@ -85,6 +85,7 @@ export default {
...
@@ -85,6 +85,7 @@ export default {
exclusionRoleIds
:
[
'999999'
,
],
exclusionRoleIds
:
[
'999999'
,
],
userRoldIDsOrg
:
[],
userRoldIDsOrg
:
[],
orgnazation
:
[],
orgnazation
:
[],
detail
:
[],
colSpe
:
{
colSpe
:
{
labelCol
:
{
labelCol
:
{
span
:
6
span
:
6
...
@@ -108,6 +109,7 @@ export default {
...
@@ -108,6 +109,7 @@ export default {
},
},
mounted
()
{
mounted
()
{
this
.
getRoleLists
()
this
.
$ajax
.
get
({
this
.
$ajax
.
get
({
url
:
this
.
$api
.
GET_HOS_LIST
,
url
:
this
.
$api
.
GET_HOS_LIST
,
...
@@ -118,13 +120,12 @@ export default {
...
@@ -118,13 +120,12 @@ export default {
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
code
==
'200'
)
{
if
(
res
.
code
==
'200'
)
{
this
.
orgnazation
=
res
.
data
.
content
this
.
orgnazation
=
res
.
data
.
content
console
.
log
(
this
.
orgnazation
)
}
}
})
})
//如果路由有id则为修改数据-- 去获取对应数据渲染
this
.
getTree
()
this
.
getTree
()
this
.
getRoleLists
()
console
.
log
(
123
)
},
},
methods
:
{
methods
:
{
// 查询权限树
// 查询权限树
...
@@ -159,9 +160,9 @@ export default {
...
@@ -159,9 +160,9 @@ export default {
},
},
//添加账户
//添加账户
handleAdd
()
{
handleAdd
()
{
this
.
searchForm
.
validateFields
((
err
,
values
)
=>
{
this
.
searchForm
.
validateFields
((
err
,
values
)
=>
{
values
=
{...
values
,
status
:
1
,
roleIds
:
''
}
// 直接启用账户
values
=
{...
values
,
status
:
1
,
roleIds
:
''
}
// 直接启用账户
console
.
log
(
values
)
if
(
values
.
phone1
)
{
if
(
values
.
phone1
)
{
values
.
phone
+=
','
+
values
.
phone1
+
','
values
.
phone
+=
','
+
values
.
phone1
+
','
...
@@ -169,21 +170,24 @@ export default {
...
@@ -169,21 +170,24 @@ export default {
if
(
values
.
phone2
)
{
if
(
values
.
phone2
)
{
values
.
phone
+=
values
.
phone2
values
.
phone
+=
values
.
phone2
}
}
values
.
DorgId
=
''
values
.
orgId
=
this
.
searchForm
.
getFieldValue
(
'DorgId'
)?
this
.
searchForm
.
getFieldValue
(
'DorgId'
).
split
(
'#'
)[
0
]:
''
values
.
orgId
=
this
.
searchForm
.
getFieldValue
(
'DorgId'
)?
this
.
searchForm
.
getFieldValue
(
'DorgId'
).
split
(
'#'
)[
0
]:
''
values
.
orgName
=
this
.
searchForm
.
getFieldValue
(
'DorgId'
)?
this
.
searchForm
.
getFieldValue
(
'DorgId'
).
split
(
'#'
)[
1
]:
''
values
.
orgName
=
this
.
searchForm
.
getFieldValue
(
'DorgId'
)?
this
.
searchForm
.
getFieldValue
(
'DorgId'
).
split
(
'#'
)[
1
]:
''
values
.
notes
.
forEach
((
item
,
index
)
=>
{
values
.
notes
.
forEach
((
item
,
index
)
=>
{
let
key
=
item
.
split
(
'#'
)[
1
]
if
(
index
==
0
)
{
if
(
index
==
0
)
{
values
.
roleIds
+=
item
.
key
values
.
roleIds
+=
key
return
return
}
}
values
.
roleIds
+=
','
+
item
.
key
values
.
roleIds
+=
','
+
key
})
})
values
.
roleNames
=
''
values
.
roleNames
=
''
values
.
notes
.
forEach
((
ele
,
index
)
=>
{
values
.
notes
.
forEach
((
ele
,
index
)
=>
{
if
(
index
==
0
)
{
if
(
index
==
0
)
{
values
.
roleNames
+=
ele
.
label
values
.
roleNames
+=
ele
.
split
(
'#'
)[
0
]
}
else
{
}
else
{
values
.
roleNames
+=
','
+
ele
.
label
values
.
roleNames
+=
','
+
ele
.
split
(
'#'
)[
0
]
}
}
})
})
if
(
!
err
)
{
if
(
!
err
)
{
...
@@ -220,10 +224,9 @@ export default {
...
@@ -220,10 +224,9 @@ export default {
//获取当前登录账号可操作的角色列表 供多选框选择
//获取当前登录账号可操作的角色列表 供多选框选择
getRoleLists
()
{
getRoleLists
()
{
const
curUserRoles
=
this
.
$store
.
state
.
userInfos
.
roleIds
const
curUserRoles
=
this
.
$store
.
state
.
userInfos
.
roleIds
console
.
log
(
this
.
$store
.
state
)
const
sparams
=
{
const
sparams
=
{
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10000
pageSize
:
10000
,
}
}
if
(
!
this
.
$store
.
state
.
userInfos
.
isAllPerm
)
{
if
(
!
this
.
$store
.
state
.
userInfos
.
isAllPerm
)
{
if
(
!!
curUserRoles
){
if
(
!!
curUserRoles
){
...
@@ -235,31 +238,24 @@ export default {
...
@@ -235,31 +238,24 @@ export default {
params
:
sparams
params
:
sparams
}).
then
(
res
=>
{
}).
then
(
res
=>
{
this
.
roleList
=
this
.
$com
.
confirm
(
res
,
'data.content'
,
[])
// 得到当前账号可支配全部角色 供多选框选择
this
.
roleList
=
this
.
$com
.
confirm
(
res
,
'data.content'
,
[])
// 得到当前账号可支配全部角色 供多选框选择
console
.
log
(
this
.
roleList
)
//如果路由有id则为修改数据-- 去获取对应数据渲染
if
(
this
.
$route
.
query
.
id
)
{
if
(
this
.
$route
.
query
.
id
)
{
this
.
getDetail
()
this
.
getDetail
()
}
}
})
})
},
},
// 角色切换
// 角色切换
roleChange
(
item
)
{
roleChange
(
item
)
{
let
treeRoles
=
[]
this
.
userRoldIDsOrg
.
forEach
((
userRoldId
)
=>
{
if
(
this
.
$com
.
oneOf
(
userRoldId
.
key
,
this
.
exclusionRoleIds
)){
treeRoles
.
push
(
userRoldId
)
}
})
this
.
roles
=
item
this
.
roles
=
item
treeRoles
=
item
.
concat
(
treeRoles
)
this
.
checkedKeys
=
[]
if
(
treeRoles
.
length
!=
0
)
{
const
params
=
treeRoles
.
map
((
it
)
=>
{
if
(
item
.
length
!=
0
)
{
return
it
.
key
const
params
=
item
.
map
((
it
)
=>
{
return
it
.
split
(
'#'
)[
1
]
})
})
this
.
checkedKeys
=
[]
this
.
$ajax
.
get
({
this
.
$ajax
.
get
({
url
:
this
.
$api
.
ROLE_DETAIL
.
replace
(
'{id}'
,
params
)
url
:
this
.
$api
.
ROLE_DETAIL
.
replace
(
'{id}'
,
params
.
join
(
','
)
)
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
code
===
'200'
)
{
if
(
res
.
code
===
'200'
)
{
const
data
=
res
.
data
.
content
const
data
=
res
.
data
.
content
...
@@ -273,7 +269,6 @@ export default {
...
@@ -273,7 +269,6 @@ export default {
}
}
},
},
changeType
(
val
){
changeType
(
val
){
console
.
log
(
val
)
if
(
val
==
4
){
if
(
val
==
4
){
this
.
show
=
false
this
.
show
=
false
}
else
{
}
else
{
...
@@ -286,6 +281,7 @@ export default {
...
@@ -286,6 +281,7 @@ export default {
url
:
this
.
$api
.
GET_USER_DETAIL
.
replace
(
'{id}'
,
this
.
$route
.
query
.
id
)
url
:
this
.
$api
.
GET_USER_DETAIL
.
replace
(
'{id}'
,
this
.
$route
.
query
.
id
)
}).
then
(
res
=>
{
}).
then
(
res
=>
{
this
.
detail
=
res
.
data
.
content
this
.
detail
=
res
.
data
.
content
let
{
let
{
mail
,
mail
,
name
,
name
,
...
@@ -297,19 +293,17 @@ export default {
...
@@ -297,19 +293,17 @@ export default {
orgId
,
orgId
,
addr
,
addr
,
zipCode
,
zipCode
,
orgName
orgName
,
orgType
,
roleIds
}
=
this
.
detail
}
=
this
.
detail
if
(
res
.
code
===
'200'
){
if
(
res
.
code
===
'200'
){
const
data
=
res
.
data
.
content
const
data
=
res
.
data
.
content
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
searchForm
.
setFieldsValue
({
this
.
searchForm
.
setFieldsValue
({
DorgId
:
data
.
orgId
+
'#'
+
data
.
orgName
DorgId
:
data
.
orgId
+
'#'
+
data
.
orgName
})
})
})
})
console
.
log
(
data
.
orgId
+
'#'
+
data
.
orgName
)
}
}
if
(
phone
.
indexOf
(
','
)
!=
-
1
)
{
if
(
phone
.
indexOf
(
','
)
!=
-
1
)
{
phone
.
split
(
','
).
forEach
((
ele
,
index
)
=>
{
phone
.
split
(
','
).
forEach
((
ele
,
index
)
=>
{
...
@@ -324,9 +318,7 @@ export default {
...
@@ -324,9 +318,7 @@ export default {
}
}
// 整理当前用户详情中的角色ID数据,去除重复
// 整理当前用户详情中的角色ID数据,去除重复
const
userRoldIdsOrg
=
this
.
detail
.
roleIds
!=
null
?
this
.
detail
.
roleIds
.
split
(
','
)
:
[]
const
userRoldIdsOrg
=
this
.
detail
.
roleIds
!=
null
?
this
.
detail
.
roleIds
.
split
(
','
)
:
[]
// if(userRoldIdsOrg.length>0 && userRoldIdsOrg[0]=='999999'){
// userRoldIdsOrg.shift()
// }
const
userRoleIDs
=
[]
const
userRoleIDs
=
[]
for
(
let
i
=
0
;
i
<
userRoldIdsOrg
.
length
;
i
++
){
for
(
let
i
=
0
;
i
<
userRoldIdsOrg
.
length
;
i
++
){
if
(
!
this
.
$com
.
oneOf
(
userRoldIdsOrg
[
i
],
userRoleIDs
)
&&
!
this
.
$com
.
oneOf
(
userRoldIdsOrg
[
i
],
this
.
exclusionRoleIds
)){
if
(
!
this
.
$com
.
oneOf
(
userRoldIdsOrg
[
i
],
userRoleIDs
)
&&
!
this
.
$com
.
oneOf
(
userRoldIdsOrg
[
i
],
this
.
exclusionRoleIds
)){
...
@@ -343,18 +335,22 @@ export default {
...
@@ -343,18 +335,22 @@ export default {
}
}
// 组装需要展示在用户信息表单“角色名称”项的初始数据
// 组装需要展示在用户信息表单“角色名称”项的初始数据
userRoleIDs
.
forEach
((
ele
,
index
)
=>
{
userRoleIDs
.
forEach
((
ele
,
index
)
=>
{
userRoleIDs
[
index
]
=
{
// userRoleIDs[index] = {
'key'
:
ele
,
// 'key': ele,
'label'
:
userRoleNames
[
index
]
// 'label': userRoleNames[index]
}
// }
userRoleIDs
[
index
]
=
userRoleNames
[
index
]
+
'#'
+
ele
})
})
let
_this
=
this
let
_this
=
this
this
.
userRoldIDsOrg
=
[]
this
.
userRoldIDsOrg
=
[]
userRoldIdsOrg
.
forEach
((
ele
,
index
)
=>
{
userRoldIdsOrg
.
forEach
((
ele
,
index
)
=>
{
this
.
userRoldIDsOrg
.
push
({
this
.
userRoldIDsOrg
.
push
(
'key'
:
ele
,
// {
'label'
:
userRoldNamesOrg
[
index
]
// 'key': ele,
})
// 'label': userRoldNamesOrg[index]
// }
userRoldNamesOrg
[
index
]
+
'#'
+
ele
)
})
})
const
setDatas
=
{
const
setDatas
=
{
mail
,
mail
,
...
@@ -366,14 +362,20 @@ export default {
...
@@ -366,14 +362,20 @@ export default {
addr
,
addr
,
zipCode
,
zipCode
,
username
,
username
,
DorgId
orgType
// DorgId
}
}
this
.
show
=
orgType
==
'2'
setDatas
.
notes
=
userRoleIDs
setDatas
.
notes
=
userRoleIDs
this
.
roles
=
userRoleIDs
this
.
roles
=
userRoleIDs
this
.
searchForm
.
setFieldsValue
(
setDatas
)
this
.
roleChange
(
this
.
userRoldIDsOrg
)
this
.
roleChange
(
this
.
userRoldIDsOrg
)
this
.
$nextTick
(()
=>
{
this
.
searchForm
.
setFieldsValue
(
setDatas
)
})
})
})
},
},
validateUserName
(
rule
,
value
,
callback
){
validateUserName
(
rule
,
value
,
callback
){
if
(
this
.
fromCenter
){
if
(
this
.
fromCenter
){
...
@@ -415,7 +417,6 @@ export default {
...
@@ -415,7 +417,6 @@ export default {
if
(
!
filter
.
test
(
value
)){
if
(
!
filter
.
test
(
value
)){
callback
(
'请输入正确手机号!'
)
callback
(
'请输入正确手机号!'
)
}
else
{
}
else
{
console
.
log
(
value
)
if
(
value
==
this
.
searchForm
.
getFieldValue
(
'phone1'
)){
if
(
value
==
this
.
searchForm
.
getFieldValue
(
'phone1'
)){
callback
(
'手机号不能重复'
)
callback
(
'手机号不能重复'
)
}
else
if
(
value
==
this
.
searchForm
.
getFieldValue
(
'phone2'
)){
}
else
if
(
value
==
this
.
searchForm
.
getFieldValue
(
'phone2'
)){
...
@@ -514,4 +515,4 @@ export default {
...
@@ -514,4 +515,4 @@ export default {
</
style
>
</
style
>
<
style
>
<
style
>
</
style
>
</
style
>
\ 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