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
Hide 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 {
...
@@ -27,6 +27,11 @@ export default {
appid
:
{
appid
:
{
type
:
[
String
,
Number
],
type
:
[
String
,
Number
],
default
:
()
=>
''
default
:
()
=>
''
},
// 过滤模型
isFilterModel
:
{
type
:
Boolean
,
default
:
false
}
}
},
},
data
()
{
data
()
{
...
@@ -104,7 +109,11 @@ export default {
...
@@ -104,7 +109,11 @@ export default {
el
.
target
&&
treeList
.
push
(
el
.
target
)
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
.
initTreeData
=
this
.
filterData
(
treeList
,
[])
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
$refs
.
tree
.
filter
(
'SOFT_TYPE'
)
this
.
$refs
.
tree
.
filter
(
'SOFT_TYPE'
)
...
@@ -121,6 +130,20 @@ export default {
...
@@ -121,6 +130,20 @@ export default {
this
.
modelData
=
[]
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
)
{
filterData
(
tree
,
parentIds
)
{
const
treeData
=
[]
const
treeData
=
[]
if
(
tree
instanceof
Array
)
{
if
(
tree
instanceof
Array
)
{
...
...
applications/dee-perm/src/views/permission/permission.vue
View file @
c9e3c7be
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
/>
/>
</el-select>
</el-select>
</div>
</div>
<permTree
ref=
"permTree"
@
change=
"changeNode"
/>
<permTree
ref=
"permTree"
:is-filter-model=
"true"
@
change=
"changeNode"
/>
</div>
</div>
</
template
>
</
template
>
<
template
slot=
"paneR"
>
<
template
slot=
"paneR"
>
...
...
applications/dee-perm/src/views/roleManagement/permTree.vue
View file @
c9e3c7be
...
@@ -54,21 +54,25 @@ export default {
...
@@ -54,21 +54,25 @@ export default {
if
(
!
id
)
{
if
(
!
id
)
{
return
return
}
}
let
findItem
=
null
//
let findItem = null
if
(
apps
.
length
)
{
//
if (apps.length) {
findItem
=
apps
.
find
(
r
=>
r
.
value
===
id
)
//
findItem = apps.find(r => r.value === id)
}
//
}
const
result
=
await
get
(
'/DxAppModelDefLink/findPackageByAppID'
,
{
appId
:
id
})
const
result
=
await
get
(
'/DxAppModelDefLink/findPackageByAppID'
,
{
appId
:
id
})
if
(
!
result
.
items
)
{
if
(
!
result
.
items
)
{
this
.
treeData
=
[]
this
.
treeData
=
[]
this
.
nodeClick
(
null
,
[])
this
.
nodeClick
(
null
,
[])
return
return
}
}
// packageIsShow 为 false 不展示
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
)
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
=>
{
this
.
treeData
=
data
.
map
(
r
=>
{
if
(
r
.
modelDefinitionVOS
)
{
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
return
r
})
})
...
@@ -77,6 +81,20 @@ export default {
...
@@ -77,6 +81,20 @@ export default {
})
})
this
.
nodeClick
(
this
.
treeData
[
0
],
[])
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
)
{
filterData
(
tree
,
parentIds
)
{
const
treeData
=
[]
const
treeData
=
[]
if
(
tree
instanceof
Array
)
{
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