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
e12d0c17
authored
2025-01-13 11:26:37 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix
1 parent
5ef564c4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
49 deletions
src/views/data_quality/assessDetail.vue
src/views/data_quality/qualityRules.vue
src/views/data_quality/ruleForm.vue
src/views/data_quality/ruleTemplate.vue
src/views/data_quality/assessDetail.vue
View file @
e12d0c1
...
...
@@ -226,6 +226,7 @@ const rulesDetailTableBtnClick = (scope, btn) => {
if
(
type
==
'ruleDetail'
)
{
detailLoading
.
value
=
true
;
if
(
detailJson
.
value
[
row
.
ruleConfGuid
])
{
detailInfo
.
value
=
detailJson
.
value
[
row
.
ruleConfGuid
];
ruleType
.
value
=
detailInfo
.
value
.
ruleCode
;
toSubjectTables
.
value
=
[{
guid
:
detailInfo
.
value
.
subjectGuid
,
...
...
src/views/data_quality/qualityRules.vue
View file @
e12d0c1
...
...
@@ -423,10 +423,10 @@ const tableBtnClick = (scope, btn) => {
});
}
else
{
router
.
push
({
name
:
'meta
dataQuery
'
,
name
:
'meta
Sheet
'
,
query
:
{
dataSourceGuid
:
row
.
dataSource
Guid
,
tableGuid
:
row
.
subjectGuid
id
:
row
.
subject
Guid
,
name
:
row
.
name
}
});
}
...
...
src/views/data_quality/ruleForm.vue
View file @
e12d0c1
...
...
@@ -134,6 +134,15 @@ watch(() => props.largeCategoryList, (val) => {
}
})
const
operationList
:
any
=
ref
([
{
label
:
'大于'
,
value
:
'>'
,
},
{
label
:
'小于'
,
value
:
'<'
,
},
{
label
:
'等于'
,
value
:
'='
,
},
{
label
:
'大于等于'
,
value
:
'>='
,
},
{
label
:
'小于等于'
,
value
:
'<='
,
},
{
label
:
'介于'
,
value
:
'between'
,
},
]);
/** 规范性检验规则 */
const
checkRulesList
:
any
=
ref
([]);
...
...
@@ -178,8 +187,8 @@ onBeforeMount(() => {
formItems
.
value
[
0
].
children
=
panelList
.
value
;
}
if
(
props
.
smallCategoryList
?.
length
)
{
let
p
=
formItems
.
value
[
0
].
default
;
if
(
p
)
{
let
p
=
panelList
.
value
[
1
]
;
if
(
p
.
default
)
{
if
(
p
.
default
==
'1'
)
{
//规范性
panelList
.
value
[
2
].
options
=
props
.
smallCategoryList
.
slice
(
0
,
6
);
}
else
if
(
p
.
default
==
'2'
)
{
...
...
@@ -868,6 +877,7 @@ const formBtnClick = (btn) => {
if
(
fIndex
>
-
1
)
{
let
f
=
normCheckTableListData
.
value
[
dialogSelectSubjectTable
.
value
.
enName
][
fIndex
];
f
.
checkRule
=
field
.
checkRule
;
f
.
checkRuleName
=
field
.
checkRuleName
;
f
.
configValue
=
field
.
configValue
;
if
(
f
.
checkRule
==
'length_rule'
)
{
let
vSplit
=
f
.
configValue
.
split
(
'#'
);
...
...
@@ -887,7 +897,7 @@ const formBtnClick = (btn) => {
}
const
selectChange
=
(
val
,
item
,
info
)
=>
{
setPanelListValue
(
info
,
true
);
setPanelListValue
(
info
,
item
.
field
==
'largeCategory'
);
};
/** 设置表单选项的值,防止largeCategory的options改变,重新赋值。 当radioGroupChange为true,init为false时,为用户手动切换,需要更新大类的默认值。 */
...
...
@@ -1252,7 +1262,8 @@ const listItemClick = (data) => {
if
(
fIndex
>
-
1
)
{
let
f
=
normCheckTableListData
.
value
[
dialogSelectSubjectTable
.
value
.
enName
][
fIndex
];
if
(
field
.
checkRule
)
{
f
.
checkRule
=
field
.
dataRange
;
f
.
checkRule
=
field
.
checkRule
;
f
.
checkRuleName
=
field
.
checkRuleName
;
f
.
configValue
=
field
.
configValue
;
if
(
field
.
checkRule
==
'length_rule'
)
{
let
vLen
=
f
.
configValue
?.
split
(
'#'
);
...
...
@@ -1419,7 +1430,8 @@ const validateFilter = () => {
validateFilterBtnDisable
.
value
=
true
;
validateSubjectTableRule
({
subjectGuid
:
dialogSelectSubjectTable
.
value
.
guid
,
condition
:
tableFilters
.
value
[
enName
]
condition
:
tableFilters
.
value
[
enName
],
dataSource
:
props
.
dataSource
||
props
.
value
.
dataSource
}).
then
((
res
:
any
)
=>
{
validateFilterBtnDisable
.
value
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
...
...
@@ -1617,7 +1629,8 @@ const validateSql = () => {
validateSqlBtnDisable
.
value
=
true
;
validateCustomSql
({
subjectGuid
:
dialogSelectSubjectTable
.
value
.
guid
,
sqlScript
:
sqlTableFilters
.
value
[
enName
]
sqlScript
:
sqlTableFilters
.
value
[
enName
],
dataSource
:
props
.
dataSource
||
props
.
value
.
dataSource
}).
then
((
res
:
any
)
=>
{
validateSqlBtnDisable
.
value
=
false
;
if
(
res
?.
code
==
proxy
.
$passCode
)
{
...
...
@@ -1972,12 +1985,19 @@ const submitNormCheck = () => {
ElMessage
.
error
(
`表【
${
table
}
】的字段【
${
field
.
enName
}
】设置了长度检验,但未选择操作符`
);
return
;
}
if
(
!
field
.
value
)
{
if
(
dialogSelectSubjectTable
.
value
.
enName
!=
table
)
{
normCheckFormListRef
.
value
.
setSelectList
(
table
,
'enName'
);
}
ElMessage
.
error
(
`表【
${
table
}
】的字段【
${
field
.
enName
}
】设置了长度检验,但未填写长度值`
);
return
;
}
if
(
field
.
operator
==
'between'
)
{
if
(
!
field
.
value1
&&
!
field
.
value
)
{
if
(
!
field
.
value1
)
{
if
(
dialogSelectSubjectTable
.
value
.
enName
!=
table
)
{
normCheckFormListRef
.
value
.
setSelectList
(
table
,
'enName'
);
}
ElMessage
.
error
(
`表【
${
table
}
】的字段【
${
field
.
enName
}
】设置了长度检验,但长度值未填写完整`
);
ElMessage
.
error
(
`表【
${
table
}
】的字段【
${
field
.
enName
}
】设置了长度检验,但长度
范围
值未填写完整`
);
return
;
}
if
(
parseInt
(
field
.
value
)
>=
parseInt
(
field
.
value1
))
{
...
...
@@ -1987,15 +2007,8 @@ const submitNormCheck = () => {
ElMessage
.
error
(
`表【
${
table
}
】的字段【
${
field
.
enName
}
】设置了长度检验,介于操作符对应的数值需符合后者大于前者`
);
return
;
}
field
.
configValue
=
field
.
operator
+
'#'
+
(
field
.
value
??
""
)
+
'#'
+
(
field
.
value1
??
""
)
;
field
.
configValue
=
field
.
operator
+
'#'
+
field
.
value
+
'#'
+
field
.
value1
;
}
else
{
if
(
!
field
.
value
)
{
if
(
dialogSelectSubjectTable
.
value
.
enName
!=
table
)
{
normCheckFormListRef
.
value
.
setSelectList
(
table
,
'enName'
);
}
ElMessage
.
error
(
`表【
${
table
}
】的字段【
${
field
.
enName
}
】设置了长度检验,但未填写长度值`
);
return
;
}
field
.
configValue
=
field
.
operator
+
'#'
+
field
.
value
;
}
}
...
...
@@ -2246,22 +2259,30 @@ defineExpose({
</el-table-column>
<el-table-column
label=
"值域"
width=
"280px"
align=
"left"
fixed=
"right"
>
<
template
#
default=
"scope"
>
<el-input
v-show=
"!scope.row.dataType || scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit' || scope.row.dataType == 'json' || scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string' || scope.row.dataType == 'numeric'"
v-model
.
trim=
"scope.row.dataRange"
clearable
placeholder=
"多值按照分号;分隔"
>
</el-input>
<!--
<div
class=
"range-sum"
v-show=
"scope.row.dataType == 'datetime' || scope.row.dataType == 'date'"
>
<span
v-if=
"props.readonly"
>
{{
(
!
scope
.
row
.
dataType
||
scope
.
row
.
dataType
==
'varchar'
||
scope
.
row
.
dataType
==
'char'
||
scope
.
row
.
dataType
==
'bit'
||
scope
.
row
.
dataType
==
'json'
||
scope
.
row
.
dataType
==
'text'
||
!
scope
.
row
.
dataType
||
scope
.
row
.
dataType
==
'string'
||
scope
.
row
.
dataType
==
'numeric'
)
?
(
scope
.
row
.
dataRange
||
'--'
)
:
(
scope
.
row
.
startValue
&&
scope
.
row
.
endValue
?
`${scope.row.startValue
}
~${scope.row.endValue
}
`
:
(
scope
.
row
.
startValue
!=
null
?
scope
.
row
.
startValue
:
(
scope
.
row
.
endValue
??
'--'
)))
}}
<
/span
>
<
template
v
-
else
>
<
el
-
input
v
-
show
=
"!scope.row.dataType || scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit' || scope.row.dataType == 'json' || scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string' || scope.row.dataType == 'numeric'"
v
-
model
.
trim
=
"scope.row.dataRange"
clearable
placeholder
=
"多值按照分号;分隔"
>
<
/el-input
>
<!--
<
div
class
=
"range-sum"
v
-
show
=
"scope.row.dataType == 'datetime' || scope.row.dataType == 'date'"
>
<
el
-
date
-
picker
v
-
model
=
"scope.row.dateValueRange"
type
=
"daterange"
range
-
separator
=
"至"
start
-
placeholder
=
"开始日期"
end
-
placeholder
=
"结束日期"
format
=
"YYYY-MM-DD"
value
-
format
=
"YYYY-MM-DD"
:
unlink
-
panels
=
"false"
:
disabled
=
"props.readonly"
/>
<
/div> --
>
<div
class=
"range-sum"
v-show=
"scope.row.dataType == 'datetime' || scope.row.dataType == 'date' || scope.row.dataType == 'int' || scope.row.dataType == 'decimal' || scope.row.dataType == 'tinyint' || scope.row.dataType == 'timestamp' || scope.row.dataType == 'time'"
>
<el-input
:disabled=
"props.readonly"
v-model
.
trim=
"scope.row.startValue"
placeholder=
"请输入"
clearable
>
</el-input>
<span
class=
"text"
>
至
</span>
<el-input
:disabled=
"props.readonly"
v-model
.
trim=
"scope.row.endValue"
placeholder=
"请输入"
clearable
>
</el-input>
</div>
<
div
class
=
"range-sum"
v
-
show
=
"scope.row.dataType == 'datetime' || scope.row.dataType == 'date' || scope.row.dataType == 'int' || scope.row.dataType == 'decimal' || scope.row.dataType == 'tinyint' || scope.row.dataType == 'timestamp' || scope.row.dataType == 'time'"
>
<
el
-
input
:
disabled
=
"props.readonly"
v
-
model
.
trim
=
"scope.row.startValue"
placeholder
=
"请输入"
clearable
>
<
/el-input
>
<
span
class
=
"text"
>
至
<
/span
>
<
el
-
input
:
disabled
=
"props.readonly"
v
-
model
.
trim
=
"scope.row.endValue"
placeholder
=
"请输入"
clearable
>
<
/el-input
>
<
/div
>
<
/template
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
...
...
@@ -2384,7 +2405,9 @@ defineExpose({
<
/el-table-column
>
<
el
-
table
-
column
label
=
"填写配置项"
width
=
"240px"
align
=
"left"
>
<
template
#
default
=
"scope"
>
<
span
v
-
if
=
"props.readonly"
>
{{
scope
.
row
.
configValue
??
'--'
}}
<
/span
>
<
span
v
-
if
=
"props.readonly"
>
{{
scope
.
row
.
configValue
!=
null
?
(
scope
.
row
.
checkRule
!=
'length_rule'
?
scope
.
row
.
configValue
:
(
scope
.
row
.
configValue
.
split
(
'#'
)?.
length
?
(
operationList
.
find
(
o
=>
o
.
value
==
scope
.
row
.
configValue
.
split
(
'#'
)[
0
]).
label
+
scope
.
row
.
configValue
.
split
(
'#'
).
slice
(
1
).
join
(
'~'
))
:
scope
.
row
.
configValue
))
:
'--'
}}
<
/span
>
<
span
v
-
else
-
if
=
"!scope.row.checkRule || ['id_card_rule', 'phone_number_rule', 'en_rule', 'ch_rule', 'num_value_rule'].includes(scope.row.checkRule)"
>--<
/span
>
<
template
v
-
else
>
...
...
@@ -2402,14 +2425,8 @@ defineExpose({
<div class="
range
-
sum
" v-show="
scope
.
row
.
checkRule
==
'length_rule'
">
<el-select v-model="
scope
.
row
.
operator
" placeholder="
请选择
" filterable clearable
:style="
{
width
:
scope
.
row
.
operator
==
'between'
?
'calc(33% - 2px)'
:
'calc(50% - 4px)'
}
">
<el-option v-for="
opt
in
[
{
label
:
'大于'
,
value
:
'>'
,
}
,
{
label
:
'小于'
,
value
:
'<'
,
}
,
{
label
:
'等于'
,
value
:
'='
,
}
,
{
label
:
'大于等于'
,
value
:
'>='
,
}
,
{
label
:
'小于等于'
,
value
:
'<='
,
}
,
{
label
:
'介于'
,
value
:
'between'
,
}
,
]
" :key="
opt
[
'value'
]
" :label="
opt
[
'label'
]
" :value="
opt
[
'value'
]
" />
<el-option v-for="
opt
in
operationList
" :key="
opt
[
'value'
]
" :label="
opt
[
'label'
]
"
:value="
opt
[
'value'
]
" />
</el-select>
<el-input :disabled="
props
.
readonly
" v-model.trim="
scope
.
row
.
value
" placeholder="
请输入
" clearable
:style="
{
width
:
scope
.
row
.
operator
==
'between'
?
'calc(33% - 2px)'
:
'calc(50% - 4px)'
}
"
...
...
src/views/data_quality/ruleTemplate.vue
View file @
e12d0c1
...
...
@@ -253,19 +253,23 @@ onBeforeMount(() => {
ElMessage
.
error
(
res
.
msg
);
}
})
getSmall
CategoryList
().
then
((
res
:
any
)
=>
{
let
ps1
=
getLarge
CategoryList
().
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
smallCategoryList
.
value
=
res
.
data
||
[];
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
})
getLargeCategoryList
().
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
largeCategoryList
.
value
=
res
.
data
||
[];
return
res
.
data
||
[];
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
});
let
ps2
=
getSmallCategoryList
().
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
return
res
.
data
||
[];
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
})
Promise
.
all
([
ps1
,
ps2
]).
then
((
res
:
any
[])
=>
{
largeCategoryList
.
value
=
res
[
0
];
smallCategoryList
.
value
=
res
[
1
];
})
})
...
...
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