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
73c42038
authored
2025-01-11 16:13:17 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 数据质量
1 parent
72a20f40
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
33 deletions
src/views/data_meta/metadataQuery.vue
src/views/data_quality/analysisReport.vue
src/views/data_quality/assessTemplate.vue
src/views/data_quality/qualityRules.vue
src/views/data_quality/ruleForm.vue
src/views/data_meta/metadataQuery.vue
View file @
73c4203
...
...
@@ -382,7 +382,7 @@ const getQueryTreeData = ()=>{
currNodeInfo
.
value
=
{
type
:
2
,
guid
:
dataSourceGuid
,
name
:
datasourceName
}
}
nextTick
(()
=>
{
treeInfo
.
value
.
currentNodeKey
=
currentNodeKey
.
value
treeInfo
.
value
.
currentNodeKey
=
<
string
>
route
.
query
.
tableGuid
||
currentNodeKey
.
value
;
treeInfo
.
value
.
expandedKey
=
expandedKey
.
value
})
nodeClick
({
type
:
2
,
guid
:
dataSourceGuid
,
name
:
datasourceName
})
...
...
src/views/data_quality/analysisReport.vue
View file @
73c4203
...
...
@@ -683,7 +683,6 @@ const download = () => {
<
div
v
-
show
=
"!isWordStyle"
class
=
"header-detail"
>
<
template
v
-
if
=
"detailInfo.analysisReportType == 1"
>
<
span
>
{{
'表名称:'
+
(
detailInfo
.
qualityModelName
??
'--'
)
}}
<
/span
>
<
span
style
=
"margin-left: 40px;"
>
{{
'所属主题:'
+
(
detailInfo
.
subjectDomainName
??
'--'
)
}}
<
/span
>
<
span
style
=
"margin-left: 40px;"
>
{{
'所属数据源:'
+
(
detailInfo
.
dataSourceName
??
'--'
)
}}
<
/span
>
<
/template
>
<
span
v
-
else
-
if
=
"detailInfo.analysisReportType == 3"
>
{{
'分组名称:'
+
(
detailInfo
.
qualityModelGroupName
??
'--'
)
...
...
@@ -787,7 +786,6 @@ const download = () => {
<
div
style
=
" height: 40px;line-height: 40px;font-size: 14px;color: #666666;"
>
<
template
v
-
if
=
"detailInfo.analysisReportType == 1"
>
<
span
>
{{
'表名称:'
+
(
detailInfo
.
qualityModelName
??
'--'
)
}}
<
/span
>
<
span
style
=
"margin-left: 40px;"
>
{{
'所属主题:'
+
(
detailInfo
.
subjectDomainName
??
'--'
)
}}
<
/span
>
<
span
style
=
"margin-left: 40px;"
>
{{
'所属数据源:'
+
(
detailInfo
.
dataSourceName
??
'--'
)
}}
<
/span
>
<
/template
>
<
span
v
-
else
-
if
=
"detailInfo.analysisReportType == 3"
>
{{
'分组名称:'
+
(
detailInfo
.
qualityModelGroupName
??
'--'
)
...
...
src/views/data_quality/assessTemplate.vue
View file @
73c4203
...
...
@@ -331,7 +331,7 @@ onActivated(() => {
let
tab
:
any
=
userStore
.
tabbar
.
find
((
tab
:
any
)
=>
tab
.
fullPath
===
fullPath
);
if
(
tab
)
{
if
(
route
.
query
.
detail
)
{
tab
.
meta
.
title
=
`
新建规则(
${
route
.
query
.
planName
}
)
`
;
tab
.
meta
.
title
=
`
方案详情-
${
route
.
query
.
planName
}
`
;
if
(
fullPath
===
route
.
fullPath
)
{
document
.
title
=
tab
.
meta
.
title
;
}
...
...
src/views/data_quality/qualityRules.vue
View file @
73c4203
...
...
@@ -28,10 +28,8 @@ import {
import
useDataQualityStore
from
"@/store/modules/dataQuality"
;
import
{
useValidator
}
from
'@/hooks/useValidator'
;
import
{
TableColumnWidth
}
from
'@/utils/enum'
;
import
useDataCatalogStore
from
"@/store/modules/dataCatalog"
;
const
dataQualityStore
=
useDataQualityStore
();
const
dataCatalogStore
=
useDataCatalogStore
();
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
{
orderNum
,
description
}
=
useValidator
();
...
...
@@ -411,10 +409,27 @@ const tableBtnClick = (scope, btn) => {
}
else
if
(
type
==
"delete"
)
{
open
(
"此操作将永久删除, 是否继续?"
,
"warning"
);
}
else
if
(
type
==
'locateDataCatalog'
)
{
dataCatalogStore
.
setLocateSubjectName
(
row
.
name
);
// dataCatalogStore.setLocateSubjectName(row.name);
// router.push({
// name: 'dataWarehouse'
// });
if
(
row
.
dataSource
==
'4'
)
{
router
.
push
({
name
:
'dataWarehouse'
name
:
'classifyGradeCatalogue'
,
query
:
{
databaseGuid
:
row
.
dataSourceGuid
,
tableGuid
:
row
.
subjectGuid
}
});
}
else
{
router
.
push
({
name
:
'metadataQuery'
,
query
:
{
dataSourceGuid
:
row
.
dataSourceGuid
,
tableGuid
:
row
.
subjectGuid
}
});
}
}
};
...
...
src/views/data_quality/ruleForm.vue
View file @
73c4203
...
...
@@ -178,7 +178,24 @@ onBeforeMount(() => {
formItems
.
value
[
0
].
children
=
panelList
.
value
;
}
if
(
props
.
smallCategoryList
?.
length
)
{
let
p
=
formItems
.
value
[
0
].
default
;
if
(
p
)
{
if
(
p
.
default
==
'1'
)
{
//规范性
panelList
.
value
[
2
].
options
=
props
.
smallCategoryList
.
slice
(
0
,
6
);
}
else
if
(
p
.
default
==
'2'
)
{
panelList
.
value
[
2
].
options
=
props
.
smallCategoryList
.
slice
(
6
,
8
);
}
else
if
(
p
.
default
==
'3'
)
{
panelList
.
value
[
2
].
options
=
props
.
smallCategoryList
.
slice
(
8
,
13
);
}
else
if
(
p
.
default
==
'4'
)
{
panelList
.
value
[
2
].
options
=
props
.
smallCategoryList
.
slice
(
13
,
15
);
}
else
if
(
p
.
default
==
'5'
)
{
panelList
.
value
[
2
].
options
=
props
.
smallCategoryList
.
slice
(
15
,
18
);
}
else
if
(
p
.
default
==
'6'
)
{
panelList
.
value
[
2
].
options
=
props
.
smallCategoryList
.
slice
(
18
,
20
);
}
}
else
{
panelList
.
value
[
2
].
options
=
props
.
smallCategoryList
.
slice
(
0
,
6
);
}
panelList
.
value
[
2
].
default
=
getDefaultSmallCategory
(
formItems
.
value
[
0
].
default
);
formItems
.
value
[
0
].
children
=
panelList
.
value
;
}
...
...
@@ -796,12 +813,11 @@ const formBtnClick = (btn) => {
if
(
field
.
dataRange
)
{
f
.
dataRange
=
field
.
dataRange
;
}
f
.
startValue
=
field
.
startValue
;
f
.
endValue
=
field
.
endValue
;
if
(
field
.
startValue
)
{
if
(
f
.
dataType
==
'date'
||
f
.
dataType
==
'datetime'
)
{
f
.
dateValueRange
=
[
field
.
startValue
,
field
.
endValue
];
}
else
{
f
.
startValue
=
field
.
startValue
;
f
.
endValue
=
field
.
endValue
;
}
}
}
...
...
@@ -1204,12 +1220,11 @@ const listItemClick = (data) => {
if
(
field
.
dataRange
)
{
f
.
dataRange
=
field
.
dataRange
;
}
f
.
startValue
=
field
.
startValue
;
f
.
endValue
=
field
.
endValue
;
if
(
field
.
startValue
)
{
if
(
f
.
dataType
==
'date'
||
f
.
dataType
==
'datetime'
)
{
f
.
dateValueRange
=
[
field
.
startValue
,
field
.
endValue
];
}
else
{
f
.
startValue
=
field
.
startValue
;
f
.
endValue
=
field
.
endValue
;
}
}
}
...
...
@@ -1785,7 +1800,7 @@ const submitValueRange = () => {
// ElMessage.error(`表【${table}】的字段【${field.enName}】设置了值域,但范围未填写完整`);
// return;
// }
if
(
field
.
startValue
!=
null
||
field
.
endValue
!=
null
)
{
if
(
field
.
startValue
||
field
.
endValue
)
{
ruleFields
.
push
(
field
);
}
else
if
(
field
.
dataRange
)
{
ruleFields
.
push
(
field
);
...
...
@@ -1957,15 +1972,8 @@ 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
)
{
if
(
!
field
.
value1
&&
!
field
.
value
)
{
if
(
dialogSelectSubjectTable
.
value
.
enName
!=
table
)
{
normCheckFormListRef
.
value
.
setSelectList
(
table
,
'enName'
);
}
...
...
@@ -1979,8 +1987,15 @@ 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
;
}
}
...
...
@@ -2016,6 +2031,18 @@ const submitNormCheck = () => {
normCheckDialogVisible
.
value
=
false
;
}
/** 规范检验 长度和精度的数入 */
const
validatePositiveInteger
=
(
row
:
any
,
field
:
string
)
=>
{
row
[
field
]
=
row
[
field
].
replace
(
/
\D
/g
,
''
);
let
value
=
row
[
field
];
// 如果输入值为0,则将其设置为1
if
(
value
==
'0'
)
{
row
[
field
]
=
'1'
;
return
;
}
};
const
getFormInfo
=
()
=>
{
let
formInline
=
ruleFormRef
.
value
.
formInline
;
let
ruleName
=
props
.
ruleTypeList
.
find
(
option
=>
option
.
ruleCode
==
formInline
.
ruleCode
).
ruleName
;
...
...
@@ -2355,7 +2382,7 @@ defineExpose({
<
span
v
-
else
>
{{
scope
.
row
.
checkRuleName
??
'--'
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"填写配置项"
width
=
"2
0
0px"
align
=
"left"
>
<
el
-
table
-
column
label
=
"填写配置项"
width
=
"2
4
0px"
align
=
"left"
>
<
template
#
default
=
"scope"
>
<
span
v
-
if
=
"props.readonly"
>
{{
scope
.
row
.
configValue
??
'--'
}}
<
/span
>
<
span
...
...
@@ -2364,7 +2391,7 @@ defineExpose({
<
el
-
input
v
-
show
=
"scope.row.checkRule == 'custom_regular_rule'"
v
-
model
.
trim
=
"scope.row.configValue"
clearable
placeholder
=
"请输入"
>
<
/el-input
>
<
el
-
input
v
-
show
=
"scope.row.checkRule == 'precision_rule'"
v
-
model
.
trim
=
"scope.row.configValue"
clearable
placeholder
=
"请输入"
@
input
=
"(val) => scope.row.configValue = val.replace(/\D/g, '
')"
>
clearable
:
maxlength
=
"4"
placeholder
=
"请输入"
@
input
=
"validatePositiveInteger(scope.row, 'configValue
')"
>
<
/el-input
>
<
el
-
select
v
-
show
=
"scope.row.checkRule == 'date_format_rule'"
v
-
model
=
"scope.row.configValue"
placeholder
=
"请选择"
filterable
clearable
>
...
...
@@ -2375,17 +2402,22 @@ 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
[{
value
:
'='
}
,
{
value
:
'>'
}
,
{
value
:
'<'
}
,
{
value
:
'>='
}
,
{
value
:
'<='
}
,
{
value
:
'between'
,
label
:
'介于'
}
]
"
:key="
opt
[
'value'
]
" :label="
opt
[
'label'
]
" :value="
opt
[
'value'
]
" />
<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-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)'
}
"
@input="
(
val
)
=>
scope
.
row
.
value
=
val
.
replace
(
/
\D
/g
,
'
'
)
">
:maxlength="
4
" @input="
validatePositiveInteger
(
scope
.
row
,
'value
'
)
">
</el-input>
<el-input v-show="
scope
.
row
.
operator
==
'between'
" :disabled="
props
.
readonly
"
v-model.trim="
scope
.
row
.
value1
" placeholder="
请输入
" clearable :style="
{
width
:
'calc(33% - 2px)'
}
"
@input="
(
val
)
=>
scope
.
row
.
value1
=
val
.
replace
(
/
\D
/g
,
'
'
)
">
:maxlength="
4
" @input="
validatePositiveInteger
(
scope
.
row
,
'value1
'
)
">
</el-input>
</div>
</template>
...
...
@@ -2421,8 +2453,9 @@ defineExpose({
<
el
-
table
-
column
prop
=
"contrastSubjectGuid"
label
=
"选择对比表"
width
=
"200px"
align
=
"left"
show
-
overflow
-
tooltip
>
<
template
#
default
=
"scope"
>
<
el
-
tree
-
select
v
-
if
=
"!props.readonly"
ref
=
"treeSelectRef"
filterable
clearable
v
-
model
=
"scope.row['contrastSubjectGuid']"
node
-
key
=
"guid"
:
data
=
"contrastSubjects"
placeholder
=
"请选择"
:
default
-
expanded
-
keys
=
"defaultExpandedKeys"
:
auto
-
expand
-
parent
=
"true"
:
default
-
checked
-
keys
=
"[props.value.contrastSubjectGuid]"
v
-
model
=
"scope.row['contrastSubjectGuid']"
node
-
key
=
"guid"
:
data
=
"contrastSubjects"
placeholder
=
"请选择"
:
default
-
expanded
-
keys
=
"defaultExpandedKeys"
:
auto
-
expand
-
parent
=
"true"
:
default
-
checked
-
keys
=
"[props.value.contrastSubjectGuid]"
:
filter
-
node
-
method
=
"contrastSubjectInputFilterMethod"
:
props
=
"
{
value
:
'guid'
,
label
:
'name'
,
...
...
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