Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a16751f2
authored
Mar 02, 2023
by
bimei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
底座bug修改
parent
5718c788
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
34 deletions
+96
-34
src/views/system/role/index.vue
+48
-31
src/views/system/tenantPackage/index.vue
+18
-1
src/views/system/tenantPackage/tenantPackage.data.ts
+6
-1
src/views/system/user/index.vue
+24
-1
No files found.
src/views/system/role/index.vue
View file @
a16751f2
...
...
@@ -99,37 +99,47 @@
</el-select>
</el-form-item>
<!-- 分配角色的菜单权限对话框 -->
<el-form-item
label=
"权限范围"
v-if=
"
actionScopeType === 'menu' || dataScopeForm.dataScope === SystemDataScopeEnum.DEPT_CUSTOM
"
>
<el-card
shadow=
"never"
>
<
template
#
header
>
父子联动(选中父节点,自动选择子节点):
<el-switch
v-model=
"checkStrictly"
inline-prompt
active-text=
"是"
inactive-text=
"否"
/>
全选/全不选:
<el-switch
v-model=
"treeNodeAll"
inline-prompt
active-text=
"是"
inactive-text=
"否"
@
change=
"handleCheckedTreeNodeAll()"
/>
</
template
>
<el-tree
ref=
"treeRef"
node-key=
"id"
show-checkbox
:default-checked-keys=
"defaultCheckedKeys"
:check-strictly=
"!checkStrictly"
:props=
"defaultProps"
:data=
"treeOptions"
empty-text=
"加载中,请稍后"
/>
</el-card>
</el-form-item>
<el-row>
<el-col
:span=
"24"
>
<el-form-item
label=
"权限范围"
v-if=
"
actionScopeType === 'menu' ||
dataScopeForm.dataScope === SystemDataScopeEnum.DEPT_CUSTOM
"
style=
"display: flex"
>
<el-card
class=
"card"
shadow=
"never"
>
<
template
#
header
>
父子联动(选中父节点,自动选择子节点):
<el-switch
v-model=
"checkStrictly"
inline-prompt
active-text=
"是"
inactive-text=
"否"
/>
全选/全不选:
<el-switch
v-model=
"treeNodeAll"
inline-prompt
active-text=
"是"
inactive-text=
"否"
@
change=
"handleCheckedTreeNodeAll()"
/>
</
template
>
<el-tree
ref=
"treeRef"
node-key=
"id"
show-checkbox
:default-checked-keys=
"defaultCheckedKeys"
:check-strictly=
"!checkStrictly"
:props=
"defaultProps"
:data=
"treeOptions"
empty-text=
"加载中,请稍后"
/>
</el-card>
</el-form-item>
</el-col
></el-row>
</el-form>
<!-- 操作按钮 -->
<
template
#
footer
>
...
...
@@ -312,3 +322,10 @@ onMounted(() => {
init
()
})
</
script
>
<
style
scoped
>
.card
{
width
:
100%
;
max-height
:
400px
;
overflow-y
:
scroll
;
}
</
style
>
src/views/system/tenantPackage/index.vue
View file @
a16751f2
...
...
@@ -25,7 +25,7 @@
ref=
"formRef"
>
<
template
#
menuIds
>
<el-card
class=
"w-120"
>
<el-card>
<template
#
header
>
<div
class=
"card-header"
>
全选/全不选:
...
...
@@ -91,6 +91,16 @@ const dialogTitle = ref('edit') // 弹出层标题
const
handleCheckedTreeNodeAll
=
()
=>
{
treeRef
.
value
!
.
setCheckedNodes
(
treeNodeAll
.
value
?
menuOptions
.
value
:
[])
}
const
validateCategory
=
(
rule
:
any
,
value
:
any
,
callback
:
any
)
=>
{
if
(
!
treeRef
.
value
!
.
getCheckedKeys
().
length
)
{
callback
(
new
Error
(
'该项为必填项'
))
}
else
{
callback
()
}
}
rules
.
menuIds
=
[{
required
:
true
,
validator
:
validateCategory
,
trigger
:
'blur'
}]
const
getTree
=
async
()
=>
{
const
res
=
await
listSimpleMenusApi
()
menuOptions
.
value
=
handleTree
(
res
)
...
...
@@ -166,3 +176,10 @@ onMounted(async () => {
})
// getList()
</
script
>
<
style
scoped
>
.el-card
{
width
:
100%
;
max-height
:
400px
;
overflow-y
:
scroll
;
}
</
style
>
src/views/system/tenantPackage/tenantPackage.data.ts
View file @
a16751f2
...
...
@@ -33,7 +33,12 @@ const crudSchemas = reactive<VxeCrudSchema>({
{
title
:
'菜单权限'
,
field
:
'menuIds'
,
isTable
:
false
isTable
:
false
,
form
:
{
colProps
:
{
span
:
24
}
}
},
{
title
:
t
(
'form.remark'
),
...
...
src/views/system/user/index.vue
View file @
a16751f2
...
...
@@ -159,7 +159,7 @@
:data=
"detailData"
>
<
template
#
deptId=
"{ row }"
>
<
span>
{{
row
.
dept
?.
name
}}
</span
>
<
el-tag>
{{
dataFormater
(
row
.
deptId
)
}}
</el-tag
>
</
template
>
<
template
#
postIds=
"{ row }"
>
<template
v-if=
"row.postIds !== ''"
>
...
...
@@ -332,6 +332,29 @@ const getPostOptions = async () => {
const
res
=
await
listSimplePostsApi
()
postOptions
.
value
.
push
(...
res
)
}
const
dataFormater
=
(
val
)
=>
{
return
deptFormater
(
deptOptions
.
value
,
val
)
}
//部门回显
const
deptFormater
=
(
ary
,
val
:
any
)
=>
{
var
o
=
''
if
(
ary
&&
val
)
{
for
(
const
v
of
ary
)
{
if
(
v
.
id
==
val
)
{
o
=
v
.
name
if
(
o
)
return
o
}
else
if
(
v
.
children
?.
length
)
{
o
=
deptFormater
(
v
.
children
,
val
)
if
(
o
)
return
o
}
}
return
o
}
else
{
return
val
}
}
// 设置标题
const
setDialogTile
=
async
(
type
:
string
)
=>
{
dialogTitle
.
value
=
t
(
'action.'
+
type
)
...
...
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