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
2b397df8
Commit
2b397df8
authored
May 14, 2021
by
zhangrui123
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限修改的bug处理
parent
b2667ea6
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
50 deletions
+94
-50
routes.js
src/router/routes.js
+36
-1
api.js
src/server/api.js
+5
-1
mutations.js
src/store/mutations.js
+3
-0
state.js
src/store/state.js
+1
-0
edit.vue
src/views/personal/InternalStaff/edit.vue
+49
-48
No files found.
src/router/routes.js
View file @
2b397df8
...
...
@@ -47,6 +47,41 @@ const appRoutes = [
path
:
'/systemManagement/tbls'
,
name
:
'tbls'
,
component
:
resolve
=>
require
([
'@/views/houseData/tbls'
],
resolve
),
//Tbls,
meta
:
{
title
:
'拓展信息管理'
,
menuPath
:
true
,
menuIcon
:
'setting'
,
authCode
:
'000002'
,
hideInBread
:
false
,
},
},
// //角色权限配置
// {
// path: '/systemManagement/permissionConfig',
// name: '/systemManagement/permissionConfig',
// component: resolve => require(['@/views/permissionConfig/index'], resolve),
// meta: { title: '角色权限配置', menuPath: true, authCode: '', menuIcon: 'cluster', hideInBread: false, openMode: 'normal' },
// children: [{
// path: '/systemManagement/permissionConfig/point',
// name: '/systemManagement/permissionConfig/point',
// component: resolve => require(['@/views/permissionConfig/point'], resolve),
// meta: { title: '功能点管理', menuPath: false, authCode: '', menuIcon: 'cluster', hideInBread: false, openMode: 'normal' },
// children: [
// {
// path: '/systemManagement/permissionConfig/point/add',
// name: '/systemManagement/permissionConfig/point/add',
// component: resolve => require(['@/views/permissionConfig/addPoint'], resolve),
// meta: { title: '添加功能点', menuPath: false, authCode: '', menuIcon: 'cluster', hideInBread: false, openMode: 'normal' },
// },
// {
// path: '/systemManagement/permissionConfig/point/addBatch',
// name: '/systemManagement/permissionConfig/point/addBatch',
// component: resolve => require(['@/views/permissionConfig/editPoint'], resolve),
// meta: { title: '批量添加功能点', menuPath: false, authCode: '', menuIcon: 'cluster', hideInBread: false, openMode: 'normal' },
// },
// {
// path: '/systemManagement/permissionConfig/point/edit',
// name: '/systemManagement/permissionConfig/point/edit',
// component: resolve => require(['@/views/permissionConfig/index'], resolve),
// meta: { title: '编辑功能点', menuPath: false, authCode: '', menuIcon: 'cluster', hideInBread: false, openMode: 'normal' },
// }
// ]
// },
// ]
// },
{
// 角色管理
path
:
'/systemManagement/role'
,
name
:
'role'
,
component
:
resolve
=>
require
([
'@/views/personal/role/list'
],
resolve
),
//role,
meta
:
{
title
:
'角色管理'
,
authCode
:
'000903'
,
menuPath
:
true
,
menuIcon
:
'cluster'
,
hideInBread
:
false
,
},
...
...
src/server/api.js
View file @
2b397df8
...
...
@@ -66,7 +66,7 @@ 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://
xuhui.
hm.omniview.pro/api/v2'
BASE_URL
=
'http://
yangpu-
hm.omniview.pro/api/v2'
// BASE_URL = 'http://pudong.hm.omniview.pro/api/v2'
// BASE_URL = 'http://211.136.105.193/apiv2'
MOCK_URL
=
'https://yapi.omniview.pro/mock/283'
...
...
@@ -215,6 +215,10 @@ export default {
GET_USER_PEIMISSION
:
'/service-permission/user/perms'
,
// 当前用户角色权限树 -- 传userId
GET_ALL_PEIMISSION
:
'/service-permission/perms'
,
// 全部角色权限树
GET_ALL_ROLE
:
'/service-permission/menu/tree'
,
//获取权限
GET_PREMSPOINT_LIST
:
'/service-permission/perm/points'
,
//获取功能点清单
POST_PREMSBRANCH
:
'/service-permission/perm/perm'
,
//单个新增权限分支
DELETE_PREMSPOINT
:
'/service-permission/perm/point/{id}'
,
//删除功能点
SYSTEM_LIST_ALL_GET
:
'/service-user/user/systems'
,
//查询系统列表
GET_USER_CODE
:
'/service-permission/user/menus/code'
,
//获取用户权限
GET_USER_PERM
:
'/service-permission/user/menus/{id}'
,
...
...
src/store/mutations.js
View file @
2b397df8
...
...
@@ -56,4 +56,7 @@ export default {
SET_TABNAME
(
state
,
tabName
)
{
state
.
tabName
=
tabName
},
SET_CURRENTROLEID
(
state
,
roleId
)
{
state
.
roleId
=
roleId
}
}
src/store/state.js
View file @
2b397df8
...
...
@@ -19,4 +19,5 @@ export default {
content
:
null
,
openKeys
:
[],
isXuhui
:
false
,
// 是否为徐汇项目
currentRoleId
:
''
}
src/views/personal/InternalStaff/edit.vue
View file @
2b397df8
...
...
@@ -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