Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TF-MOM-WEB
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
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
TFMOM
TF-MOM-WEB
Commits
c9e3c7be
Commit
c9e3c7be
authored
Jan 24, 2024
by
jingnan
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并产品【10243 同 10248】【测评】控制不需要配置权限的模型包与模型不显示
parent
1993e7f8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
9 deletions
+50
-9
permTree.vue
applications/dee-perm/src/views/permission/permTree.vue
+24
-1
permission.vue
applications/dee-perm/src/views/permission/permission.vue
+1
-1
permTree.vue
applications/dee-perm/src/views/roleManagement/permTree.vue
+25
-7
No files found.
applications/dee-perm/src/views/permission/permTree.vue
View file @
c9e3c7be
...
...
@@ -27,6 +27,11 @@ export default {
appid
:
{
type
:
[
String
,
Number
],
default
:
()
=>
''
},
// 过滤模型
isFilterModel
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
...
...
@@ -104,7 +109,11 @@ export default {
el
.
target
&&
treeList
.
push
(
el
.
target
)
})
this
.
treeData
=
this
.
$utils
.
generateTree
(
treeList
,
{
id
:
'id'
,
pid
:
'parentId'
})
let
treeData
=
this
.
$utils
.
generateTree
(
treeList
,
{
id
:
'id'
,
pid
:
'parentId'
})
if
(
this
.
isFilterModel
)
{
treeData
=
this
.
removeHideModel
(
treeData
)
}
this
.
treeData
=
treeData
this
.
initTreeData
=
this
.
filterData
(
treeList
,
[])
this
.
$nextTick
(()
=>
{
this
.
$refs
.
tree
.
filter
(
'SOFT_TYPE'
)
...
...
@@ -121,6 +130,20 @@ export default {
this
.
modelData
=
[]
}
},
// 递归移除节点,避免出现父子节点错位问题
removeHideModel
(
children
)
{
if
(
Array
.
isArray
(
children
)
&&
children
.
length
>
0
)
{
return
children
.
filter
(
m
=>
{
if
(
m
.
modelIsShow
===
false
)
{
return
false
}
else
{
m
.
children
=
this
.
removeHideModel
(
m
.
children
)
}
return
true
})
}
return
children
},
filterData
(
tree
,
parentIds
)
{
const
treeData
=
[]
if
(
tree
instanceof
Array
)
{
...
...
applications/dee-perm/src/views/permission/permission.vue
View file @
c9e3c7be
...
...
@@ -18,7 +18,7 @@
/>
</el-select>
</div>
<permTree
ref=
"permTree"
@
change=
"changeNode"
/>
<permTree
ref=
"permTree"
:is-filter-model=
"true"
@
change=
"changeNode"
/>
</div>
</
template
>
<
template
slot=
"paneR"
>
...
...
applications/dee-perm/src/views/roleManagement/permTree.vue
View file @
c9e3c7be
...
...
@@ -54,21 +54,25 @@ export default {
if
(
!
id
)
{
return
}
let
findItem
=
null
if
(
apps
.
length
)
{
findItem
=
apps
.
find
(
r
=>
r
.
value
===
id
)
}
//
let findItem = null
//
if (apps.length) {
//
findItem = apps.find(r => r.value === id)
//
}
const
result
=
await
get
(
'/DxAppModelDefLink/findPackageByAppID'
,
{
appId
:
id
})
if
(
!
result
.
items
)
{
this
.
treeData
=
[]
this
.
nodeClick
(
null
,
[])
return
}
const
data
=
findItem
&&
findItem
.
data
.
name
===
'平台管理'
?
this
.
$utils
.
_clonedeep
(
result
.
items
).
filter
(
r
=>
r
.
name
!==
'DEX-SECURITYCENTER'
&&
r
.
name
!==
'User'
&&
r
.
name
!==
'DEX-AUTH'
&&
r
.
name
!==
'DEX-AUDIT'
)
:
this
.
$utils
.
_clonedeep
(
result
.
items
)
// packageIsShow 为 false 不展示
result
.
items
=
result
.
items
.
filter
(
m
=>
m
.
packageIsShow
!==
false
)
const
data
=
this
.
$utils
.
_clonedeep
(
result
.
items
)
// const data = findItem && findItem.data.name === '平台管理' ? this.$utils._clonedeep(result.items).filter(r => !['DEX-SECURITYCENTER', 'User', 'DEX-AUTH', 'DEX-AUDIT'].includes(r.name)) : this.$utils._clonedeep(result.items)
this
.
treeData
=
data
.
map
(
r
=>
{
if
(
r
.
modelDefinitionVOS
)
{
r
.
children
=
this
.
$utils
.
generateTree
(
this
.
$utils
.
_clonedeep
(
r
.
modelDefinitionVOS
),
{
id
:
'id'
,
pid
:
'parentId'
})
let
children
=
this
.
$utils
.
generateTree
(
this
.
$utils
.
_clonedeep
(
r
.
modelDefinitionVOS
),
{
id
:
'id'
,
pid
:
'parentId'
})
children
=
this
.
removeHideModel
(
children
)
r
.
children
=
children
}
return
r
})
...
...
@@ -77,6 +81,20 @@ export default {
})
this
.
nodeClick
(
this
.
treeData
[
0
],
[])
},
// 递归移除节点,避免出现父子节点错位问题
removeHideModel
(
children
)
{
if
(
Array
.
isArray
(
children
)
&&
children
.
length
>
0
)
{
return
children
.
filter
(
m
=>
{
if
(
m
.
modelIsShow
===
false
)
{
return
false
}
else
{
m
.
children
=
this
.
removeHideModel
(
m
.
children
)
}
return
true
})
}
return
children
},
filterData
(
tree
,
parentIds
)
{
const
treeData
=
[]
if
(
tree
instanceof
Array
)
{
...
...
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