Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
ce821ff2
authored
2025-09-08 11:20:52 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 修复匿名化处理问题
1 parent
522ddfa8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
7 deletions
src/views/data_anonymization/anonTaskCreate.vue
src/views/data_anonymization/anonTaskStepTwo.vue
src/views/data_anonymization/anonTaskCreate.vue
View file @
ce821ff
...
...
@@ -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
&&
!
r
es
.
msg
)
{
parseFileData
(
r
es
);
if
(
fileRes
&&
!
fileR
es
.
msg
)
{
parseFileData
(
fileR
es
);
}
else
{
res
?.
msg
&&
ElMessage
.
error
(
r
es
?.
msg
);
fileRes
?.
msg
&&
ElMessage
.
error
(
fileR
es
?.
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
);
...
...
src/views/data_anonymization/anonTaskStepTwo.vue
View file @
ce821ff
...
...
@@ -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
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment