Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
9
91isoft_sys_web
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
张伯涛
91isoft_sys_web
Commits
c2dead9b
Commit
c2dead9b
authored
Jul 06, 2022
by
zhangyichen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
87b0d223
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
69 deletions
+83
-69
index.js
src/router/index.js
+2
-2
index.vue
src/views/system/role/index.vue
+81
-57
index.vue
src/views/system/user/index.vue
+0
-10
No files found.
src/router/index.js
View file @
c2dead9b
...
...
@@ -53,13 +53,13 @@ export const constantRoutes = [
path
:
'/forgetPwd/index'
,
component
:
(
resolve
)
=>
require
([
'@/views/login/forgetPwd'
],
resolve
),
name
:
'忘记密码'
,
meta
:
{
title
:
'忘记密码'
,
icon
:
'dashboard'
,
noCache
:
true
,
affix
:
true
}
meta
:
{
title
:
'忘记密码'
,
icon
:
'dashboard'
}
},
{
path
:
'/forgetPwd/reSet'
,
component
:
(
resolve
)
=>
require
([
'@/views/login/setPwd'
],
resolve
),
name
:
'重置密码'
,
meta
:
{
title
:
'重置密码'
,
icon
:
'dashboard'
,
noCache
:
true
,
affix
:
true
}
meta
:
{
title
:
'重置密码'
,
icon
:
'dashboard'
}
}
]
},
...
...
src/views/system/role/index.vue
View file @
c2dead9b
...
...
@@ -212,11 +212,11 @@
</el-col>
<el-col
style=
"width: 49%"
>
<el-form
:model=
"formDeptData"
label-width=
"80px"
>
<el-form-item
label=
"菜单名称"
prop=
"
menuId
"
>
<el-input
v-model=
"formDeptData.
menuId
"
placeholder=
"未选择菜单名称"
disabled
/>
<el-form-item
label=
"菜单名称"
prop=
"
label
"
>
<el-input
v-model=
"formDeptData.
label
"
placeholder=
"未选择菜单名称"
disabled
/>
</el-form-item>
<el-form-item
label=
"权限范围"
>
<el-select
v-model=
"formDeptData.dataScope"
>
<el-select
v-model=
"formDeptData.dataScope"
clearable
>
<el-option
v-for=
"item in dataScopeOptions"
:key=
"item.value"
...
...
@@ -225,12 +225,13 @@
/>
</el-select>
</el-form-item>
<el-form-item
v-show=
"formDeptData.dataScope ==
2
"
label=
"数据权限"
>
<el-form-item
v-show=
"formDeptData.dataScope ==
= '2'
"
label=
"数据权限"
>
<el-checkbox
v-model=
"deptExpand"
@
change=
"handleCheckedTreeExpand($event, 'dept')"
>
展开/折叠
</el-checkbox>
<el-checkbox
v-model=
"deptNodeAll"
@
change=
"handleCheckedTreeNodeAll($event, 'dept')"
>
全选/全不选
</el-checkbox>
<el-checkbox
v-model=
"formDeptData.
dept
CheckStrictly"
@
change=
"handleCheckedTreeConnect($event, 'dept')"
>
父子联动
</el-checkbox>
<el-checkbox
v-model=
"formDeptData.
menu
CheckStrictly"
@
change=
"handleCheckedTreeConnect($event, 'dept')"
>
父子联动
</el-checkbox>
<el-tree
ref=
"dept"
node-key=
"id"
class=
"tree-border"
:data=
"deptOptions"
:expand-on-click-node=
"false"
...
...
@@ -255,7 +256,7 @@
<
script
>
import
{
listRole
,
getRole
,
delRole
,
addRole
,
updateRole
,
exportRole
,
dataScope
,
changeRoleStatus
}
from
'@/api/system/role'
import
{
roleMenuTreeselectMC
,
treeselect
as
menuTreeselect
,
roleMenuTreeselect
}
from
'@/api/system/menu'
import
{
treeselect
as
menuTreeselect
,
roleMenuTreeselect
}
from
'@/api/system/menu'
import
{
treeselect
as
deptTreeselect
,
roleDeptTreeselect
,
treeselect
}
from
'@/api/system/dept'
export
default
{
name
:
'Role'
,
...
...
@@ -348,11 +349,14 @@ export default {
deptIds
:
''
,
businessId
:
''
},
idList
:
[],
formDeptData
:
{
menuId
:
''
,
id
:
''
,
label
:
''
,
dataScope
:
''
,
deptCheckStrictly
:
undefined
,
menuCheckStrictly
:
undefined
deptIdList
:
[],
deptCheckStrictly
:
false
,
menuCheckStrictly
:
false
},
defaultProps
:
{
children
:
'children'
,
...
...
@@ -391,24 +395,64 @@ export default {
}
this
.
getList
()
this
.
getDeptTreeselect
()
// this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
// this.statusOptions = response.data;
// });
},
// watch: {
// menuOptions() {
// this.menuOptions.forEach(item => {
// this.defaultExpandedKey.push(item.id)
// })
// this.$forceUpdate()
// }
// },
methods
:
{
nodeClick
(
data
)
{
console
.
log
(
data
)
this
.
form
.
menuId
=
data
.
label
this
.
$forceUpdate
()
this
.
idList
=
[]
this
.
getIdList
(
data
.
id
,
'idList'
)
this
.
getIdList
(
data
.
id
,
'menuCheckStrictly'
)
this
.
pushData
()
this
.
formDeptData
.
menuCheckStrictly
=
false
if
(
!
data
.
disabled
)
{
this
.
formDeptData
.
label
=
data
.
label
this
.
formDeptData
.
dataScope
=
data
.
dataScope
this
.
$nextTick
(
_
=>
{
console
.
log
(
this
.
menuCheckStrictly
)
this
.
$refs
.
dept
.
setCheckedKeys
([])
this
.
$refs
.
dept
.
setCheckedKeys
(
this
.
idList
)
this
.
formDeptData
.
menuCheckStrictly
=
this
.
menuCheckStrictly
})
this
.
formDeptData
.
id
=
data
.
id
}
},
getIdList
(
id
,
type
)
{
this
.
menuOptionData
.
forEach
(
item
=>
{
this
.
childrenForEachId
(
item
,
id
,
type
)
})
},
childrenForEachId
(
data
,
id
,
type
)
{
if
(
data
.
id
===
id
)
{
switch
(
type
)
{
case
'idList'
:
this
.
idList
=
data
.
deptIdList
break
case
'menuCheckStrictly'
:
this
.
menuCheckStrictly
=
data
.
menuCheckStrictly
break
}
}
if
(
'children'
in
data
)
{
data
.
children
.
forEach
(
item
=>
{
this
.
childrenForEachId
(
item
,
id
,
type
)
})
}
},
pushData
()
{
this
.
menuOptionData
.
forEach
(
item
=>
{
this
.
childrenForEach
(
item
)
})
},
childrenForEach
(
data
)
{
if
(
data
.
id
===
this
.
formDeptData
.
id
)
{
data
.
dataScope
=
this
.
formDeptData
.
dataScope
data
.
deptIdList
=
this
.
getDeptAllCheckedKeys
()
data
.
menuCheckStrictly
=
this
.
formDeptData
.
menuCheckStrictly
}
if
(
'children'
in
data
)
{
data
.
children
.
forEach
(
item
=>
{
this
.
childrenForEach
(
item
)
})
}
},
/** 查询角色列表 */
getList
()
{
...
...
@@ -430,13 +474,6 @@ export default {
)
})
},
/** 查询菜单列表 */
getMenuList
(
roleId
)
{
roleMenuTreeselectMC
(
roleId
).
then
(
response
=>
{
this
.
menuList
=
this
.
handleTree
(
response
.
data
.
menus
,
'businessId'
)
this
.
loading
=
false
})
},
/** 查询部门树结构 */
getDeptTreeselect
()
{
deptTreeselect
().
then
(
response
=>
{
...
...
@@ -459,7 +496,8 @@ export default {
// // 半选中的部门节点
const
halfCheckedKeys
=
this
.
$refs
.
dept
.
getCheckedKeys
()
checkedKeys
.
unshift
.
apply
(
checkedKeys
,
halfCheckedKeys
)
return
this
.
$refs
.
dept
.
getCheckedKeys
()
// return this.$refs.dept.getCheckedKeys()
return
checkedKeys
},
/** 根据角色ID查询菜单树结构 type1 编辑回显 type2 数据权限回显*/
getRoleMenuTreeselect
(
roleId
,
type
)
{
...
...
@@ -565,7 +603,7 @@ export default {
if
(
type
===
'menu'
)
{
this
.
form
.
menuCheckStrictly
=
!!
value
}
else
if
(
type
===
'dept'
)
{
this
.
formDeptData
.
dept
CheckStrictly
=
!!
value
this
.
formDeptData
.
menu
CheckStrictly
=
!!
value
}
},
// 树权限(全选/全不选)
...
...
@@ -616,10 +654,17 @@ export default {
},
/** 分配数据权限操作 选择菜单 */
handleMenu
(
row
)
{
this
.
formDeptData
=
{
id
:
''
,
label
:
''
,
dataScope
:
''
,
deptIdList
:
[],
deptCheckStrictly
:
false
,
menuCheckStrictly
:
false
}
this
.
reset
()
const
roleId
=
row
.
businessId
||
this
.
ids
console
.
log
(
'row'
,
row
)
// this.getMenuList(roleId) // 查询菜单列表树形显示
getRole
(
roleId
).
then
(
response
=>
{
this
.
getRoleMenuTreeselect
(
roleId
,
2
)
this
.
form
=
response
.
data
...
...
@@ -627,25 +672,6 @@ export default {
this
.
title
=
'分配数据权限'
})
},
/** 分配数据权限操作 */
handleDataScope
(
row
)
{
this
.
deptOptions
=
[]
this
.
form
.
dataScope
=
undefined
const
roleId
=
this
.
form
.
businessId
this
.
form
.
menuId
=
row
.
businessId
this
.
form
.
menuName
=
row
.
menuName
// this.form.businessId = row.businessId
// this.form.deptCheckStrictly = false
// this.form.deptIds = row.deptIds
const
roleDeptTreeselect
=
this
.
getRoleDeptTreeselect
(
roleId
,
this
.
form
.
menuId
)
this
.
$nextTick
(()
=>
{
roleDeptTreeselect
.
then
(
res
=>
{
this
.
$refs
.
dept
.
setCheckedKeys
(
res
.
data
.
checkedKeys
)
})
})
this
.
title
=
'分配数据权限'
},
/** 提交按钮 */
submitForm
:
function
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
...
...
@@ -682,7 +708,7 @@ export default {
},
/** 提交按钮(数据权限) */
submitDataScope
:
function
()
{
this
.
pushData
()
if
(
this
.
form
.
businessId
!==
undefined
&&
this
.
form
.
menuId
!==
undefined
)
{
this
.
form
.
deptIds
=
this
.
getDeptAllCheckedKeys
()
dataScope
(
this
.
form
).
then
(
response
=>
{
...
...
@@ -690,8 +716,6 @@ export default {
this
.
openDataScope
=
false
this
.
getList
()
})
console
.
log
(
'form'
,
this
.
form
)
// console.log('tree', this.deptOptions)
}
},
/** 删除按钮操作 */
...
...
@@ -748,7 +772,7 @@ export default {
},
// 节点单击事件
handleNodeClick
(
data
)
{
}
,
}
}
}
</
script
>
...
...
src/views/system/user/index.vue
View file @
c2dead9b
...
...
@@ -44,16 +44,6 @@
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-refresh"
size=
"small"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
<el-form-item
style=
"float: right"
>
<!--
<el-button-->
<!-- v-hasPermi="['sys:user:add']"-->
<!-- style="padding: 8px 7px;"-->
<!-- type="primary"-->
<!-- size="small"-->
<!-- icon="el-icon-plus"-->
<!-- @click="handleFormAdd"-->
<!-- >表单页新增模板
</el-button>
-->
<!-- v-hasPermi="['sys:user:add']"-->
<el-button
style=
"padding: 8px 7px;"
type=
"primary"
...
...
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