ce821ff2 by lihua

fix: 修复匿名化处理问题

1 parent 522ddfa8
......@@ -437,7 +437,13 @@ const parseFileData = (fileRaw) => {
sampleTableFields.value = [];
sampleTableData.value = [];
} else {
const res = await chTransformEn(json[0]);
try {
const res: any = await chTransformEn(json[0]);
if (res?.code != proxy.$passCode) {
sampleTableDataLoading.value = false;
proxy.$ElMessage.error(res.msg);
return;
}
let fields = res.data || [];
sampleTableFields.value = fields?.map((j, index) => {
return {
......@@ -469,8 +475,11 @@ const parseFileData = (fileRaw) => {
});
})
transferSampleData();
}
sampleTableDataLoading.value = false;
} catch (error) {
sampleTableDataLoading.value = false;
}
}
});
}
......@@ -745,6 +754,7 @@ onBeforeMount(() => {
dataSelectInfoItems.value[4].visible = dataSource == 1;
dataSelectInfoItems.value[5].visible = dataSource == 1;
dataSelectInfoItems.value[6].visible = dataSource == 2;
try {
//文件解析
if (dataSource == 2) {
let url = detailInfo.value.filePath?.url;
......@@ -755,14 +765,13 @@ onBeforeMount(() => {
refSignInfo?.msg && ElMessage.error(refSignInfo?.msg);
return;
}
obsDownloadRequest(refSignInfo?.data).then((res: any) => {
const fileRes: any = await obsDownloadRequest(refSignInfo?.data);
sampleTableDataLoading.value = false;
if (res && !res.msg) {
parseFileData(res);
if (fileRes && !fileRes.msg) {
parseFileData(fileRes);
} else {
res?.msg && ElMessage.error(res?.msg);
fileRes?.msg && ElMessage.error(fileRes?.msg);
}
})
// 会出现从文件切换到数据库时没有数据库列表的问题。
const res: any = await getDatabase({ connectStatus: 1 });
if (res?.code == proxy.$passCode) {
......@@ -821,6 +830,9 @@ onBeforeMount(() => {
});
}
fullscreenLoading.value = false;
} catch (error) {
fullscreenLoading.value = false;
}
} else {
fullscreenLoading.value = false;
proxy.$ElMessage.error(res.msg);
......
......@@ -139,6 +139,8 @@ const ruleModelTableInfo = ref({
return rd;
}) || [];
}
fieldRulesEndFormInfo.value.formInfo.items[0].default = '';
fieldRulesEndFormInfo.value.formInfo.items[1].default = '';
if (!row.desensitiveRuleCode) {
drawerInfo.value.container.contents = [fieldRulesFormInfo.value];
} else {
......@@ -450,6 +452,8 @@ const addRowRules = () => {
fieldChName: '',
upperOperator: '≤'
}];
fieldRulesEndFormInfo.value.formInfo.items[0].default = '';
fieldRulesEndFormInfo.value.formInfo.items[1].default = '';
drawerInfo.value.container.contents = [fieldRulesFormInfo.value, fieldRulesEndFormInfo.value];
}
......@@ -475,6 +479,7 @@ const drawerBtnClick = async (btn, info) => {
let desensitiveRuleDetailInfo = getDesensitiveRuleDetailInfo(info);
// 脱敏规则为掩盖,字符,区间替换存在时需要调用接口检验
if (info.desensitiveRuleCode == 'DISSEMBLE' || info.desensitiveRuleCode == 'CHARREPLACE' || info.desensitiveRuleCode == 'RANGEREPLACE') {
try {
let res: any = await validateAnonRule({
desensitiveRuleCode: info.desensitiveRuleCode,
value: '',
......@@ -482,6 +487,11 @@ const drawerBtnClick = async (btn, info) => {
})
if (res?.code != proxy.$passCode) {
proxy.$ElMessage.error(res.msg);
drawerInfo.value.footer.btns[1].loading = false;
return;
}
} catch (error) {
drawerInfo.value.footer.btns[1].loading = false;
}
}
drawerInfo.value.footer.btns[1].loading = false;
......@@ -553,6 +563,15 @@ const drawerSelectChange = (val, row, info) => {
}
}
});
if (val == 'RANGEREPLACE') {
let fieldName = info.fieldName;
let fieldChName = fieldName && props.fieldNameList.find(f => f.enName == fieldName)?.chName;
rangeReplaceRuleDetails.value.forEach(r => {
if (fieldChName && r.fieldChName != fieldChName) {
r.fieldChName = fieldChName;
}
});
}
if (!val) {
drawerInfo.value.container.contents = [fieldRulesFormInfo.value];
} else {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!