Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
nse-ui
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
吴超
nse-ui
Commits
3a2c2257
Commit
3a2c2257
authored
Aug 28, 2025
by
ningjihai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tree
parent
edbc8bba
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
62 行增加
和
42 行删除
+62
-42
src/views/desensitizationStrategy/DesensitizationStrategy/modules/StrategyAddDialog.vue
+61
-41
src/views/desensitizationStrategy/DesensitizationStrategy/modules/TreeFilter.vue
+1
-1
没有找到文件。
src/views/desensitizationStrategy/DesensitizationStrategy/modules/StrategyAddDialog.vue
View file @
3a2c2257
...
@@ -141,7 +141,7 @@ import { ref, reactive, watch, computed, nextTick,toRaw } from 'vue'
...
@@ -141,7 +141,7 @@ import { ref, reactive, watch, computed, nextTick,toRaw } from 'vue'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
DesensitizationRuleDialog
from
'./DesensitizationRuleDialog.vue'
import
DesensitizationRuleDialog
from
'./DesensitizationRuleDialog.vue'
import
useAppStore
from
'@/store/modules/app'
import
{
import
{
desensitizationruleQuery
,
desensitizationruleQuery
,
queryversion
,
queryversion
,
...
@@ -158,6 +158,9 @@ queryDesensitizationTables
...
@@ -158,6 +158,9 @@ queryDesensitizationTables
import
{
queryTables
,
query
}
from
'@/api/classification/classification.js'
import
{
queryTables
,
query
}
from
'@/api/classification/classification.js'
import
TreeFilter
from
'./TreeFilter.vue'
import
TreeFilter
from
'./TreeFilter.vue'
const
appStore
=
useAppStore
()
const
props
=
defineProps
({
const
props
=
defineProps
({
title
:
{
title
:
{
type
:
String
,
type
:
String
,
...
@@ -553,7 +556,9 @@ const handleRuleConfirm = (str,data) =>{
...
@@ -553,7 +556,9 @@ const handleRuleConfirm = (str,data) =>{
}
}
const
getNodeIcon
=
(
type
)
=>
{
return
appStore
.
DATABASE_ICONS
[
type
]
}
// 生成唯一标识符
// 生成唯一标识符
function
uuid
()
{
function
uuid
()
{
...
@@ -564,54 +569,68 @@ function uuid() {
...
@@ -564,54 +569,68 @@ function uuid() {
}
}
// 树节点点击处理
// 树节点点击处理
const
handleNodeClick
=
async
(
data
)
=>
{
const
handleNodeClick
=
async
(
data
)
=>
{
currentNodeData
.
value
=
data
currentNodeData
.
value
=
data
//
2.
点击一层系统数据,查 schemas
// 点击一层系统数据,查 schemas
if
(
data
.
type
===
'system'
)
{
if
(
data
.
type
===
'system'
)
{
const
res
=
await
queryShemas
({
const
res
=
await
queryShemas
({
dataSystemId
:
data
.
tid
,
dataSystemId
:
data
.
tid
,
dataType
:
data
.
dbtype
,
dataType
:
data
.
dbtype
,
projectid
:
sessionStorage
.
getItem
(
'projectId'
)
projectid
:
sessionStorage
.
getItem
(
'projectId'
)
||
''
})
})
if
(
res
&&
res
.
data
)
{
if
(
res
&&
res
.
data
)
{
data
.
children
=
res
.
data
.
map
(
schema
=>
({
data
.
children
=
res
.
data
.
map
(
schema
=>
({
id
:
uuid
(),
dataSystemId
:
data
.
tid
,
dbtype
:
data
.
dbtype
,
projectid
:
sessionStorage
.
getItem
(
'projectId'
)
||
''
,
schema
:
schema
.
text
,
type
:
'database'
,
label
:
schema
.
text
,
parent
:
data
,
icon
:
getNodeIcon
(
'DATABASE'
),
children
:
[]
}))
treeData
.
value
=
[...
treeData
.
value
]
// 触发视图更新
}
}
// 点击二层数据库,构造一层
if
(
data
.
type
===
'database'
){
data
.
children
=
[
{
id
:
uuid
(),
id
:
uuid
(),
...
schema
,
label
:
'表'
,
type
:
'database'
,
type
:
'category'
,
label
:
schema
.
text
,
dataSystemId
:
data
.
dataSystemId
,
parent
:
data
,
dbtype
:
data
.
dbtype
,
children
:
[
projectid
:
data
.
projectid
,
{
schema
:
data
.
schema
,
id
:
uuid
(),
parent
:
data
,
label
:
'表'
,
icon
:
getNodeIcon
(
'queryTables'
),
type
:
'category'
,
children
:
[]
parent
:
{
}
...
schema
,
]
type
:
'database'
,
label
:
schema
.
text
,
parent
:
data
,
tid
:
data
.
tid
,
dbservername
:
schema
.
text
},
children
:
[]
}
]
}))
treeData
.
value
=
[...
treeData
.
value
]
// 触发视图更新
}
}
}
// 3. 点击三层 category,查表
if
(
data
.
type
===
'category'
&&
data
.
parent
)
{
const
parentDb
=
data
.
parent
// 点击三层 category,查表
if
(
data
.
type
===
'category'
)
{
const
res
=
await
queryTables
({
const
res
=
await
queryTables
({
dataSystemId
:
parentDb
.
ti
d
,
dataSystemId
:
data
.
dataSystemI
d
,
schema
:
parentDb
.
dbservername
schema
:
data
.
schema
})
})
if
(
res
&&
res
.
data
)
{
if
(
res
&&
res
.
data
)
{
data
.
children
=
res
.
data
.
map
(
table
=>
({
data
.
children
=
res
.
data
.
map
(
table
=>
({
...
table
,
dataSystemId
:
data
.
dataSystemId
,
id
:
uuid
(),
dbtype
:
data
.
dbtype
,
projectid
:
data
.
projectid
,
schema
:
data
.
schema
,
realName
:
table
.
realName
,
showName
:
table
.
showName
,
id
:
uuid
(),
label
:
table
.
showName
,
label
:
table
.
showName
,
type
:
'table'
,
type
:
'table'
,
icon
:
getNodeIcon
(
'TABLE'
),
parent
:
data
parent
:
data
}))
}))
treeData
.
value
=
[...
treeData
.
value
]
treeData
.
value
=
[...
treeData
.
value
]
...
@@ -689,6 +708,7 @@ const openDialog = async (mode, strategyData = null) => {
...
@@ -689,6 +708,7 @@ const openDialog = async (mode, strategyData = null) => {
...
item
,
...
item
,
label
:
item
.
sysname
,
label
:
item
.
sysname
,
type
:
'system'
,
type
:
'system'
,
icon
:
getNodeIcon
(
item
.
dbtype
),
children
:
[
children
:
[
]
]
}))
}))
...
...
src/views/desensitizationStrategy/DesensitizationStrategy/modules/TreeFilter.vue
View file @
3a2c2257
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
>
>
<template
#
default=
"
{ node, data }">
<template
#
default=
"
{ node, data }">
<span
class=
"custom-tree-node"
>
<span
class=
"custom-tree-node"
>
<i
:class=
"getNodeIcon(data.type)"
class=
"node-icon
"
></i>
<i
class=
"iconfont node-icon"
v-html=
"data.icon.text"
:style=
"`color: $
{data.icon.color};`
">
</i>
<span>
{{
node
.
label
}}
</span>
<span>
{{
node
.
label
}}
</span>
<template
v-if=
"data.type === 'category'"
>
<template
v-if=
"data.type === 'category'"
>
<i
class=
"el-icon-collection icon-category"
style=
"margin-left:6px;color:#F7BA2A;font-size:16px;"
></i>
<i
class=
"el-icon-collection icon-category"
style=
"margin-left:6px;color:#F7BA2A;font-size:16px;"
></i>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论