Commit bdd3bed1 by 周海峰

no message

parent 9e370fdb
......@@ -17,7 +17,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: import.meta.env.VITE_APP_BASE_API,
// 超时
timeout: 10000
timeout: 20000
})
// request拦截器
......
......@@ -54,9 +54,9 @@
<div class="config-item">
<span class="required-label">*加密位置:</span>
<el-select v-model="fieldData.keepfirst" style="width: 120px">
<el-option label="保留前" value="0" />
<el-option label="保留后" value="1" />
<el-option label="既保留前" value="2" />
<el-option label="保留前" :value="0" />
<el-option label="保留后" :value="1" />
<el-option label="既保留前" :value="2" />
</el-select>
<el-input-number
v-model="fieldData.encdigit"
......@@ -66,7 +66,7 @@
style="width: 100px; margin-left: 10px;"
/>
<span class="unit"></span>
<span v-if="fieldData.keepfirst === '2'">
<span v-if="fieldData.keepfirst === 2">
<span class="unit">又保留后</span>
<el-input-number
v-model="fieldData.twoindex"
......@@ -107,7 +107,7 @@
</div>
</div>
<div class="action-row">
<el-checkbox v-model="fieldData.isLike" true-value="1" false-value="0">支持模糊</el-checkbox>
<el-checkbox v-model="fieldData.isLike" :true-value="1" :false-value="0">支持模糊</el-checkbox>
<div class="action-buttons">
<el-button @click="resetRules">重置规则</el-button>
<el-button type="primary" @click="confirmRules">确定规则</el-button>
......@@ -138,10 +138,10 @@ const props = defineProps({
maskingrulename: '',
encryptionSecretKeyId: '', // 密钥ID
secretkeyName: '', // 密钥名称
isLike: '',
encdigit: '',
keepfirst: '',
twoindex: '',
isLike: 0,
encdigit: 0,
keepfirst: 0,
twoindex: 0,
flag: "0"
})
}
......
......@@ -56,7 +56,7 @@
<el-table-column label="操作" width="100" align="center">
<template #default="{ row }">
<el-button v-if="row.secretkeyName && ['1', '5', '44', '10', '11'].includes(row.flag)" type="primary" size="small" @click="handleUnEncryptField(row)">解密</el-button>
<el-button v-if="row.secretkeyName && ['4', '6', '7', '9', '12'].includes(row.flag)" type="primary" size="small" @click="handleEncryptField(row)">加密</el-button>
<el-button v-if="row.secretkeyName && ['0','4', '6', '7', '9', '12'].includes(row.flag)" type="primary" size="small" @click="handleEncryptField(row)">加密</el-button>
</template>
</el-table-column>
<!-- 源长度 -->
......@@ -161,7 +161,7 @@ const getTableData = async () => {
if (encryptionItem) {
item.maskingruleid = encryptionItem.encryptionIdTrue
item.maskingrulename = encryptionItem.encryptionTypeName
item.secretkeyId = encryptionItem.secretKey.id // 编辑保存时,需要判断是否改变
item.secretkeyId = encryptionItem.secretKey // 编辑保存时,需要判断是否改变
item.secretkeyName = encryptionItem.encryptionTypeValue
item.flag = encryptionItem.flag
item.description = encryptionItem.describe_info || '', // 编辑保存时,需要判断是否改变
......@@ -180,6 +180,7 @@ const getTableData = async () => {
// 状态标识对象数组
const encryptFlag = [
{ value: '0', label: '无' },
{ value: '-2', label: '解密中' },
{ value: '-1', label: '加密中' },
{ value: '1', label: '加密完成' },
......@@ -342,12 +343,14 @@ const handleSave = async () => {
changedData[key] = {
columnType: current.typename,
describe_info: current.description || '',
encdigit: current.encdigit || '0',
keepfirst: String(current.keepfirst || '0'),
encdigit: String(current.encdigit || '0'),
encryptionSecretKeyId: current.secretkeyId || '',
flag: current.flag || '0',
note: current.remarks || '',
realitycolumnsize: String(current.columnsize || ''),
twoindex: current.twoindex || '0'
twoindex: String(current.twoindex || '0'),
isLike: String(current.isLike || '0')
}
hasChanges = true
}
......@@ -415,13 +418,14 @@ const currentField = ref({})
const openEncryptionDialog = async (row) => {
if(!isEditing.value) return
//验证table是否有重复的字段,如果重复提示
const hasRedundance = hasRedundanceColumns({
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
})
if (hasRedundance && hasRedundance.code === 'POP_00014' && !hasRedundance.code.flag) {
if (hasRedundance && !hasRedundance.flag) {
ElMessageBox.alert('当前表存在重复字段,请先处理重复字段', '提示', {
confirmButtonText: '确定',
type: 'warning'
......@@ -429,6 +433,7 @@ const openEncryptionDialog = async (row) => {
isEditing.value = false
return
}
}
// console.log('设置密钥openEncryptionDialog', row)
// console.log('当前字段:', row.columnname)
const [isLikeRes, encDigitRes] = await Promise.all([
......@@ -460,10 +465,10 @@ const openEncryptionDialog = async (row) => {
maskingrulename: row.maskingrulename,//加密规则名称
encryptionSecretKeyId: row.secretkeyId, // 密钥ID
secretkeyName: row.secretkeyName, // 密钥名称
isLike: isLikeRes.data,
isLike: Number(isLikeRes.data),
encdigit: Number(encDigitRes.data.encdigit),
keepfirst: encDigitRes.data.keepfirst,
twoindex: encDigitRes.data.twoindex,
keepfirst: Number(encDigitRes.data.keepfirst),
twoindex: Number(encDigitRes.data.twoindex),
flag: "0"
}
showEncryptionDialog.value = true
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论