Commit f4f5f2e0 by 周海峰

no message

parent 81da7747
......@@ -52,8 +52,8 @@ watch([currentNodeLevel, currentNodeData, activeTab], async ([level, node, tab])
console.log('查询表基本信息', node)
const res = await querytableInfo({
tableName: node.label,
dataSystemId: node.parent?.parent?.tid,
schema: node.parent?.parent?.label,
dataSystemId: node.dataSystemId,
schema: node.schema,
flag: '1',
projectId: projectId.value
})
......@@ -68,8 +68,8 @@ watch([currentNodeLevel, currentNodeData, activeTab], async ([level, node, tab])
console.log('查询表字段信息', node)
const res = await getfield({
tablename: node.label,
datasystemid: node.parent?.parent?.tid,
schema: node.parent?.parent?.label,
datasystemid: node.dataSystemId,
schema: node.schema,
taskid: ''
})
if (res && res.data) {
......@@ -115,7 +115,7 @@ onMounted(async () => {
// 树节点点击处理
const handleNodeClick = async (data) => {
currentNodeData.value = data
// 2. 点击一层系统数据,查 schemas
// 点击一层系统数据,查 schemas
if (data.type === 'system') {
activeTab.value = 'basic'
const res = await queryShemas({
......@@ -126,40 +126,51 @@ const handleNodeClick = async (data) => {
if (res && res.data) {
data.children = res.data.map(schema => ({
id: uuid(),
...schema,
dataSystemId: data.tid,
dbtype: data.dbtype,
projectid: projectId.value,
schema: schema.text,
type: 'database',
label: schema.text,
parent: data,
children: [
children: []
}))
treeData.value = [...treeData.value] // 触发视图更新
}
}
// 点击二层数据库,构造一层
if(data.type === 'database'){
data.children = [
{
id: uuid(),
label: '表',
type: 'category',
parent: {
...schema,
type: 'database',
label: schema.text,
dataSystemId: data.dataSystemId,
dbtype: data.dbtype,
projectid: data.projectid,
schema: data.schema,
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({
dataSystemId: parentDb.tid,
schema: parentDb.dbservername
dataSystemId: data.dataSystemId,
schema: data.schema
})
if (res && res.data) {
data.children = res.data.map(table => ({
...table,
dataSystemId: data.dataSystemId,
dbtype: data.dbtype,
projectid: data.projectid,
schema: data.schema,
realName: table.realName,
showName: table.showName,
id: uuid(),
label: table.showName,
type: 'table',
......
......@@ -199,14 +199,14 @@ const calculateLength = async() => {
}
// 这里应该是实际的加密长度计算逻辑
const res = await queryExtendColumnSize({
projectid: currentNodeData.value.parent?.parent?.parent?.project_id,
datasystemid: currentNodeData.value.parent?.parent?.tid,
tablecat: currentNodeData.value.parent?.parent?.label,
tablename: currentNodeData.value.label,
projectid: currentNodeData.value.projectid,
datasystemid: currentNodeData.value.dataSystemId,
tablecat: currentNodeData.value.tablecat,
tablename: currentNodeData.value.tablename,
columnname: props.fieldData.columnname,
columnsize: String(props.fieldData.columnSize),
columntype: props.fieldData.columnType,
dbtype: currentNodeData.value.parent?.parent?.parent?.dbtype,
dbtype: currentNodeData.value.dbtype,
islike: props.fieldData.isLike,
encryptionsecretkeyid: props.fieldData.encryptionSecretKeyId
})
......
......@@ -146,19 +146,20 @@ const tableDataCache = ref([])
const getTableData = async () => {
const node = currentNodeData.value
console.log('开始---------查询表的机密信--------------息', node)
// 查询字段原始值配置&字段加密配置
const [originalListRes, encryptionListRes] = await Promise.all([
queryOriginalList({
table_name: node.label,
datasystem_id: node.parent?.parent?.tid,
schema: node.parent?.parent?.label,
projectId: node.parent?.parent?.parent?.project_id
datasystem_id: node.dataSystemId,
schema: node.schema,
projectId: node.projectid
}),
queryEncryptionList({
table_name: node.label,
datasystem_id: node.parent?.parent?.tid,
schema: node.parent?.parent?.label,
projectId: node.parent?.parent?.parent?.project_id
datasystem_id: node.dataSystemId,
schema: node.schema,
projectId: node.projectid
})
])
if (originalListRes && originalListRes.data) {
......@@ -343,9 +344,9 @@ const handleBatchEncrypt = async() => {
*/
const buildBatchEncryptionParams = (flag) => {
return {
projectId: currentNodeData.value.parent?.parent?.parent?.project_id,
dataSystemId: currentNodeData.value.parent?.parent?.tid,
schema: currentNodeData.value.parent?.parent?.label,
projectId: currentNodeData.value.projectid,
dataSystemId: currentNodeData.value.dataSystemId,
schema: currentNodeData.value.schema,
tableName: currentNodeData.value.label,
flag: flag
}
......@@ -403,14 +404,15 @@ const handleBatchDecrypt = async () => {
// 删除多余列
const handleDeleteColumns = async () => {
console.log('开始---------删除多余列--------------',currentNodeData.value)
ElMessageBox.confirm('确认删除多余列吗?', '提示', {
type: 'warning'
}).then(async () => {
// 调用删除接口
const res = await delTableColumn({
projectId: currentNodeData.value.parent?.parent?.parent?.project_id,
dataSystemId: currentNodeData.value.parent?.parent?.tid,
schema: currentNodeData.value.parent?.parent?.label,
projectId: currentNodeData.value.projectid,
dataSystemId: currentNodeData.value.dataSystemId,
schema: currentNodeData.value.schema,
tableName: currentNodeData.value.label
})
if (res && res.code === 'POP_00014' && res.flag) {
......@@ -527,9 +529,9 @@ const openEncryptionDialog = async (row) => {
if(row.secretkeyId){
const hasRedundance = await hasRedundanceColumns({
table: currentNodeData.value.label,
datasystemid: currentNodeData.value.parent?.parent?.tid,
schema: currentNodeData.value.parent?.parent?.label,
projectid: currentNodeData.value.parent?.parent?.parent?.project_id
datasystemid: currentNodeData.value.dataSystemId,
schema: currentNodeData.value.schema,
projectid: currentNodeData.value.projectid
})
if (hasRedundance && !hasRedundance.flag) {
ElMessageBox.alert('当前表存在重复字段,请先处理重复字段', '提示', {
......@@ -692,7 +694,7 @@ const handleCellClick = (row, column) => {
* @returns {Object} params - 构建的参数对象
*/
const buildEncryptionParams = (row, isEncrypt) => {
const schema = currentNodeData.value.parent?.parent?.label;
const schema = currentNodeData.value.schema;
const tableName = currentNodeData.value.label;
const key = `${schema}.${tableName}.${row.columnname}`;
......@@ -700,11 +702,11 @@ const buildEncryptionParams = (row, isEncrypt) => {
columnName: row.columnname,
columnSize: String(row.columnsize),
columnType: row.typename,
dataSystemId: currentNodeData.value.parent?.parent?.tid,
dataSystemId: currentNodeData.value.dataSystemId,
flag: isEncrypt, // 加密是0,解密是1
map: {
dataSystemId: currentNodeData.value.parent?.parent?.tid,
projectId: currentNodeData.value.parent?.parent?.parent?.project_id,
dataSystemId: currentNodeData.value.dataSystemId,
projectId: currentNodeData.value.projectid,
map: {
[key]: {
columnType: row.typename,
......@@ -715,7 +717,7 @@ const buildEncryptionParams = (row, isEncrypt) => {
},
},
primaryKeys: tableData.value.filter((item) => item.primarykey === '1').map((item) => item.columnname),
projectId: currentNodeData.value.parent?.parent?.parent?.project_id,
projectId: currentNodeData.value.projectid,
schema: schema,
secretKeyId: row.secretkeyId,
tableName: tableName,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论