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
c9e1f69b
authored
2025-01-08 00:52:57 +0800
by
xukangle
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'develop' of
http://117.78.60.236:8000/csbr-daop/fe-data-asset-management
into develop
2 parents
ec743969
b3bbb46f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
168 additions
and
68 deletions
src/api/modules/dataMetaService.ts
src/api/modules/dataQuality.ts
src/views/data_quality/qualityRules.vue
src/views/data_quality/ruleForm.vue
src/views/data_quality/ruleModel.vue
src/views/data_quality/ruleTemplate.vue
src/api/modules/dataMetaService.ts
View file @
c9e1f69
...
...
@@ -69,7 +69,7 @@ export const saveMetaReportAnalysis = (params) => request({
**/
// 树形数据
export
const
getMetaTreeData
=
(
params
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_PLAN_BASEURL
}
/meta-table/meta-tree-list`
,
url
:
`
${
import
.
meta
.
env
.
VITE_APP_PLAN_BASEURL
}
/meta-table/meta-tree-list
?isImportCreate=
${
params
.
isImportCreate
}
`
,
method
:
'post'
,
data
:
params
})
...
...
src/api/modules/dataQuality.ts
View file @
c9e1f69
...
...
@@ -81,6 +81,13 @@ export const getDatabase = (params) => request({
data
:
params
})
/** 获取盘点的数据库目录 */
export
const
getInventoryDsDir
=
()
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_CHECK_BASEURL
}
/db-dir/tree-list`
,
method
:
'post'
,
data
:
{}
})
/** 新建质检表,获取主题域分层的主题表树结构 */
export
const
getSubjectTableTree
=
(
params
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_PLAN_BASEURL
}
/data-catalog-directory/directory-tree-list`
,
...
...
@@ -95,10 +102,10 @@ export const getSubjectTableByDomain = (params) => request({
data
:
params
})
/** 获取主题表的字段列表 */
export
const
getSubjectFields
=
(
params
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_
PLAN_BASEURL
}
/data-catalog-subject/field/list?subjectGuid=
${
params
}
`
,
method
:
'
ge
t'
,
/** 获取主题表的字段列表
,目前应包括盘点目录和元数据目录的表及字段
*/
export
const
getSubjectFields
=
(
tableGuid
,
dataSource
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_
QUALITY_BASEURL
}
/quality-model/field/list-by-subject-guid?tableGuid=
${
tableGuid
}
&dataSource=
${
dataSource
}
`
,
method
:
'
pos
t'
,
})
/** 表的逻辑条件和sql检验。 */
...
...
src/views/data_quality/qualityRules.vue
View file @
c9e1f69
...
...
@@ -255,10 +255,12 @@ const groupTableInfo = ref({
label
:
"操作"
,
type
:
"btn"
,
width
:
92
,
btns
:
[
{
label
:
"编辑"
,
value
:
"edit"
},
{
label
:
"删除"
,
value
:
"delete"
},
],
btns
:
(
scope
)
=>
{
return
[
{
label
:
"编辑"
,
value
:
"edit"
,
disabled
:
scope
.
row
.
dataSource
!=
'5'
},
{
label
:
"删除"
,
value
:
"delete"
,
disabled
:
scope
.
row
.
dataSource
!=
'5'
},
]
},
}
});
...
...
@@ -402,7 +404,8 @@ const tableBtnClick = (scope, btn) => {
name
:
'ruleTemplate'
,
query
:
{
modelGuid
:
row
.
guid
,
name
:
row
.
name
name
:
row
.
name
,
dataSource
:
row
.
dataSource
}
});
}
else
if
(
type
==
"delete"
)
{
...
...
@@ -489,6 +492,7 @@ const groupTableBtnClick = (scope, btn) => {
type
:
"success"
,
message
:
"删除分组成功"
,
});
getQualityGroupTreeData
();
}
else
{
ElMessage
({
type
:
"error"
,
...
...
@@ -639,7 +643,8 @@ const clickCreateTable = () => {
name
:
'ruleModel'
,
query
:
{
groupGuid
:
page
.
value
.
modelGroupGuid
,
name
:
lastSelectNode
.
value
.
data
.
name
name
:
lastSelectNode
.
value
.
data
.
name
,
dataSource
:
lastSelectNode
.
value
.
data
.
dataSource
}
});
}
...
...
@@ -650,7 +655,8 @@ const clickCreateRule = () => {
name
:
'ruleTemplate'
,
query
:
{
modelGuid
:
lastSelectNode
.
value
.
data
.
guid
,
name
:
lastSelectNode
.
value
.
data
.
name
name
:
lastSelectNode
.
value
.
data
.
name
,
dataSource
:
lastSelectNode
.
value
.
parent
.
data
.
dataSource
}
});
}
...
...
@@ -744,6 +750,7 @@ let editSubmitPromise: any = ref(null);
/** 新建分组对话框确定。 */
const
dialogBtnClick
=
(
btn
,
info
)
=>
{
if
(
btn
.
value
==
'submit'
)
{
info
.
dataSource
=
'5'
;
if
(
dialogInfo
.
value
.
type
==
'add'
)
{
if
(
submitPromise
.
value
)
{
return
;
...
...
@@ -753,6 +760,7 @@ const dialogBtnClick = (btn, info) => {
if
(
res
.
code
==
proxy
.
$passCode
)
{
groupPage
.
value
.
curr
=
1
;
getGroupTableData
();
getQualityGroupTreeData
();
ElMessage
({
type
:
'success'
,
message
:
'新建分组成功'
...
...
@@ -779,6 +787,7 @@ const dialogBtnClick = (btn, info) => {
type
:
'success'
,
message
:
'编辑分组成功'
})
getQualityGroupTreeData
();
dialogInfo
.
value
.
visible
=
false
;
}
else
{
ElMessage
({
...
...
src/views/data_quality/ruleForm.vue
View file @
c9e1f69
...
...
@@ -6,8 +6,12 @@ import {
getSubjectFields
,
getSubjectTableTree
,
getSubjectTableByDomain
,
getCheckRulesList
getCheckRulesList
,
getInventoryDsDir
}
from
'@/api/modules/dataQuality'
;
import
{
getMetaTreeData
}
from
'@/api/modules/dataMetaService'
;
import
Table
from
"@/components/Table/index.vue"
;
import
Form
from
"@/components/Form/index.vue"
;
import
{
ElMessage
}
from
"element-plus"
;
...
...
@@ -48,7 +52,11 @@ const props = defineProps({
readonly
:
{
type
:
Boolean
,
default
:
false
}
},
dataSource
:
{
type
:
String
,
default
:
''
},
});
watch
(()
=>
props
.
toSubjectTables
,
(
val
:
any
[])
=>
{
...
...
@@ -615,12 +623,52 @@ const submit = () => {
}
const
getSubjectTableTreeData
=
()
=>
{
return
getSubjectTableTree
({}).
then
((
res
:
any
)
=>
{
if
(
props
.
dataSource
==
'4'
||
props
.
value
.
dataSource
==
'4'
)
{
return
getInventoryDsDir
().
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
contrastSubjects
.
value
=
res
.
data
?.
map
(
d
=>
{
d
.
parentGuid
=
0
;
d
.
guid
=
d
.
databaseGuid
;
d
.
name
=
d
.
databaseChName
;
d
.
label
=
d
.
databaseChName
+
`(
${
d
.
database
}
)`
;
d
.
children
=
d
.
children
?.
map
(
child
=>
{
child
.
parentGuid
=
d
.
guid
;
child
.
label
=
child
.
tableChName
+
`(
${
child
.
tableName
}
)`
;
child
.
guid
=
child
.
tableGuid
;
child
.
isLeaf
=
true
;
child
.
dataServerName
=
d
.
database
;
child
.
dataSourceGuid
=
d
.
databaseGuid
;
child
.
parentGuid
=
d
.
databaseGuid
;
return
child
;
})
return
d
;
})
||
[];
}
})
}
else
{
return
getMetaTreeData
({
isImportCreate
:
'N'
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
contrastSubjects
.
value
=
res
.
data
||
[];
return
res
.
data
||
[];
contrastSubjects
.
value
=
res
.
data
?.
children
?.
map
(
d
=>
{
d
.
parentGuid
=
0
;
d
.
label
=
d
.
name
;
d
.
children
=
d
.
children
?.
map
(
child
=>
{
child
.
label
=
child
.
name
+
`(
${
child
.
tableName
}
)`
;
child
.
isLeaf
=
true
;
child
.
dataServerName
=
d
.
name
;
child
.
dataSourceGuid
=
d
.
guid
;
return
child
;
})
return
d
;
})
||
[];
}
})
}
// return getSubjectTableTree({}).then((res: any) => {
// if (res.code == proxy.$passCode) {
// contrastSubjects.value = res.data || [];
// return res.data || [];
// }
// })
}
const
formBtnClick
=
(
btn
)
=>
{
...
...
@@ -633,7 +681,7 @@ const formBtnClick = (btn) => {
nullSelectFields
.
value
=
cloneDeep
(
panelList
.
value
[
index
].
defaultValue
);
if
(
props
.
toSubjectTables
[
0
]?.
guid
)
{
nullTableInfo
.
value
.
loading
=
true
;
getSubjectFields
(
props
.
toSubjectTables
[
0
]?.
guid
).
then
((
res
:
any
)
=>
{
getSubjectFields
(
props
.
toSubjectTables
[
0
]?.
guid
,
props
.
dataSource
||
props
.
value
.
dataSource
).
then
((
res
:
any
)
=>
{
nullTableInfo
.
value
.
loading
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
nullTableInfo
.
value
.
data
=
res
.
data
||
[];
...
...
@@ -673,7 +721,7 @@ const formBtnClick = (btn) => {
tableInfo
.
value
.
data
=
[];
if
(
props
.
toSubjectTables
[
0
]?.
guid
)
{
tableInfo
.
value
.
loading
=
true
;
getSubjectFields
(
props
.
toSubjectTables
[
0
]?.
guid
).
then
((
res
:
any
)
=>
{
getSubjectFields
(
props
.
toSubjectTables
[
0
]?.
guid
,
props
.
dataSource
||
props
.
value
.
dataSource
).
then
((
res
:
any
)
=>
{
tableInfo
.
value
.
loading
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
tableInfo
.
value
.
data
=
res
.
data
||
[];
...
...
@@ -704,7 +752,7 @@ const formBtnClick = (btn) => {
sqlTableFieldInfo
.
value
.
data
=
[];
if
(
props
.
toSubjectTables
[
0
]?.
guid
)
{
sqlTableFieldInfo
.
value
.
loading
=
true
;
getSubjectFields
(
props
.
toSubjectTables
[
0
]?.
guid
).
then
((
res
:
any
)
=>
{
getSubjectFields
(
props
.
toSubjectTables
[
0
]?.
guid
,
props
.
dataSource
||
props
.
value
.
dataSource
).
then
((
res
:
any
)
=>
{
sqlTableFieldInfo
.
value
.
loading
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
sqlTableFieldInfo
.
value
.
data
=
res
.
data
||
[];
...
...
@@ -734,7 +782,7 @@ const formBtnClick = (btn) => {
valueRangeTableListData
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
[];
if
(
props
.
toSubjectTables
[
0
]?.
guid
)
{
valueRangeTableListLoading
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
true
;
getSubjectFields
(
props
.
toSubjectTables
[
0
]?.
guid
).
then
((
res
:
any
)
=>
{
getSubjectFields
(
props
.
toSubjectTables
[
0
]?.
guid
,
props
.
dataSource
||
props
.
value
.
dataSource
).
then
((
res
:
any
)
=>
{
valueRangeTableListLoading
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
let
data
=
res
.
data
||
[];
...
...
@@ -792,7 +840,7 @@ const formBtnClick = (btn) => {
normCheckTableListData
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
[];
if
(
props
.
toSubjectTables
[
0
]?.
guid
)
{
normCheckTableListLoading
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
true
;
getSubjectFields
(
props
.
toSubjectTables
[
0
]?.
guid
).
then
((
res
:
any
)
=>
{
getSubjectFields
(
props
.
toSubjectTables
[
0
]?.
guid
,
props
.
dataSource
||
props
.
value
.
dataSource
).
then
((
res
:
any
)
=>
{
normCheckTableListLoading
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
let
data
=
res
.
data
||
[];
...
...
@@ -1099,7 +1147,7 @@ const listItemClick = (data) => {
if
(
ruleType
.
value
===
'custom_sql'
)
{
sqlTableFilters
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
sqlTableFilters
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
||
""
;
sqlTableFieldInfo
.
value
.
loading
=
true
;
getSubjectFields
(
data
.
guid
).
then
((
res
:
any
)
=>
{
getSubjectFields
(
data
.
guid
,
props
.
dataSource
||
props
.
value
.
dataSource
).
then
((
res
:
any
)
=>
{
sqlTableFieldInfo
.
value
.
loading
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
sqlTableFieldInfo
.
value
.
data
=
res
.
data
||
[];
...
...
@@ -1110,7 +1158,7 @@ const listItemClick = (data) => {
}
else
if
(
ruleType
.
value
===
'logic_check'
)
{
tableFilters
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
tableFilters
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
||
""
;
tableInfo
.
value
.
loading
=
true
;
getSubjectFields
(
data
.
guid
).
then
((
res
:
any
)
=>
{
getSubjectFields
(
data
.
guid
,
props
.
dataSource
||
props
.
value
.
dataSource
).
then
((
res
:
any
)
=>
{
tableInfo
.
value
.
loading
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
tableInfo
.
value
.
data
=
res
.
data
||
[];
...
...
@@ -1120,7 +1168,7 @@ const listItemClick = (data) => {
})
}
else
if
(
ruleType
.
value
==
'null_value_check'
||
ruleType
.
value
==
'repeate_data_check'
)
{
nullTableInfo
.
value
.
loading
=
true
;
getSubjectFields
(
data
.
guid
).
then
((
res
:
any
)
=>
{
getSubjectFields
(
data
.
guid
,
props
.
dataSource
||
props
.
value
.
dataSource
).
then
((
res
:
any
)
=>
{
nullTableInfo
.
value
.
loading
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
nullTableInfo
.
value
.
data
=
res
.
data
||
[];
...
...
@@ -1143,7 +1191,7 @@ const listItemClick = (data) => {
}
let
defaultValue
=
panelList
.
value
[
12
].
defaultValue
;
valueRangeTableListLoading
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
true
;
getSubjectFields
(
data
.
guid
).
then
((
res
:
any
)
=>
{
getSubjectFields
(
data
.
guid
,
props
.
dataSource
||
props
.
value
.
dataSource
).
then
((
res
:
any
)
=>
{
valueRangeTableListLoading
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
let
data
=
res
.
data
||
[];
...
...
@@ -1178,7 +1226,7 @@ const listItemClick = (data) => {
}
let
defaultValue
=
panelList
.
value
[
14
].
defaultValue
;
normCheckTableListLoading
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
true
;
getSubjectFields
(
data
.
guid
).
then
((
res
:
any
)
=>
{
getSubjectFields
(
data
.
guid
,
props
.
dataSource
||
props
.
value
.
dataSource
).
then
((
res
:
any
)
=>
{
normCheckTableListLoading
.
value
[
dialogSelectSubjectTable
.
value
.
enName
]
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
let
data
=
res
.
data
||
[];
...
...
@@ -1226,7 +1274,7 @@ const tableInfo: any = ref({
fields
:
[
{
label
:
"字段名"
,
field
:
"enName"
,
width
:
140
,
type
:
'text_btn'
,
value
:
'enName'
,
columClass
:
'text_btn'
},
{
label
:
"注释"
,
field
:
"chName"
,
width
:
120
},
{
label
:
"数据类型"
,
field
:
"dataType
Ch
Name"
,
width
:
100
},
{
label
:
"数据类型"
,
field
:
"dataTypeName"
,
width
:
100
},
],
data
:
[],
showPage
:
false
,
...
...
@@ -1440,7 +1488,7 @@ const sqlTableFieldInfo: any = ref({
fields
:
[
{
label
:
"字段名"
,
field
:
"enName"
,
width
:
140
,
type
:
'text_btn'
,
value
:
'enName'
,
columClass
:
'text_btn'
},
{
label
:
"注释"
,
field
:
"chName"
,
width
:
120
},
{
label
:
"数据类型"
,
field
:
"dataType
Ch
Name"
,
width
:
100
},
{
label
:
"数据类型"
,
field
:
"dataTypeName"
,
width
:
100
},
],
data
:
[],
showPage
:
false
,
...
...
@@ -1584,7 +1632,7 @@ const nullTableInfo: any = ref({
fields
:
[
{
label
:
"字段名"
,
field
:
"enName"
,
width
:
140
},
{
label
:
"注释"
,
field
:
"chName"
,
width
:
120
},
{
label
:
"数据类型"
,
field
:
"dataType
Ch
Name"
,
width
:
100
},
{
label
:
"数据类型"
,
field
:
"dataTypeName"
,
width
:
100
},
],
data
:
[],
showPage
:
false
,
...
...
@@ -1680,7 +1728,7 @@ const getSubjectTableByDomainData = (guid) => {
}
const
defaultExpandedKeys
=
computed
(()
=>
{
return
props
.
value
&&
contrastSubjects
.
value
?.
length
?
[
contrastSubjects
.
value
.
find
(
c
=>
c
.
children
?.
some
(
cc
=>
cc
.
guid
==
props
.
value
.
contrastSubjectDomainGuid
)).
guid
,
props
.
value
.
contrastSubjectDomainGuid
]
:
[];
return
props
.
value
&&
contrastSubjects
.
value
?.
length
?
[
props
.
value
.
contrastSubjectDomainGuid
]
:
[];
})
const
contrastSubjectInputFilterMethod
=
(
v
,
data
)
=>
{
...
...
@@ -1788,7 +1836,7 @@ const compareTableFields = ref({}); //选择对比表对应的字段列表
/** 主表下拉选择变化 */
const
tableInteMainSelectChange
=
(
val
)
=>
{
mainTableFields
.
value
[
val
]
=
[];
getSubjectFields
(
val
).
then
((
res
:
any
)
=>
{
getSubjectFields
(
val
,
props
.
dataSource
||
props
.
value
.
dataSource
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
mainTableFields
.
value
[
val
]
=
res
.
data
?.
map
(
d
=>
{
return
Object
.
assign
({},
d
,
{
...
...
@@ -1804,7 +1852,7 @@ const tableInteMainSelectChange = (val) => {
/** 对比表下拉选择变化 */
const
tableInteCompareSelectChange
=
(
val
)
=>
{
compareTableFields
.
value
[
val
]
=
[];
getSubjectFields
(
val
).
then
((
res
:
any
)
=>
{
getSubjectFields
(
val
,
props
.
dataSource
||
props
.
value
.
dataSource
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
compareTableFields
.
value
[
val
]
=
res
.
data
?.
map
(
d
=>
{
return
Object
.
assign
({},
d
,
{
...
...
@@ -2165,26 +2213,23 @@ defineExpose({
</el-table-column>
<el-table-column
prop=
"chName"
label=
"注释"
width=
"120px"
align=
"left"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop=
"dataType
Ch
Name"
label=
"数据类型"
width=
"100px"
show-overflow-tooltip
>
<el-table-column
prop=
"dataTypeName"
label=
"数据类型"
width=
"100px"
show-overflow-tooltip
>
<
template
#
default=
"scope"
>
<span>
{{
scope
.
row
[
"dataType
Ch
Name"
]
||
'--'
}}
</span>
<span>
{{
scope
.
row
[
"dataTypeName"
]
||
'--'
}}
</span>
</
template
>
</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>
<template
v-else
>
<el-input
v-show=
"
scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit
'"
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'"
>
<
!--
<
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>
-->
<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'"
>
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>
...
...
@@ -2192,7 +2237,6 @@ defineExpose({
</el-input>
</div>
</
template
>
</template>
</el-table-column>
</el-table>
</div>
...
...
@@ -2236,12 +2280,12 @@ defineExpose({
<
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] : []"
:
data
=
"contrastSubjects"
placeholder
=
"请选择"
:
default
-
expanded
-
keys
=
"contrastSubjects?.length ? [scope.row.compareSubjectDomainGuid] : []"
:
auto
-
expand
-
parent
=
"true"
:
default
-
checked
-
keys
=
"[scope.row['compareTableGuid']]"
:
filter
-
node
-
method
=
"contrastSubjectInputFilterMethod"
:
props
=
"
{
value
:
'guid'
,
label
:
'
name
'
,
label
:
'
label
'
,
children
:
'children'
,
isLeaf
:
'isLeaf'
}"
>
...
...
@@ -2297,9 +2341,9 @@ defineExpose({
</el-table-column>
<el-table-column prop="
chName
" label="
注释
" width="
120
px
" align="
left
" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="
dataType
Ch
Name
" label="
数据类型
" width="
100
px
" show-overflow-tooltip>
<el-table-column prop="
dataTypeName
" label="
数据类型
" width="
100
px
" show-overflow-tooltip>
<template #default="
scope
"
>
<
span
>
{{
scope
.
row
[
"dataType
Ch
Name"
]
||
'--'
}}
<
/span
>
<
span
>
{{
scope
.
row
[
"dataTypeName"
]
||
'--'
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"checkRule"
label
=
"选择检验规则"
width
=
"150px"
align
=
"left"
show
-
overflow
-
tooltip
>
...
...
@@ -2378,8 +2422,7 @@ 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
=
"请选择"
lazy
:
load
=
"(node, resolve) => treeSelectLoad(node, resolve)"
:
default
-
expanded
-
keys
=
"defaultExpandedKeys"
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'
,
...
...
src/views/data_quality/ruleModel.vue
View file @
c9e1f69
...
...
@@ -9,7 +9,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
import
StepBar
from
"@/components/StepBar/index.vue"
;
import
TreeTransfer
from
"@/components/TreeTransfer/index.vue"
;
import
{
get
SubjectTableTree
,
get
InventoryDsDir
,
getSubjectTableByDomain
,
saveQualityTable
,
getRuleTypeList
,
...
...
@@ -63,15 +63,46 @@ const toSubjectTables: any = ref([]);
const
getSubjectTableTreeData
=
()
=>
{
dsFromTreeDataLoading
.
value
=
true
;
getMetaTreeData
({}).
then
((
res
:
any
)
=>
{
if
(
route
.
query
.
dataSource
==
'4'
)
{
getInventoryDsDir
().
then
((
res
:
any
)
=>
{
dsFromTreeDataLoading
.
value
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
dsFromTreeData
.
value
=
res
.
data
?.
map
(
d
=>
{
d
.
parentGuid
=
0
;
d
.
guid
=
d
.
databaseGuid
;
d
.
name
=
d
.
databaseChName
;
d
.
label
=
d
.
databaseChName
+
`(
${
d
.
database
}
)`
;
d
.
children
=
d
.
children
?.
map
(
child
=>
{
child
.
parentGuid
=
d
.
guid
;
child
.
label
=
child
.
tableChName
+
`(
${
child
.
tableName
}
)`
;
child
.
guid
=
child
.
tableGuid
;
child
.
dataServerName
=
d
.
database
;
child
.
dataSourceGuid
=
d
.
databaseGuid
;
child
.
parentGuid
=
d
.
databaseGuid
;
return
child
;
})
return
d
;
})
||
[];
}
})
}
else
{
getMetaTreeData
({
isImportCreate
:
'N'
}).
then
((
res
:
any
)
=>
{
dsFromTreeDataLoading
.
value
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
dsFromTreeData
.
value
=
res
.
data
?.
children
?.
map
(
d
=>
{
d
.
parentGuid
=
0
;
d
.
label
=
d
.
name
;
d
.
children
=
d
.
children
?.
map
(
child
=>
{
child
.
label
=
child
.
name
+
`(
${
child
.
tableName
}
)`
;
child
.
dataServerName
=
d
.
name
;
child
.
dataSourceGuid
=
d
.
guid
;
return
child
;
})
return
d
;
})
||
[];
}
})
}
}
const
getSubjectTableByDomainData
=
(
guid
)
=>
{
...
...
@@ -158,12 +189,14 @@ const changeStep = (val, skip = false) => {
}
toSubjectTables
.
value
=
[];
dsToTreeData
.
value
.
forEach
(
d
=>
{
d
.
children
.
forEach
(
c
=>
{
c
.
children
.
forEach
(
child
=>
{
child
.
label
=
`
${
child
.
enName
}
(
${
child
.
chName
}
)`
;
d
.
children
.
forEach
(
child
=>
{
child
.
guid
=
child
.
tableGuid
||
child
.
guid
;
child
.
enName
=
child
.
tableName
;
child
.
chName
=
child
.
tableChName
||
child
.
name
;
child
.
dataSourceGuid
=
child
.
parentGuid
;
child
.
databaseName
=
child
.
databaseName
,
toSubjectTables
.
value
.
push
(
child
);
})
})
});
step
.
value
=
val
-
1
;
stepsInfo
.
value
.
step
=
val
-
1
...
...
@@ -211,6 +244,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
qualityModelGuid
:
modelGuid
})]
...
...
@@ -229,6 +263,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
ruleField
:
fields
?.
map
(
f
=>
{
return
{
...
...
@@ -252,6 +287,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
ruleField
:
[{
guid
:
fields
.
guid
,
...
...
@@ -276,6 +312,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
ruleField
:
fields
?.
map
(
f
=>
{
return
{
...
...
@@ -300,6 +337,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
differenceRange
:
row
.
differenceRange
,
rows
:
[],
...
...
@@ -319,6 +357,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
ruleField
:
fields
.
map
(
f
=>
{
return
{
...
...
@@ -347,6 +386,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
ruleField
:
fields
.
map
(
f
=>
{
return
{
...
...
@@ -382,6 +422,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
enName
:
row
.
mainTableField
,
compareTableGuid
:
row
.
compareTableGuid
,
...
...
@@ -432,17 +473,17 @@ const save = () => {
<div
class=
"panel_title"
>
<div
class=
"title_text"
>
<span>
选择表
</span>
<span
class=
"tips_text"
>
选择需要添加质检规则的表,请确保数据库为脱产环境,避免数据质检影响您的生产环境,且允许在该脱产环境建脏数据的库,请知晓!
</span>
<span
class=
"tips_text"
>
{{
route
.
query
.
dataSource
==
'5'
?
'选择需要添加质检规则的表,请确保数据库为脱产环境,避免数据质检影响您的生产环境,且允许在该脱产环境建脏数据的库,请知晓!'
:
'选择需要添加质检规则的表'
}}
</span>
</div>
</div>
<TreeTransfer
mode=
"transfer"
:title=
"[
'可选表', '已选表']"
pid=
"parentGuid
"
:from-tree-data-loading=
"dsFromTreeDataLoading"
:checkOnClickNode=
"true"
<TreeTransfer
mode=
"transfer"
:title=
"[
route.query.dataSource == '5' ? '可选元数据目录表' : '可选盘点数据库目录表', '已选表']
"
pid=
"parentGuid"
:from-tree-data-loading=
"dsFromTreeDataLoading"
:checkOnClickNode=
"true"
:from_checked_all=
"false"
:from_data=
"dsFromTreeData"
:to_data=
"dsToTreeData"
node_key=
"guid"
:transferOpenNode=
"true"
width=
"70%"
:defaultProps=
"
{
label: '
name
',
label: '
label
',
value: 'guid'
}"
height="calc(100% - 64px)">
}" height="calc(100% - 64px)">
</TreeTransfer>
</div>
</div>
...
...
@@ -457,7 +498,8 @@ const save = () => {
<div
class=
"panel_content"
>
<div
class=
"form_panel"
>
<ruleForm
ref=
"ruleFormRef"
:toSubjectTables=
"toSubjectTables"
:ruleTypeList=
"ruleTypeList"
:largeCategoryList=
"largeCategoryList"
:smallCategoryList=
"smallCategoryList"
></ruleForm>
:data-source=
"route.query.dataSource as string"
:largeCategoryList=
"largeCategoryList"
:smallCategoryList=
"smallCategoryList"
></ruleForm>
</div>
</div>
</div>
...
...
src/views/data_quality/ruleTemplate.vue
View file @
c9e1f69
...
...
@@ -204,15 +204,14 @@ const save = () => {
subjectGuid
:
modelDetailInfo
.
value
.
subjectGuid
,
subjectName
:
modelDetailInfo
.
value
.
subjectName
,
dataSourceGuid
:
modelDetailInfo
.
value
.
dataSourceGuid
,
modelRuleConfList
:
submitInfos
modelRuleConfList
:
submitInfos
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
}]).
then
((
res
:
any
)
=>
{
fullScreenLoading
.
value
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
ElMessage
.
success
(
'新建规则保存成功'
);
router
.
push
({
name
:
'qualityRules'
});
userStore
.
setTabbar
(
userStore
.
tabbar
.
filter
((
tab
:
any
)
=>
tab
.
fullPath
!==
fullPath
));
router
.
go
(
-
1
);
dataQualityStore
.
setModelGuid
(
modelGuid
);
}
else
{
ElMessage
.
error
(
res
.
msg
);
...
...
@@ -317,7 +316,7 @@ const cancel = () => {
</div>
<div
class=
"panel_content"
v-show=
"item.open"
>
<div
class=
"form_panel"
>
<ruleForm
ref=
"ruleFormRef"
:toSubjectTables=
"toSubjectTables"
:ruleTypeList=
"ruleTypeList"
<ruleForm
ref=
"ruleFormRef"
:toSubjectTables=
"toSubjectTables"
:ruleTypeList=
"ruleTypeList"
:dataSource=
"route.query.dataSource as string"
:largeCategoryList=
"largeCategoryList"
:smallCategoryList=
"smallCategoryList"
:isSingle=
"true"
>
</ruleForm>
</div>
...
...
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