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
4e06bf62
authored
2024-12-06 09:50:32 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交规范校验规则
1 parent
79dca67c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
324 additions
and
68 deletions
src/layouts/index.vue
src/views/data_quality/ruleForm.vue
src/views/data_quality/ruleModel.vue
src/views/data_quality/ruleModelEdit.vue
src/views/data_quality/ruleTemplate.vue
src/layouts/index.vue
View file @
4e06bf6
...
...
@@ -288,8 +288,8 @@ const getMsgCnt = () => {
}
onMounted
(()
=>
{
getMsgCnt
();
createServerConnect
();
//
getMsgCnt();
//
createServerConnect();
});
</
script
>
...
...
src/views/data_quality/ruleForm.vue
View file @
4e06bf6
...
...
@@ -129,6 +129,27 @@ watch(() => props.largeCategoryList, (val) => {
/** 规范性检验规则 */
const
checkRulesList
:
any
=
ref
([]);
/** 根据不同的数据类型显示对应的规则 */
const
rulesListByType
:
any
=
computed
(()
=>
{
if
(
!
checkRulesList
.
value
.
length
)
{
return
{};
}
return
{
char
:
checkRulesList
.
value
.
filter
(
r
=>
r
.
paramValue
==
'length_rule'
||
r
.
paramValue
==
'ch_rule'
||
r
.
paramValue
==
'en_rule'
||
r
.
paramValue
==
'num_value_rule'
||
r
.
paramValue
==
'custom_regular_rule'
),
varchar
:
checkRulesList
.
value
.
filter
(
r
=>
r
.
paramValue
==
'length_rule'
||
r
.
paramValue
==
'id_card_rule'
||
r
.
paramValue
==
'phone_number_rule'
||
r
.
paramValue
==
'ch_rule'
||
r
.
paramValue
==
'en_rule'
||
r
.
paramValue
==
'num_value_rule'
||
r
.
paramValue
==
'custom_regular_rule'
),
int
:
checkRulesList
.
value
.
filter
(
r
=>
r
.
paramValue
==
'length_rule'
||
r
.
paramValue
==
'num_value_rule'
||
r
.
paramValue
==
'custom_regular_rule'
),
date
:
checkRulesList
.
value
.
filter
(
r
=>
r
.
paramValue
==
'date_format_rule'
||
r
.
paramValue
==
'custom_regular_rule'
),
datetime
:
checkRulesList
.
value
.
filter
(
r
=>
r
.
paramValue
==
'date_format_rule'
||
r
.
paramValue
==
'custom_regular_rule'
),
timestamp
:
checkRulesList
.
value
.
filter
(
r
=>
r
.
paramValue
==
'custom_regular_rule'
||
r
.
paramValue
==
'custom_regular_rule'
),
// text: checkRulesList.value.filter(r => r.paramValue == ''),
decimal
:
checkRulesList
.
value
.
filter
(
r
=>
r
.
paramValue
==
'length_rule'
||
r
.
paramValue
==
'precision_rule'
||
r
.
paramValue
==
'num_value_rule'
||
r
.
paramValue
==
'custom_regular_rule'
),
// json: checkRulesList.value.filter(r => r.paramValue == ''),
tinyint
:
checkRulesList
.
value
.
filter
(
r
=>
r
.
paramValue
==
'length_rule'
||
r
.
paramValue
==
'num_value_rule'
||
r
.
paramValue
==
'custom_regular_rule'
),
time
:
checkRulesList
.
value
.
filter
(
r
=>
r
.
paramValue
==
'custom_regular_rule'
),
bit
:
checkRulesList
.
value
.
filter
(
r
=>
r
.
paramValue
==
'ch_rule'
||
r
.
paramValue
==
'en_rule'
||
r
.
paramValue
==
'custom_regular_rule'
),
}
});
onBeforeMount
(()
=>
{
if
(
props
.
ruleTypeList
?.
length
)
{
if
(
props
.
ruleTypeValue
)
{
...
...
@@ -166,6 +187,7 @@ onBeforeMount(() => {
getCheckRulesList
().
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
checkRulesList
.
value
=
res
.
data
||
[];
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
...
...
@@ -766,7 +788,7 @@ const formBtnClick = (btn) => {
normCheckDialogVisible
.
value
=
true
;
tableListInfo
.
value
.
data
=
props
.
toSubjectTables
;
dialogSelectSubjectTable
.
value
=
props
.
toSubjectTables
[
0
];
let
defaultValue
=
panelList
.
value
[
1
2
].
defaultValue
;
let
defaultValue
=
panelList
.
value
[
1
4
].
defaultValue
;
normCheckTableListData
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
[];
if
(
props
.
toSubjectTables
[
0
]?.
guid
)
{
normCheckTableListLoading
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
true
;
...
...
@@ -781,7 +803,14 @@ const formBtnClick = (btn) => {
let
fIndex
=
data
.
findIndex
(
d
=>
d
.
enName
==
field
.
enName
);
if
(
fIndex
>
-
1
)
{
let
f
=
normCheckTableListData
.
value
[
dialogSelectSubjectTable
.
value
.
enName
][
fIndex
];
Object
.
assign
(
f
,
field
);
f
.
checkRule
=
field
.
checkRule
;
f
.
configValue
=
field
.
configValue
;
if
(
f
.
checkRule
==
'length_rule'
)
{
let
vSplit
=
f
.
configValue
.
split
(
'#'
);
f
.
operator
=
vSplit
[
0
];
f
.
value
=
vSplit
[
1
];
f
.
value1
=
vSplit
[
2
];
}
}
});
}
...
...
@@ -938,6 +967,22 @@ const setPanelListValue = (item, isSelectChange = false, init = false, radioGrou
p
.
default
=
''
;
p
.
defaultValue
=
{};
}
}
else
if
(
ruleCode
==
'norm_check'
&&
p
.
field
==
'ruleSettings-norm-check'
)
{
if
(
!
init
)
{
p
.
default
=
val
[
field
];
return
;
}
if
(
val
.
ruleField
?.
length
)
{
p
.
default
=
val
.
ruleField
?.
map
(
f
=>
f
.
enName
)?.
join
(
';'
);
let
ruleFields
=
{};
ruleFields
[
val
.
subjectName
]
=
val
.
ruleField
||
[];
p
.
defaultValue
=
{
ruleFields
:
ruleFields
}
}
else
{
p
.
default
=
''
;
p
.
defaultValue
=
{};
}
}
else
if
(
p
.
field
==
'largeCategory'
)
{
/** 此处有歧义,若是切换规则类型,修改默认值,可能会出现,用户先修改了规则大类,但是切换类型之后,被我还原了。 */
if
(
radioGroupChange
&&
!
init
)
{
...
...
@@ -1127,6 +1172,42 @@ const listItemClick = (data) => {
ElMessage
.
error
(
res
.
msg
);
}
})
}
else
if
(
ruleType
.
value
==
'norm_check'
)
{
if
(
normCheckTableListData
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]?.
length
)
{
return
;
}
let
defaultValue
=
panelList
.
value
[
14
].
defaultValue
;
normCheckTableListLoading
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
true
;
getSubjectFields
(
data
.
guid
).
then
((
res
:
any
)
=>
{
normCheckTableListLoading
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
let
data
=
res
.
data
||
[];
normCheckTableListData
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
data
;
let
valueFields
=
defaultValue
.
ruleFields
?.[
dialogSelectSubjectTable
.
value
.
enName
]
||
[];
if
(
valueFields
.
length
)
{
valueFields
.
forEach
(
field
=>
{
let
fIndex
=
data
.
findIndex
(
d
=>
d
.
enName
==
field
.
enName
);
if
(
fIndex
>
-
1
)
{
let
f
=
normCheckTableListData
.
value
[
dialogSelectSubjectTable
.
value
.
enName
][
fIndex
];
if
(
field
.
checkRule
)
{
f
.
checkRule
=
field
.
dataRange
;
f
.
configValue
=
field
.
configValue
;
if
(
field
.
checkRule
==
'length_rule'
)
{
let
vLen
=
f
.
configValue
?.
split
(
'#'
);
if
(
vLen
?.
length
>
1
)
{
f
.
operator
=
vLen
[
0
];
f
.
value
=
vLen
[
1
];
f
.
value1
=
vLen
[
2
]
}
}
}
}
});
}
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
})
}
}
...
...
@@ -1634,6 +1715,8 @@ const valueRangeTableListLoading = ref({});
const
valueRangeTableListData
=
ref
({});
const
valueCheckFormListRef
=
ref
();
const
cancelValueRangeDialog
=
()
=>
{
valueRangeDialogVisible
.
value
=
false
;
}
...
...
@@ -1649,26 +1732,27 @@ const submitValueRange = () => {
let
ruleFields
:
any
=
[]
for
(
const
field
of
valueTableFields
)
{
if
(
field
.
startValue
!=
null
&&
field
.
endValue
==
null
||
(
field
.
endValue
!=
null
&&
field
.
startValue
==
null
))
{
if
(
dialogSelectSubjectTable
.
value
.
enName
!=
table
)
{
valueCheckFormListRef
.
value
.
setSelectList
(
table
,
'enName'
);
}
ElMessage
.
error
(
`表【
${
table
}
】的字段【
${
field
.
enName
}
】设置了值域,但范围未填写完整`
);
return
;
}
if
(
field
.
startValue
)
{
ruleFields
.
push
(
field
);
}
if
(
field
.
dataRange
)
{
}
else
if
(
field
.
dataRange
)
{
ruleFields
.
push
(
field
);
}
if
(
field
.
dateValueRange
?.
length
>
0
)
{
}
else
if
(
field
.
dateValueRange
?.
length
>
0
)
{
field
.
startValue
=
field
.
dateValueRange
[
0
];
field
.
endValue
=
field
.
dateValueRange
[
1
];
ruleFields
.
push
(
field
);
}
}
if
(
ruleFields
.
length
)
{
v
.
push
(
table
);
ruleFieldsJson
[
table
]
=
ruleFields
;
}
}
}
if
(
!
v
.
length
)
{
ElMessage
.
error
(
'当前未给表字段设置值域!'
);
return
;
...
...
@@ -1792,12 +1876,97 @@ const normCheckTableListLoading = ref({});
const
normCheckTableListData
=
ref
({});
const
normCheckFormListRef
=
ref
();
const
cancelNormCheckDialog
=
()
=>
{
normCheckDialogVisible
.
value
=
false
;
}
const
submitNormCheck
=
()
=>
{
let
v
:
any
=
[];
let
ruleFieldsJson
:
any
=
{};
for
(
const
table
in
normCheckTableListData
.
value
)
{
if
(
!
normCheckTableListData
.
value
[
table
]?.
length
)
{
continue
;
}
let
valueTableFields
=
normCheckTableListData
.
value
[
table
];
let
ruleFields
:
any
=
[]
for
(
const
field
of
valueTableFields
)
{
if
(
!
field
.
checkRule
)
{
continue
;
}
if
((
field
.
checkRule
==
'custom_regular_rule'
||
field
.
checkRule
==
'precision_rule'
||
field
.
checkRule
==
'date_format_rule'
)
&&
field
.
configValue
==
null
)
{
if
(
dialogSelectSubjectTable
.
value
.
enName
!=
table
)
{
normCheckFormListRef
.
value
.
setSelectList
(
table
,
'enName'
);
}
ElMessage
.
error
(
`表【
${
table
}
】的字段【
${
field
.
enName
}
】设置了校验规则,但未填写配置项`
);
return
;
}
if
(
field
.
checkRule
==
'length_rule'
)
{
if
(
!
field
.
operator
)
{
if
(
dialogSelectSubjectTable
.
value
.
enName
!=
table
)
{
normCheckFormListRef
.
value
.
setSelectList
(
table
,
'enName'
);
}
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
(
dialogSelectSubjectTable
.
value
.
enName
!=
table
)
{
normCheckFormListRef
.
value
.
setSelectList
(
table
,
'enName'
);
}
ElMessage
.
error
(
`表【
${
table
}
】的字段【
${
field
.
enName
}
】设置了长度检验,但长度值未填写完整`
);
return
;
}
if
(
parseInt
(
field
.
value
)
>=
parseInt
(
field
.
value1
))
{
if
(
dialogSelectSubjectTable
.
value
.
enName
!=
table
)
{
normCheckFormListRef
.
value
.
setSelectList
(
table
,
'enName'
);
}
ElMessage
.
error
(
`表【
${
table
}
】的字段【
${
field
.
enName
}
】设置了长度检验,介于操作符对应的数值需符合后者大于前者`
);
return
;
}
field
.
configValue
=
field
.
operator
+
'#'
+
field
.
value
+
'#'
+
field
.
value1
;
}
else
{
field
.
configValue
=
field
.
operator
+
'#'
+
field
.
value
;
}
}
ruleFields
.
push
(
field
);
}
if
(
ruleFields
.
length
)
{
v
.
push
(
table
);
ruleFieldsJson
[
table
]
=
ruleFields
;
}
}
if
(
!
v
.
length
)
{
ElMessage
.
error
(
'当前未给表字段设置规范检验规则!'
);
return
;
}
let
index
=
14
;
panelList
.
value
[
index
].
defaultValue
=
{
ruleFields
:
ruleFieldsJson
};
let
str
=
""
;
for
(
const
key
in
ruleFieldsJson
)
{
let
field
=
ruleFieldsJson
[
key
];
str
=
str
+
(
str
?
';'
:
''
)
+
field
.
map
(
f
=>
f
.
enName
).
join
(
','
);;
}
let
formInline
=
oldOriginValue
.
value
=
Object
.
assign
({
qualityModelGuids
:
props
.
toSubjectTables
.
map
(
s
=>
s
.
guid
),
parity
:
1
,
compareWay
:
1
,
jointly
:
'N'
,
bizState
:
'Y'
},
oldOriginValue
.
value
,
ruleFormRef
.
value
.
formInline
);
formInline
[
`
${
panelList
.
value
[
index
].
field
}
`
]
=
str
;
setPanelListValue
(
formInline
);
normCheckDialogVisible
.
value
=
false
;
}
const
getFormInfo
=
()
=>
{
...
...
@@ -1836,8 +2005,7 @@ const getFormInfo = () => {
}
else
if
(
formInline
.
ruleCode
==
'value_of_range'
)
{
let
v
=
panelList
.
value
[
12
].
defaultValue
;
return
Object
.
assign
({},
formInline
,
v
,
{
ruleName
:
ruleName
,
ruleFields
:
v
ruleName
:
ruleName
});
}
else
if
(
formInline
.
ruleCode
==
'ref_integrality'
)
{
let
v
=
panelList
.
value
[
13
].
defaultValue
;
...
...
@@ -1845,6 +2013,11 @@ const getFormInfo = () => {
ruleName
:
ruleName
,
ruleFields
:
v
});
}
else
if
(
formInline
.
ruleCode
==
'norm_check'
)
{
let
v
=
panelList
.
value
[
14
].
defaultValue
;
return
Object
.
assign
({},
formInline
,
v
,
{
ruleName
:
ruleName
});
}
}
...
...
@@ -1984,8 +2157,9 @@ defineExpose({
</div>
<div
class=
"table-field-right"
>
<div
class=
"left-title"
>
字段列表详情
</div>
<el-table
ref=
"rowTableRef"
:data=
"valueRangeTableListData[dialogSelectSubjectTable.enName]"
height=
"100%"
:highlight-current-row=
"true"
stripe
v-loading=
"valueRangeTableListLoading[dialogSelectSubjectTable.enName]"
tooltip-effect=
"light"
border
<el-table
ref=
"rowTableRef"
:data=
"valueRangeTableListData[dialogSelectSubjectTable.enName]"
height=
"100%"
:highlight-current-row=
"true"
stripe
v-loading=
"valueRangeTableListLoading[dialogSelectSubjectTable.enName]"
tooltip-effect=
"light"
border
:style=
"{ height: 'calc(100% - 32px)', width: '100%', display: 'inline-block' }"
>
<el-table-column
prop=
"enName"
label=
"字段名"
width=
"140px"
align=
"left"
show-overflow-tooltip
>
</el-table-column>
...
...
@@ -1998,26 +2172,24 @@ defineExpose({
</el-table-column>
<el-table-column
label=
"值域"
width=
"280px"
align=
"left"
fixed=
"right"
>
<
template
#
default=
"scope"
>
<span
v-if=
"scope.row.dataType == 'json' || scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string'"
>
--
</span>
<span
v-if=
"scope.row.dataType == 'json' || scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string'"
>
--
</span>
<template
v-else
>
<el-input
v-show=
"scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit'"
v-model
.
trim=
"scope.row.dataRange"
clearable
placeholder=
"多值按照分号;分隔"
>
</el-input>
<el-input
v-show=
"scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit'"
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"
/>
<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 == '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>
<div
class=
"range-sum"
v-show=
"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>
<el-input
:disabled=
"props.readonly"
v-model
.
trim=
"scope.row.endValue"
placeholder=
"请输入"
clearable
>
</el-input>
</div>
</
template
>
</template>
...
...
@@ -2035,15 +2207,16 @@ defineExpose({
</el-dialog>
<!-- 引用完整性 -->
<el-dialog
v-model=
"tableRefIntegralityDialogVisible"
title=
"规则设置"
width=
"750"
:modal=
"true"
:close-on-click-modal=
"false"
destroy-on-close
align-center
>
<el-dialog
v-model=
"tableRefIntegralityDialogVisible"
title=
"规则设置"
width=
"750"
:modal=
"true"
:close-on-click-modal=
"false"
destroy-on-close
align-center
>
<div
class=
"row-dialog-content"
>
<el-table
ref=
"rowTableRef"
:data=
"tableRefIntegralityRulesData"
height=
"100%"
:highlight-current-row=
"true"
stripe
v-loading=
"tableRefIntegralityRulesDataLoading"
tooltip-effect=
"light"
border
<el-table
ref=
"rowTableRef"
:data=
"tableRefIntegralityRulesData"
height=
"100%"
:highlight-current-row=
"true"
stripe
v-loading=
"tableRefIntegralityRulesDataLoading"
tooltip-effect=
"light"
border
:style=
"{ height: 'calc(100% - 28px)', width: 'auto', 'max-width': '100%', display: 'inline-block' }"
>
<el-table-column
prop=
"mainTable"
label=
"选择主表"
width=
"180px"
align=
"left"
show-overflow-tooltip
>
<
template
#
default=
"scope"
>
<el-select
v-if=
"!props.readonly"
v-model=
"scope.row['mainTable']"
placeholder=
"请选择"
@
change=
"tableInteMainSelectChange"
>
<el-select
v-if=
"!props.readonly"
v-model=
"scope.row['mainTable']"
placeholder=
"请选择"
@
change=
"tableInteMainSelectChange"
>
<el-option
v-for=
"opt in toSubjectTables"
:key=
"opt['guid']"
:label=
"opt['label']"
:value=
"opt['guid']"
/>
</el-select>
<span
v-else
>
{{
scope
.
row
[
'mainTableName'
]
+
`(${scope.row['mainTableZhName']
}
)`
}}
<
/span
>
...
...
@@ -2051,17 +2224,20 @@ defineExpose({
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"mainTableField"
label
=
"选择主表字段"
width
=
"180px"
align
=
"left"
show
-
overflow
-
tooltip
>
<
template
#
default
=
"scope"
>
<
el
-
select
v
-
if
=
"!props.readonly"
v
-
model
=
"scope.row['mainTableField']"
placeholder
=
"请选择"
filterable
clearable
>
<
el
-
option
v
-
for
=
"opt in (scope.row.mainTable ? mainTableFields[scope.row.mainTable] : [])"
:
key
=
"opt['enName']"
:
label
=
"opt['label']"
:
value
=
"opt['enName']"
/>
<
el
-
select
v
-
if
=
"!props.readonly"
v
-
model
=
"scope.row['mainTableField']"
placeholder
=
"请选择"
filterable
clearable
>
<
el
-
option
v
-
for
=
"opt in (scope.row.mainTable ? mainTableFields[scope.row.mainTable] : [])"
:
key
=
"opt['enName']"
:
label
=
"opt['label']"
:
value
=
"opt['enName']"
/>
<
/el-select
>
<
span
v
-
else
>
{{
scope
.
row
[
'mainTableField'
]
+
`(${scope.row['mainTableFieldZhName']
}
)`
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"compareTableGuid"
label
=
"选择对比表"
width
=
"180px"
align
=
"left"
show
-
overflow
-
tooltip
>
<
template
#
default
=
"scope"
>
<
el
-
tree
-
select
v
-
if
=
"!props.readonly"
ref
=
"compareTreeSelectRef"
filterable
clearable
@
change
=
"tableInteCompareSelectChange"
v
-
model
=
"scope.row['compareTableGuid']"
node
-
key
=
"guid"
:
data
=
"contrastSubjects"
placeholder
=
"请选择"
lazy
:
load
=
"(node, resolve) => treeSelectLoad(node, resolve)"
:
default
-
expanded
-
keys
=
"contrastSubjects?.length ? [contrastSubjects.find(c => c.children?.some(cc => cc.guid == scope.row['compareSubjectDomainGuid'])).guid, scope.row.compareSubjectDomainGuid] : []"
<
el
-
tree
-
select
v
-
if
=
"!props.readonly"
ref
=
"compareTreeSelectRef"
filterable
clearable
@
change
=
"tableInteCompareSelectChange"
v
-
model
=
"scope.row['compareTableGuid']"
node
-
key
=
"guid"
:
data
=
"contrastSubjects"
placeholder
=
"请选择"
lazy
:
load
=
"(node, resolve) => treeSelectLoad(node, resolve)"
:
default
-
expanded
-
keys
=
"contrastSubjects?.length ? [contrastSubjects.find(c => c.children?.some(cc => cc.guid == scope.row['compareSubjectDomainGuid'])).guid, scope.row.compareSubjectDomainGuid] : []"
:
auto
-
expand
-
parent
=
"true"
:
default
-
checked
-
keys
=
"[scope.row['compareTableGuid']]"
:
filter
-
node
-
method
=
"contrastSubjectInputFilterMethod"
:
props
=
"
{
value
:
'guid'
,
...
...
@@ -2075,8 +2251,11 @@ defineExpose({
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"compareEnName"
label
=
"选择对比字段"
width
=
"180px"
align
=
"left"
show
-
overflow
-
tooltip
>
<
template
#
default
=
"scope"
>
<
el
-
select
v
-
if
=
"!props.readonly"
v
-
model
=
"scope.row['compareEnName']"
placeholder
=
"请选择"
filterable
clearable
>
<
el
-
option
v
-
for
=
"opt in (scope.row.compareTableGuid ? compareTableFields[scope.row.compareTableGuid] : [])"
:
key
=
"opt['enName']"
:
label
=
"opt['label']"
:
value
=
"opt['enName']"
/>
<
el
-
select
v
-
if
=
"!props.readonly"
v
-
model
=
"scope.row['compareEnName']"
placeholder
=
"请选择"
filterable
clearable
>
<
el
-
option
v
-
for
=
"opt in (scope.row.compareTableGuid ? compareTableFields[scope.row.compareTableGuid] : [])"
:
key
=
"opt['enName']"
:
label
=
"opt['label']"
:
value
=
"opt['enName']"
/>
<
/el-select
>
<
span
v
-
else
>
{{
scope
.
row
[
'compareEnName'
]
+
`(${scope.row['compareZhName']
}
)`
}}
<
/span
>
<
/template
>
...
...
@@ -2088,8 +2267,7 @@ defineExpose({
<
/el-table-column
>
<
/el-table
>
<
div
class
=
"row-add-btn"
v
-
if
=
"!props.readonly"
>
<
el
-
button
link
@
click
=
"addIntegralityRules"
:
icon
=
"CirclePlus"
v
-
preReClick
>
添加规则
<
/el-button
>
<
el
-
button
link
@
click
=
"addIntegralityRules"
:
icon
=
"CirclePlus"
v
-
preReClick
>
添加规则
<
/el-button
>
<
/div
>
<
/div
>
...
...
@@ -2111,10 +2289,11 @@ defineExpose({
</div>
<div class="
table
-
field
-
right
">
<div class="
left
-
title
">字段列表详情</div>
<el-table ref="
rowTableRef
" :data="
normCheckTableListData
[
dialogSelectSubjectTable
.
enName
]
" height="
100
%
" :highlight-current-row="
true
" stripe
v-loading="
normCheckTableListLoading
[
dialogSelectSubjectTable
.
enName
]
" tooltip-effect="
light
" border
<el-table ref="
rowTableRef
" :data="
normCheckTableListData
[
dialogSelectSubjectTable
.
enName
]
" height="
100
%
"
:highlight-current-row="
true
" stripe v-loading="
normCheckTableListLoading
[
dialogSelectSubjectTable
.
enName
]
"
tooltip-effect="
light
" border
:style="
{
height
:
'calc(100% - 32px)'
,
width
:
'100%'
,
display
:
'inline-block'
}
">
<el-table-column prop="
enName
" label="
字段名
" width="
140
px
" align="
left
" show-overflow-tooltip
>
<el-table-column prop="
enName
" label="
字段名
" width="
140
px
" align="
left
" show-overflow-tooltip fixed
>
</el-table-column>
<el-table-column prop="
chName
" label="
注释
" width="
120
px
" align="
left
" show-overflow-tooltip>
</el-table-column>
...
...
@@ -2125,34 +2304,46 @@ defineExpose({
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"checkRule"
label
=
"选择检验规则"
width
=
"150px"
align
=
"left"
show
-
overflow
-
tooltip
>
<
template
#
default
=
"scope"
>
<
el
-
select
v
-
if
=
"!props.readonly"
v
-
model
=
"scope.row['checkRule']"
placeholder
=
"请选择"
filterable
clearable
>
<
el
-
option
v
-
for
=
"opt in checkRulesList"
:
key
=
"opt['paramValue']"
:
label
=
"opt['paramName']"
:
value
=
"opt['paramValue']"
/>
<
el
-
select
v
-
if
=
"!props.readonly || (scope.row.dataType == 'text' || scope.row.dataType == 'json')"
v
-
model
=
"scope.row['checkRule']"
placeholder
=
"请选择"
filterable
clearable
>
<
el
-
option
v
-
for
=
"opt in rulesListByType[scope.row.dataType]"
:
key
=
"opt['paramValue']"
:
label
=
"opt['paramName']"
:
value
=
"opt['paramValue']"
/>
<
/el-select
>
<
span
v
-
else
>
{{
scope
.
row
.
checkRuleName
??
'--'
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"填写配置项"
width
=
"200px"
align
=
"left"
>
<
template
#
default
=
"scope"
>
<
span
v
-
if
=
"!scope.row.checkRule"
>--<
/span
>
<
span
v
-
if
=
"props.readonly"
>
{{
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
>
<
el
-
input
v
-
show
=
"scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit'"
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 == '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
>
<
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, '')"
>
<
/el-input
>
<
el
-
select
v
-
show
=
"scope.row.checkRule == 'date_format_rule'"
v
-
model
=
"scope.row.configValue"
placeholder
=
"请选择"
filterable
clearable
>
<
el
-
option
v
-
for
=
"
opt
in
scope
.
row
.
dataType
==
'date'
?
[{
value
:
'YYYY-MM-DD'
}
,
{
value
:
'YYYY/MM/DD'
}
]
:
[{
value
:
'YYYY-MM-DD HH:MM:SS'
}
,
{
value
:
'YYYY-MM-DD HH:MM:SS.SSS'
}
]
"
:value="
opt
[
'value'
]
" />
</el-select>
<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-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
,
''
)
">
</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
,
''
)
">
</el-input>
</div>
</template>
</template>
...
...
@@ -2288,6 +2479,7 @@ defineExpose({
width
:
100
%
;
display
:
inline
-
flex
;
align
-
items
:
center
;
justify
-
content
:
SPACE
-
BETWEEN
;
.
text
{
margin
:
0
px
4
px
;
...
...
src/views/data_quality/ruleModel.vue
View file @
4e06bf6
...
...
@@ -332,6 +332,33 @@ const transformRulesInfo = (info: any) => {
})]
}));
}
}
else
if
(
info
.
ruleCode
==
'norm_check'
)
{
let
subjectTables
=
toSubjectTables
.
value
;
for
(
const
ds
in
info
.
ruleFields
)
{
let
fields
=
info
.
ruleFields
[
ds
];
let
tableInfo
=
subjectTables
.
find
(
t
=>
t
.
enName
===
ds
);
modelRules
.
push
(
Object
.
assign
({},
{
modelGroupGuid
:
modelGroupGuid
.
value
,
name
:
tableInfo
.
chName
,
subjectName
:
tableInfo
.
enName
,
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
ruleField
:
fields
.
map
(
f
=>
{
return
{
guid
:
f
.
guid
,
enName
:
f
.
enName
,
chName
:
f
.
chName
,
dataType
:
f
.
dataType
,
checkRule
:
f
.
checkRule
,
configValue
:
f
.
configValue
}
}),
ruleFields
:
''
})]
}));
}
}
else
if
(
info
.
ruleCode
==
'ref_integrality'
)
{
let
subjectTables
=
toSubjectTables
.
value
;
info
.
ruleFields
.
forEach
(
row
=>
{
...
...
src/views/data_quality/ruleModelEdit.vue
View file @
4e06bf6
...
...
@@ -140,6 +140,25 @@ const transformRulesInfo = (info: any) => {
}),
ruleFields
:
''
});
}
else
if
(
info
.
ruleCode
==
'norm_check'
)
{
let
subjectName
=
detailInfo
.
value
.
subjectName
;
let
fields
=
info
.
ruleFields
[
subjectName
];
return
Object
.
assign
({},
info
,
{
guid
:
ruleGuid
,
qualityModelGuid
:
detailInfo
.
value
.
qualityModelGuid
,
ruleCode
:
detailInfo
.
value
.
ruleCode
,
ruleField
:
fields
.
map
(
f
=>
{
return
{
guid
:
f
.
guid
,
enName
:
f
.
enName
,
chName
:
f
.
chName
,
dataType
:
f
.
dataType
,
checkRule
:
f
.
checkRule
,
configValue
:
f
.
configValue
}
}),
ruleFields
:
''
});
}
else
if
(
info
.
ruleCode
==
'ref_integrality'
)
{
return
Object
.
assign
({},
info
,
{
guid
:
ruleGuid
,
...
...
src/views/data_quality/ruleTemplate.vue
View file @
4e06bf6
...
...
@@ -135,6 +135,24 @@ const transformRulesInfo = (info) => {
}),
ruleFields
:
''
});
}
else
if
(
info
.
ruleCode
==
'norm_check'
)
{
let
subjectName
=
modelDetailInfo
.
value
.
subjectName
;
let
fields
=
info
.
ruleFields
[
subjectName
];
return
Object
.
assign
({},
info
,
{
qualityModelGuid
:
modelGuid
,
ruleCode
:
info
.
ruleCode
,
ruleField
:
fields
.
map
(
f
=>
{
return
{
guid
:
f
.
guid
,
enName
:
f
.
enName
,
chName
:
f
.
chName
,
dataType
:
f
.
dataType
,
checkRule
:
f
.
checkRule
,
configValue
:
f
.
configValue
}
}),
ruleFields
:
''
});
}
else
if
(
info
.
ruleCode
==
'ref_integrality'
)
{
return
Object
.
assign
({},
info
,
{
qualityModelGuid
:
modelGuid
,
...
...
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