Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
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
op-web-service
Commits
9ce14e21
Commit
9ce14e21
authored
Jun 07, 2021
by
zhangtong5@yidian-inc.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:合并
parent
9fc288a8
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
66 additions
and
89 deletions
+66
-89
config.js
src/components/PageHeader/config.js
+1
-1
index.vue
src/components/PageHeader/index.vue
+2
-2
pageconfig.js
src/config/pageconfig.js
+3
-4
add-role.vue
src/pages/Role/add-role.vue
+12
-12
roleInfo.vue
src/pages/Role/components/roleInfo.vue
+0
-0
manage-role.vue
src/pages/Role/manage-role.vue
+17
-11
role-detail.vue
src/pages/Role/role-detail.vue
+8
-41
user-detail.vue
src/pages/User/user-detail.vue
+1
-1
index.vue
src/pages/User/userList/index.vue
+3
-4
index.js
src/router/index.js
+9
-3
index.js
src/store/index.js
+3
-3
authUtil.js
src/utils/authUtil.js
+7
-7
No files found.
src/components/PageHeader/config.js
View file @
9ce14e21
...
...
@@ -15,7 +15,7 @@ const headerConfig = {
name
:
'企业认证管理'
},
{
path
:
'/life
-no/life
'
,
path
:
'/life
No
'
,
name
:
'生活号管理'
},
{
...
...
src/components/PageHeader/index.vue
View file @
9ce14e21
...
...
@@ -43,7 +43,7 @@ export default {
};
},
computed
:
{
menuItemsWithAuth
:
function
()
{
menuItemsWithAuth
:
function
()
{
return
this
.
menuItems
.
filter
(
ele
=>
getModulePermissions
().
includes
(
ele
.
key
))
},
...
...
@@ -51,7 +51,7 @@ export default {
return
this
.
$route
.
path
;
},
},
beforeMount
()
{
beforeMount
()
{
},
methods
:
{},
};
...
...
src/config/pageconfig.js
View file @
9ce14e21
...
...
@@ -38,10 +38,11 @@ export const PAGEMODULE_PERMISSIONNAME = {
enterprise
:
'enterprise_certification_management'
,
lifeNo
:
'life_official_account_management'
,
role
:
'role_management'
,
roleAddRole
:
'role_addRole'
,
user
:
'user_management'
}
export
const
PERMISSIONNAME_PAGEMODULE
=
(
function
()
{
export
const
PERMISSIONNAME_PAGEMODULE
=
(
function
()
{
const
obj
=
{}
for
(
let
ele
in
PAGEMODULE_PERMISSIONNAME
)
{
obj
[
PAGEMODULE_PERMISSIONNAME
[
ele
]]
=
ele
...
...
@@ -57,10 +58,8 @@ export const PATH_PERMISSION_NAME = {
'/enterprise/certification'
:
'enterprise_certification_management'
,
'/enterprise/audit'
:
'enterprise_certification_management.audit'
,
'/enterprise/establish'
:
'enterprise_certification_management.create'
,
'/lifeNo'
:
'life_official_account_management'
,
'/roleManageRole'
:
'role_management'
,
'/roleAddRole'
:
'role_addRole'
,
'/user'
:
'user_management'
}
\ No newline at end of file
src/pages/Role/add-role.vue
View file @
9ce14e21
...
...
@@ -28,7 +28,7 @@
<el-form>
<!-- 编辑 -->
<div
v-if=
"edit"
>
<role
Detail
:role_info_detail=
"role_info_detail"
/>
<role
Info
:role_info_detail=
"role_info_detail"
/>
</div>
<!-- 新增 -->
<el-form-item
label=
"角色名称"
:label-width=
"formLabelWidth"
>
...
...
@@ -57,7 +57,7 @@
</template>
<
script
>
import
page
from
"../components/Pagination"
import
role
Detail
from
'./components/roleDetail
'
import
role
Info
from
'./components/roleInfo
'
import
{
getRole_list
as
reqGetRole_list
,
getAdd_role
as
reqGetAdd_role
,
getAll_role_list
as
reqGetAll_role_list
,
...
...
@@ -68,7 +68,7 @@ import { ElMessage } from 'element-plus'
export
default
{
components
:
{
page
,
role
Detail
role
Info
},
data
()
{
return
{
...
...
@@ -77,9 +77,9 @@ export default {
page_size
:
10
},
user_info
:
{
user_
name
:
"jianghaiming"
,
user_
email
:
"jianghaiming@126.com"
,
op_cur_user
:
"jianghaiming@yidian-inc.com"
,
name
:
"jianghaiming"
,
email
:
"jianghaiming@126.com"
,
//
op_cur_user: "jianghaiming@yidian-inc.com",
},
roleDataList
:
[],
totalNum
:
null
,
...
...
@@ -120,8 +120,9 @@ export default {
this
.
$router
.
push
({
name
:
'RoleDetail'
,
query
:
{
roleId
:
row
.
role_id
}
});
},
getPermissionsAll
()
{
let
{
user_name
,
user_email
}
=
this
.
user_info
reqGetAll_role_list
(
user_name
,
user_email
).
then
(
res
=>
{
// this.user_info = this.$store.state.userInfo
let
{
name
,
email
}
=
this
.
user_info
reqGetAll_role_list
(
name
,
email
).
then
(
res
=>
{
this
.
permissionsAll
=
res
})
},
...
...
@@ -131,6 +132,7 @@ export default {
this
.
roleTitle
=
'新增角色'
this
.
edit
=
false
this
.
roleName
=
""
this
.
selectedOptions
=
[]
},
//获取角色列表
getGetRole_list
()
{
...
...
@@ -205,7 +207,6 @@ export default {
}
})
this
.
selectedOptions
=
selectData
console
.
log
(
this
.
selectedOptions
,
'00008u989'
)
},
//编辑角色
getUpdate_role
()
{
...
...
@@ -214,9 +215,9 @@ export default {
return
false
}
let
{
role_name
,
role_id
,
role_status
}
=
this
.
role_info_detail
let
{
op_cur_user
}
=
this
.
user_info
let
{
email
}
=
this
.
user_info
role_name
=
this
.
roleName
reqGetUpdate_role
(
op_cur_user
,
role_name
,
role_id
,
role_status
,
this
.
permissionsUpdate
).
then
(
res
=>
{
reqGetUpdate_role
(
email
,
role_name
,
role_id
,
role_status
,
this
.
permissionsUpdate
).
then
(
res
=>
{
if
(
res
.
status
===
"success"
)
{
this
.
dialogFormVisible
=
false
this
.
edit
=
true
...
...
@@ -233,7 +234,6 @@ export default {
}
},
parentCateChange
(
id
)
{
console
.
log
(
id
,
'000'
)
this
.
getSelectedOptions
(
id
)
},
getSelectedOptions
(
selectedOptions
)
{
...
...
src/pages/Role/components/role
Detail
.vue
→
src/pages/Role/components/role
Info
.vue
View file @
9ce14e21
File moved
src/pages/Role/manage-role.vue
View file @
9ce14e21
...
...
@@ -35,9 +35,10 @@
></el-table-column>
<el-table-column
label=
"状态"
prop=
"role_status
"
:formatter=
"hasStatusFormat
"
align=
"center"
></el-table-column>
>
</el-table-column>
<el-table-column
label=
"最后修改日期"
prop=
"update_time"
...
...
@@ -128,9 +129,9 @@ export default {
roleStatus
:
''
},
user_info
:
{
user_name
:
this
.
$store
.
state
.
name
,
op_cur_user
:
"jianghaiming@yidian-inc.com"
,
user_
email
:
"jianghaiming@126.com"
,
name
:
"jianghaiming@yidian-inc.com"
,
//
op_cur_user: "jianghaiming@yidian-inc.com",
email
:
"jianghaiming@126.com"
,
},
parmas
:
{
page
:
1
,
...
...
@@ -160,12 +161,17 @@ export default {
this
.
getPermissionsAll
()
},
methods
:
{
hasStatusFormat
(
row
)
{
let
statusText
=
[
'正常'
,
'禁用'
,
'删除'
]
return
statusText
[
row
.
role_status
-
1
]
},
toRoleDetail
(
row
)
{
// this.$store.commit('update', '0000');
this
.
$router
.
push
({
name
:
'RoleDetail'
,
query
:
{
roleId
:
row
.
role_id
}
});
},
getPermissionsAll
()
{
let
{
user_name
,
user_
email
}
=
this
.
user_info
reqGetAll_role_list
(
user_name
,
user_
email
).
then
(
res
=>
{
let
{
name
,
email
}
=
this
.
user_info
reqGetAll_role_list
(
name
,
email
).
then
(
res
=>
{
this
.
permissionsAll
=
res
})
},
...
...
@@ -228,7 +234,7 @@ export default {
role_name
,
}
this
.
permissionsUpdate
=
permissions
let
{
op_cur_user
}
=
this
.
user_info
let
{
email
}
=
this
.
user_info
//当前用户
let
role_status
if
(
type
===
"disable"
)
{
role_status
=
2
...
...
@@ -242,7 +248,7 @@ export default {
role_status
=
""
}
if
(
type
!==
"modify"
)
{
this
.
getUpdate_role
(
op_cur_user
,
role_name
,
role_id
,
role_status
,
permissions
)
this
.
getUpdate_role
(
email
,
role_name
,
role_id
,
role_status
,
permissions
)
}
})
},
...
...
@@ -305,10 +311,10 @@ export default {
},
//确认修改
confirm
()
{
let
{
op_cur_user
}
=
this
.
user_info
let
{
email
}
=
this
.
user_info
let
{
role_id
,
role_name
}
=
this
.
role_info_detail
let
role_status
=
''
this
.
getUpdate_role
(
op_cur_user
,
role_name
,
role_id
,
role_status
,
this
.
currentRolePrivilege
)
this
.
getUpdate_role
(
email
,
role_name
,
role_id
,
role_status
,
this
.
currentRolePrivilege
)
},
parentCateChange
(
id
)
{
this
.
getSelectedOptions
(
id
)
...
...
src/pages/Role/role-detail.vue
View file @
9ce14e21
...
...
@@ -42,18 +42,6 @@
<div
class=
"tree"
v-if=
"selectedOptions"
>
<h5
style=
"margin-bottom: 10px"
>
角色范围
</h5>
<div
class=
"content"
>
<!-- <el-tree
:data="permissionsAll"
show-checkbox
:default-checked-keys="checkedKeys"
:default-expanded-keys="expandedKeys"
node-key="id"
ref="tree"
highlight-current
:props="defaultProps"
:expand-on-click-node="false"
>
</el-tree> -->
<el-cascader
v-model=
"selectedOptions"
:options=
"permissionsAll"
...
...
@@ -69,17 +57,14 @@
</template>
<
script
>
import
{
get_role_info
as
reqGet_role_info
,
getAll_role_list
as
reqGetAll_role_list
,
}
from
'../../service/role'
export
default
{
data
()
{
return
{
roleId
:
this
.
$route
.
query
.
roleId
,
defaultProps
:
{
children
:
'sub_permissions'
,
label
:
'desc'
},
user_info
:
{
user_
name
:
"jianghaiming"
,
user_
email
:
"jianghaiming@126.com"
,
name
:
"jianghaiming"
,
email
:
"jianghaiming@126.com"
,
},
props
:
{
multiple
:
true
,
//设置为多选
...
...
@@ -88,8 +73,6 @@ export default {
children
:
'sub_permissions'
//children值和哪个值绑定
},
selectedOptions
:
[],
checkedKeys
:
[],
expandedKeys
:
[],
permissionsAll
:
[],
role_info_detail
:
{
//详情非编辑项
role_id
:
""
,
...
...
@@ -99,19 +82,15 @@ export default {
update_user_name
:
""
,
create_time
:
""
,
create_user_name
:
""
}
,
}
}
},
created
()
{
let
{
user_name
,
user_email
}
=
this
.
user_info
reqGetAll_role_list
(
user_name
,
user_email
).
then
(
res
=>
{
// this.user_info = this.$store.state.userInfo
this
.
roleId
=
this
.
$route
.
query
.
roleId
let
{
name
,
email
}
=
this
.
user_info
reqGetAll_role_list
(
name
,
email
).
then
(
res
=>
{
this
.
permissionsAll
=
res
// this.permissionsAll.forEach(item => {
// item.disabled = true
// item.sub_permissions.forEach(element => {
// element.disabled = true
// })
// })
})
reqGet_role_info
(
this
.
roleId
).
then
((
res
)
=>
{
const
{
role_id
,
role_name
,
role_status
,
update_time
,
update_user_name
,
create_time
,
create_user_name
,
permissions
}
=
res
...
...
@@ -133,18 +112,6 @@ export default {
},
//遍历回显值selectedOptions
editEchoData
(
permissions
)
{
// let childArr = [], selectExpandedKeys = []
// permissions.forEach(item => {
// selectExpandedKeys.push(item.id)
// if (item.sub_permissions) {
// item.sub_permissions.forEach(element => {
// childArr.push(element.id)
// })
// }
// })
// this.checkedKeys = childArr
// this.expandedKeys = selectExpandedKeys
// console.log(this.checkedKeys, this.expandedKeys, ' this.expandedKeys ')
let
selectData
=
[]
permissions
.
map
(
item
=>
{
let
one
=
{
id
:
item
.
id
}
...
...
src/pages/User/user-detail.vue
View file @
9ce14e21
...
...
@@ -53,7 +53,7 @@ import { getUser_detail as reqGetUser_detail } from "../../service/user";
export
default
{
data
()
{
return
{
user_id
:
'1'
,
user_id
:
this
.
$route
.
query
.
userId
,
user_info
:
{},
role_list
:
[]
//角色池
}
...
...
src/pages/User/userList/index.vue
View file @
9ce14e21
...
...
@@ -26,7 +26,7 @@
:data=
"tableData"
border
style=
"width: 100%"
@
row-click=
"to
Life
Detail"
@
row-click=
"to
User
Detail"
>
<el-table-column
prop=
"id"
label=
"ID"
>
</el-table-column>
<el-table-column
prop=
"name"
label=
"用户姓名"
>
</el-table-column>
...
...
@@ -98,9 +98,8 @@ export default {
Object
.
assign
(
this
.
params
,
obj
)
this
.
getlifeNoList
(
this
.
params
)
},
toLifeDetail
(
row
)
{
// this.$router.push({ path: lifeNoDetail })
console
.
log
(
row
.
id
,
'eee去详情'
)
toUserDetail
(
row
)
{
this
.
$router
.
push
({
name
:
'UserDetail'
,
query
:
{
userId
:
row
.
id
}
});
},
//获取列表数据
getlifeNoList
()
{
...
...
src/router/index.js
View file @
9ce14e21
...
...
@@ -57,6 +57,9 @@ const routes = [
path
:
'/lifeNo'
,
name
:
'LifeNo'
,
component
:
LifeNo
,
meta
:
{
requireAuth
:
true
}
},
{
path
:
'/lifeNoDetail'
,
...
...
@@ -67,7 +70,7 @@ const routes = [
{
path
:
'/userDetail'
,
name
:
'UserDetail'
,
component
:
UserDetail
,
component
:
UserDetail
},
//角色管理
{
...
...
@@ -75,13 +78,16 @@ const routes = [
name
:
'AddRole'
,
component
:
AddRole
,
meta
:
{
requireAuth
:
true
,
requireAuth
:
true
}
},
{
path
:
'/roleManageRole'
,
name
:
'ManageRole'
,
component
:
ManageRole
component
:
ManageRole
,
meta
:
{
requireAuth
:
true
}
},
{
path
:
'/roleRoleDetail'
,
...
...
src/store/index.js
View file @
9ce14e21
...
...
@@ -7,15 +7,15 @@ export default createStore({
userInfo
:
null
,
},
mutations
:
{
updateUserPermission
(
state
,
payload
)
{
updateUserPermission
(
state
,
payload
)
{
state
.
permissions
=
payload
;
},
updateUserInfo
(
state
,
payload
)
{
updateUserInfo
(
state
,
payload
)
{
state
.
userInfo
=
payload
;
}
},
actions
:
{
async
updateUserPermission
({
commit
},
payload
)
{
async
updateUserPermission
({
commit
},
payload
)
{
const
{
permissions
=
[]
}
=
await
getPermissions
(
payload
.
email
);
console
.
log
(
"VUEX action updateUserPermission::"
,
permissions
);
commit
(
'updateUserPermission'
,
permissions
)
...
...
src/utils/authUtil.js
View file @
9ce14e21
...
...
@@ -3,7 +3,7 @@
import
store
from
'../store'
import
{
PAGEMODULE_PERMISSIONNAME
,
PERMISSIONNAME_PAGEMODULE
,
PATH_PERMISSION_NAME
}
from
'../config/pageconfig'
function
getPermissionObj
()
{
function
getPermissionObj
()
{
// 支持到二级权限
const
permissions
=
store
.
state
.
permissions
||
[];
const
authObj
=
{};
...
...
@@ -23,8 +23,8 @@ function getPermissionObj() {
* @param {*} path
* @returns
*/
export
function
checkPathAuth
(
path
)
{
const
authObj
=
getPermissionObj
();
export
function
checkPathAuth
(
path
)
{
const
authObj
=
getPermissionObj
();
if
(
path
in
PATH_PERMISSION_NAME
)
{
const
authArr
=
PATH_PERMISSION_NAME
[
path
].
split
(
'.'
);
...
...
@@ -45,8 +45,8 @@ export function checkPathAuth(path) {
* @param {*} module: 枚举值参考:PAGEMODULE_PERMISSIONNAME key
* @returns 自权限列表
*/
export
function
getModuleSubPermissions
(
module
)
{
const
authObj
=
getPermissionObj
();
export
function
getModuleSubPermissions
(
module
)
{
const
authObj
=
getPermissionObj
();
return
Object
.
keys
(
authObj
[
PAGEMODULE_PERMISSIONNAME
[
module
]])
}
...
...
@@ -54,8 +54,8 @@ export function getModuleSubPermissions(module) {
* 获取一级权限
* @returns 一级权限列表
*/
export
function
getModulePermissions
()
{
const
authObj
=
getPermissionObj
();
export
function
getModulePermissions
()
{
const
authObj
=
getPermissionObj
();
const
modules
=
Object
.
keys
(
authObj
).
map
(
ele
=>
PERMISSIONNAME_PAGEMODULE
[
ele
])
return
modules
.
filter
(
ele
=>
!!
ele
)
}
\ 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