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