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
f4f5f2e0
Commit
f4f5f2e0
authored
Aug 26, 2025
by
周海峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
81da7747
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
67 行增加
和
54 行删除
+67
-54
src/views/classification/Classification/index.vue
+40
-29
src/views/classification/Classification/modules/EncryptionRuleDialog.vue
+5
-5
src/views/classification/Classification/modules/EncryptionTab.vue
+22
-20
没有找到文件。
src/views/classification/Classification/index.vue
View file @
f4f5f2e0
...
@@ -52,8 +52,8 @@ watch([currentNodeLevel, currentNodeData, activeTab], async ([level, node, tab])
...
@@ -52,8 +52,8 @@ watch([currentNodeLevel, currentNodeData, activeTab], async ([level, node, tab])
console
.
log
(
'查询表基本信息'
,
node
)
console
.
log
(
'查询表基本信息'
,
node
)
const
res
=
await
querytableInfo
({
const
res
=
await
querytableInfo
({
tableName
:
node
.
label
,
tableName
:
node
.
label
,
dataSystemId
:
node
.
parent
?.
parent
?.
ti
d
,
dataSystemId
:
node
.
dataSystemI
d
,
schema
:
node
.
parent
?.
parent
?.
label
,
schema
:
node
.
schema
,
flag
:
'1'
,
flag
:
'1'
,
projectId
:
projectId
.
value
projectId
:
projectId
.
value
})
})
...
@@ -68,8 +68,8 @@ watch([currentNodeLevel, currentNodeData, activeTab], async ([level, node, tab])
...
@@ -68,8 +68,8 @@ watch([currentNodeLevel, currentNodeData, activeTab], async ([level, node, tab])
console
.
log
(
'查询表字段信息'
,
node
)
console
.
log
(
'查询表字段信息'
,
node
)
const
res
=
await
getfield
({
const
res
=
await
getfield
({
tablename
:
node
.
label
,
tablename
:
node
.
label
,
datasystemid
:
node
.
parent
?.
parent
?.
ti
d
,
datasystemid
:
node
.
dataSystemI
d
,
schema
:
node
.
parent
?.
parent
?.
label
,
schema
:
node
.
schema
,
taskid
:
''
taskid
:
''
})
})
if
(
res
&&
res
.
data
)
{
if
(
res
&&
res
.
data
)
{
...
@@ -115,7 +115,7 @@ onMounted(async () => {
...
@@ -115,7 +115,7 @@ onMounted(async () => {
// 树节点点击处理
// 树节点点击处理
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'
)
{
activeTab
.
value
=
'basic'
activeTab
.
value
=
'basic'
const
res
=
await
queryShemas
({
const
res
=
await
queryShemas
({
...
@@ -126,41 +126,52 @@ const handleNodeClick = async (data) => {
...
@@ -126,41 +126,52 @@ const handleNodeClick = async (data) => {
if
(
res
&&
res
.
data
)
{
if
(
res
&&
res
.
data
)
{
data
.
children
=
res
.
data
.
map
(
schema
=>
({
data
.
children
=
res
.
data
.
map
(
schema
=>
({
id
:
uuid
(),
id
:
uuid
(),
...
schema
,
dataSystemId
:
data
.
tid
,
dbtype
:
data
.
dbtype
,
projectid
:
projectId
.
value
,
schema
:
schema
.
text
,
type
:
'database'
,
type
:
'database'
,
label
:
schema
.
text
,
label
:
schema
.
text
,
parent
:
data
,
parent
:
data
,
children
:
[
children
:
[]
{
id
:
uuid
(),
label
:
'表'
,
type
:
'category'
,
parent
:
{
...
schema
,
type
:
'database'
,
label
:
schema
.
text
,
parent
:
data
,
tid
:
data
.
tid
,
dbservername
:
schema
.
text
},
children
:
[]
}
]
}))
}))
treeData
.
value
=
[...
treeData
.
value
]
// 触发视图更新
treeData
.
value
=
[...
treeData
.
value
]
// 触发视图更新
}
}
}
}
// 3. 点击三层 category,查表
if
(
data
.
type
===
'category'
&&
data
.
parent
)
{
// 点击二层数据库,构造一层
const
parentDb
=
data
.
parent
if
(
data
.
type
===
'database'
){
data
.
children
=
[
{
id
:
uuid
(),
label
:
'表'
,
type
:
'category'
,
dataSystemId
:
data
.
dataSystemId
,
dbtype
:
data
.
dbtype
,
projectid
:
data
.
projectid
,
schema
:
data
.
schema
,
parent
:
data
,
children
:
[]
}
]
}
// 点击三层 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'
,
parent
:
data
parent
:
data
...
...
src/views/classification/Classification/modules/EncryptionRuleDialog.vue
View file @
f4f5f2e0
...
@@ -199,14 +199,14 @@ const calculateLength = async() => {
...
@@ -199,14 +199,14 @@ const calculateLength = async() => {
}
}
// 这里应该是实际的加密长度计算逻辑
// 这里应该是实际的加密长度计算逻辑
const
res
=
await
queryExtendColumnSize
({
const
res
=
await
queryExtendColumnSize
({
projectid
:
currentNodeData
.
value
.
p
arent
?.
parent
?.
parent
?.
project_
id
,
projectid
:
currentNodeData
.
value
.
p
roject
id
,
datasystemid
:
currentNodeData
.
value
.
parent
?.
parent
?.
ti
d
,
datasystemid
:
currentNodeData
.
value
.
dataSystemI
d
,
tablecat
:
currentNodeData
.
value
.
parent
?.
parent
?.
label
,
tablecat
:
currentNodeData
.
value
.
tablecat
,
tablename
:
currentNodeData
.
value
.
label
,
tablename
:
currentNodeData
.
value
.
tablename
,
columnname
:
props
.
fieldData
.
columnname
,
columnname
:
props
.
fieldData
.
columnname
,
columnsize
:
String
(
props
.
fieldData
.
columnSize
),
columnsize
:
String
(
props
.
fieldData
.
columnSize
),
columntype
:
props
.
fieldData
.
columnType
,
columntype
:
props
.
fieldData
.
columnType
,
dbtype
:
currentNodeData
.
value
.
parent
?.
parent
?.
parent
?.
dbtype
,
dbtype
:
currentNodeData
.
value
.
dbtype
,
islike
:
props
.
fieldData
.
isLike
,
islike
:
props
.
fieldData
.
isLike
,
encryptionsecretkeyid
:
props
.
fieldData
.
encryptionSecretKeyId
encryptionsecretkeyid
:
props
.
fieldData
.
encryptionSecretKeyId
})
})
...
...
src/views/classification/Classification/modules/EncryptionTab.vue
View file @
f4f5f2e0
...
@@ -146,19 +146,20 @@ const tableDataCache = ref([])
...
@@ -146,19 +146,20 @@ const tableDataCache = ref([])
const
getTableData
=
async
()
=>
{
const
getTableData
=
async
()
=>
{
const
node
=
currentNodeData
.
value
const
node
=
currentNodeData
.
value
console
.
log
(
'开始---------查询表的机密信--------------息'
,
node
)
// 查询字段原始值配置&字段加密配置
// 查询字段原始值配置&字段加密配置
const
[
originalListRes
,
encryptionListRes
]
=
await
Promise
.
all
([
const
[
originalListRes
,
encryptionListRes
]
=
await
Promise
.
all
([
queryOriginalList
({
queryOriginalList
({
table_name
:
node
.
label
,
table_name
:
node
.
label
,
datasystem_id
:
node
.
parent
?.
parent
?.
ti
d
,
datasystem_id
:
node
.
dataSystemI
d
,
schema
:
node
.
parent
?.
parent
?.
label
,
schema
:
node
.
schema
,
projectId
:
node
.
p
arent
?.
parent
?.
parent
?.
project_
id
projectId
:
node
.
p
roject
id
}),
}),
queryEncryptionList
({
queryEncryptionList
({
table_name
:
node
.
label
,
table_name
:
node
.
label
,
datasystem_id
:
node
.
parent
?.
parent
?.
ti
d
,
datasystem_id
:
node
.
dataSystemI
d
,
schema
:
node
.
parent
?.
parent
?.
label
,
schema
:
node
.
schema
,
projectId
:
node
.
p
arent
?.
parent
?.
parent
?.
project_
id
projectId
:
node
.
p
roject
id
})
})
])
])
if
(
originalListRes
&&
originalListRes
.
data
)
{
if
(
originalListRes
&&
originalListRes
.
data
)
{
...
@@ -343,9 +344,9 @@ const handleBatchEncrypt = async() => {
...
@@ -343,9 +344,9 @@ const handleBatchEncrypt = async() => {
*/
*/
const
buildBatchEncryptionParams
=
(
flag
)
=>
{
const
buildBatchEncryptionParams
=
(
flag
)
=>
{
return
{
return
{
projectId
:
currentNodeData
.
value
.
p
arent
?.
parent
?.
parent
?.
project_
id
,
projectId
:
currentNodeData
.
value
.
p
roject
id
,
dataSystemId
:
currentNodeData
.
value
.
parent
?.
parent
?.
ti
d
,
dataSystemId
:
currentNodeData
.
value
.
dataSystemI
d
,
schema
:
currentNodeData
.
value
.
parent
?.
parent
?.
label
,
schema
:
currentNodeData
.
value
.
schema
,
tableName
:
currentNodeData
.
value
.
label
,
tableName
:
currentNodeData
.
value
.
label
,
flag
:
flag
flag
:
flag
}
}
...
@@ -403,14 +404,15 @@ const handleBatchDecrypt = async () => {
...
@@ -403,14 +404,15 @@ const handleBatchDecrypt = async () => {
// 删除多余列
// 删除多余列
const
handleDeleteColumns
=
async
()
=>
{
const
handleDeleteColumns
=
async
()
=>
{
console
.
log
(
'开始---------删除多余列--------------'
,
currentNodeData
.
value
)
ElMessageBox
.
confirm
(
'确认删除多余列吗?'
,
'提示'
,
{
ElMessageBox
.
confirm
(
'确认删除多余列吗?'
,
'提示'
,
{
type
:
'warning'
type
:
'warning'
}).
then
(
async
()
=>
{
}).
then
(
async
()
=>
{
// 调用删除接口
// 调用删除接口
const
res
=
await
delTableColumn
({
const
res
=
await
delTableColumn
({
projectId
:
currentNodeData
.
value
.
p
arent
?.
parent
?.
parent
?.
project_
id
,
projectId
:
currentNodeData
.
value
.
p
roject
id
,
dataSystemId
:
currentNodeData
.
value
.
parent
?.
parent
?.
ti
d
,
dataSystemId
:
currentNodeData
.
value
.
dataSystemI
d
,
schema
:
currentNodeData
.
value
.
parent
?.
parent
?.
label
,
schema
:
currentNodeData
.
value
.
schema
,
tableName
:
currentNodeData
.
value
.
label
tableName
:
currentNodeData
.
value
.
label
})
})
if
(
res
&&
res
.
code
===
'POP_00014'
&&
res
.
flag
)
{
if
(
res
&&
res
.
code
===
'POP_00014'
&&
res
.
flag
)
{
...
@@ -527,9 +529,9 @@ const openEncryptionDialog = async (row) => {
...
@@ -527,9 +529,9 @@ const openEncryptionDialog = async (row) => {
if(row.secretkeyId){
if(row.secretkeyId){
const hasRedundance = await hasRedundanceColumns({
const hasRedundance = await hasRedundanceColumns({
table: currentNodeData.value.label,
table: currentNodeData.value.label,
datasystemid: currentNodeData.value.
parent?.parent?.ti
d,
datasystemid: currentNodeData.value.
dataSystemI
d,
schema: currentNodeData.value.
parent?.parent?.label
,
schema: currentNodeData.value.
schema
,
projectid: currentNodeData.value.p
arent?.parent?.parent?.project_
id
projectid: currentNodeData.value.p
roject
id
})
})
if (hasRedundance && !hasRedundance.flag) {
if (hasRedundance && !hasRedundance.flag) {
ElMessageBox.alert('当前表存在重复字段,请先处理重复字段', '提示', {
ElMessageBox.alert('当前表存在重复字段,请先处理重复字段', '提示', {
...
@@ -692,7 +694,7 @@ const handleCellClick = (row, column) => {
...
@@ -692,7 +694,7 @@ const handleCellClick = (row, column) => {
* @returns {Object} params - 构建的参数对象
* @returns {Object} params - 构建的参数对象
*/
*/
const buildEncryptionParams = (row, isEncrypt) => {
const buildEncryptionParams = (row, isEncrypt) => {
const schema = currentNodeData.value.
parent?.parent?.label
;
const schema = currentNodeData.value.
schema
;
const tableName = currentNodeData.value.label;
const tableName = currentNodeData.value.label;
const key = `
$
{
schema
}.
$
{
tableName
}.
$
{
row
.
columnname
}
`;
const key = `
$
{
schema
}.
$
{
tableName
}.
$
{
row
.
columnname
}
`;
...
@@ -700,11 +702,11 @@ const buildEncryptionParams = (row, isEncrypt) => {
...
@@ -700,11 +702,11 @@ const buildEncryptionParams = (row, isEncrypt) => {
columnName: row.columnname,
columnName: row.columnname,
columnSize: String(row.columnsize),
columnSize: String(row.columnsize),
columnType: row.typename,
columnType: row.typename,
dataSystemId: currentNodeData.value.
parent?.parent?.ti
d,
dataSystemId: currentNodeData.value.
dataSystemI
d,
flag: isEncrypt, // 加密是0,解密是1
flag: isEncrypt, // 加密是0,解密是1
map: {
map: {
dataSystemId: currentNodeData.value.
parent?.parent?.ti
d,
dataSystemId: currentNodeData.value.
dataSystemI
d,
projectId: currentNodeData.value.p
arent?.parent?.parent?.project_
id,
projectId: currentNodeData.value.p
roject
id,
map: {
map: {
[key]: {
[key]: {
columnType: row.typename,
columnType: row.typename,
...
@@ -715,7 +717,7 @@ const buildEncryptionParams = (row, isEncrypt) => {
...
@@ -715,7 +717,7 @@ const buildEncryptionParams = (row, isEncrypt) => {
},
},
},
},
primaryKeys: tableData.value.filter((item) => item.primarykey === '1').map((item) => item.columnname),
primaryKeys: tableData.value.filter((item) => item.primarykey === '1').map((item) => item.columnname),
projectId: currentNodeData.value.p
arent?.parent?.parent?.project_
id,
projectId: currentNodeData.value.p
roject
id,
schema: schema,
schema: schema,
secretKeyId: row.secretkeyId,
secretKeyId: row.secretkeyId,
tableName: tableName,
tableName: tableName,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论