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
61b0af02
authored
2025-07-09 17:54:16 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 质量规则支持新建质检表
1 parent
1f7642a0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
17 deletions
src/api/modules/dataQuality.ts
src/views/data_quality/qualityRules.vue
src/views/data_quality/ruleModel.vue
src/api/modules/dataQuality.ts
View file @
61b0af0
...
...
@@ -178,3 +178,9 @@ export const updateModelRule = (params) => request({
method
:
'post'
,
data
:
params
})
// 获取产品目录guid下面的资源表
export
const
getDamCatalogTableList
=
(
damGuid
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_API_NEW_PORTAL
}
/dam-catalog-table/quality/get-table-list?damGuid=
${
damGuid
}
`
,
method
:
'get'
})
\ No newline at end of file
...
...
src/views/data_quality/qualityRules.vue
View file @
61b0af0
...
...
@@ -258,8 +258,8 @@ const groupTableInfo = ref({
width
:
92
,
btns
:
(
scope
)
=>
{
return
[
{
label
:
"编辑"
,
value
:
"edit"
,
disabled
:
scope
.
row
.
dataSource
!=
'5
'
},
{
label
:
"删除"
,
value
:
"delete"
,
disabled
:
scope
.
row
.
dataSource
!=
'5
'
},
{
label
:
"编辑"
,
value
:
"edit"
,
disabled
:
scope
.
row
.
dataSource
==
'4
'
},
{
label
:
"删除"
,
value
:
"delete"
,
disabled
:
scope
.
row
.
dataSource
==
'4
'
},
]
},
}
...
...
@@ -675,13 +675,17 @@ const clickCreateGroup = () => {
/** 新建质检表 */
const
clickCreateTable
=
()
=>
{
router
.
push
({
name
:
'ruleModel'
,
query
:
{
let
query
:
any
=
{
groupGuid
:
page
.
value
.
modelGroupGuid
,
name
:
lastSelectNode
.
value
.
data
.
name
,
dataSource
:
lastSelectNode
.
value
.
data
.
dataSource
dataSource
:
lastSelectNode
.
value
.
data
.
dataSource
,
};
if
(
lastSelectNode
.
value
.
data
.
damGuid
&&
lastSelectNode
.
value
.
data
.
children
?.[
0
]?.
dataSource
!=
5
)
{
query
.
damGuid
=
lastSelectNode
.
value
.
data
.
damGuid
}
router
.
push
({
name
:
'ruleModel'
,
query
:
query
});
}
...
...
src/views/data_quality/ruleModel.vue
View file @
61b0af0
...
...
@@ -15,6 +15,7 @@ import {
getRuleTypeList
,
getSmallCategoryList
,
getLargeCategoryList
,
getDamCatalogTableList
}
from
'@/api/modules/dataQuality'
;
import
{
getMetaTreeData
...
...
@@ -33,6 +34,7 @@ const route = useRoute();
const
modelGroupGuid
:
any
=
ref
(
route
.
query
.
groupGuid
);
const
fullPath
=
route
.
fullPath
;
let
damGuid
:
any
=
ref
(
route
.
query
.
damGuid
);
const
fullScreenLoading
=
ref
(
false
);
...
...
@@ -61,6 +63,8 @@ const dsToTreeData: any = ref([]);
const
toSubjectTables
:
any
=
ref
([]);
const
isProductDam
=
ref
(
false
);
const
getSubjectTableTreeData
=
()
=>
{
dsFromTreeDataLoading
.
value
=
true
;
if
(
route
.
query
.
dataSource
==
'4'
)
{
...
...
@@ -86,6 +90,21 @@ const getSubjectTableTreeData = () => {
}
})
}
else
{
if
(
damGuid
.
value
)
{
getDamCatalogTableList
(
damGuid
.
value
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
if
(
res
.
data
?.
length
)
{
dsFromTreeDataLoading
.
value
=
false
;
isProductDam
.
value
=
true
;
dsFromTreeData
.
value
=
res
.
data
?.
map
(
d
=>
{
d
.
parentGuid
=
0
;
d
.
label
=
d
.
name
+
`(
${
d
.
tableName
}
)`
;
d
.
dataServerName
=
d
.
databaseName
;
d
.
dataSourceGuid
=
d
.
dataSourceGuid
;
return
d
;
})
||
[];
}
else
{
isProductDam
.
value
=
false
;
getMetaTreeData
({
isImportCreate
:
'N'
}).
then
((
res
:
any
)
=>
{
dsFromTreeDataLoading
.
value
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
...
...
@@ -100,9 +119,46 @@ const getSubjectTableTreeData = () => {
})
return
d
;
})
||
[];
}
else
{
ElMessage
({
type
:
'error'
,
message
:
res
.
msg
,
})
}
})
}
}
else
{
dsFromTreeDataLoading
.
value
=
false
;
ElMessage
({
type
:
'error'
,
message
:
res
.
msg
,
})
}
})
}
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
=
child
.
databaseName
;
child
.
dataSourceGuid
=
d
.
dataSourceGuid
||
d
.
guid
;
return
child
;
})
return
d
;
})
||
[];
}
else
{
ElMessage
({
type
:
'error'
,
message
:
res
.
msg
,
})
}
})
}
}
}
const
getSubjectTableByDomainData
=
(
guid
)
=>
{
...
...
@@ -189,6 +245,13 @@ const changeStep = (val, skip = false) => {
}
toSubjectTables
.
value
=
[];
dsToTreeData
.
value
.
forEach
(
d
=>
{
if
(
isProductDam
.
value
)
{
d
.
enName
=
d
.
tableName
;
d
.
chName
=
d
.
tableChName
||
d
.
name
;
d
.
dataSourceGuid
=
d
.
dataSourceGuid
;
d
.
databaseName
=
d
.
databaseName
,
toSubjectTables
.
value
.
push
(
d
);
}
else
{
d
.
children
.
forEach
(
child
=>
{
child
.
guid
=
child
.
tableGuid
||
child
.
guid
;
child
.
enName
=
child
.
tableName
;
...
...
@@ -197,6 +260,7 @@ const changeStep = (val, skip = false) => {
child
.
databaseName
=
child
.
databaseName
,
toSubjectTables
.
value
.
push
(
child
);
})
}
});
step
.
value
=
val
-
1
;
stepsInfo
.
value
.
step
=
val
-
1
...
...
@@ -244,7 +308,8 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
dataSource
:
route
.
query
.
dataSource
!=
'1'
?
parseInt
(
route
.
query
.
dataSource
)
:
(
!
isProductDam
.
value
?
5
:
parseInt
(
route
.
query
.
dataSource
)),
damGuid
:
isProductDam
.
value
?
damGuid
.
value
:
null
,
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
qualityModelGuid
:
modelGuid
})]
...
...
@@ -263,7 +328,8 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
damGuid
:
isProductDam
.
value
?
damGuid
.
value
:
null
,
dataSource
:
route
.
query
.
dataSource
!=
'1'
?
parseInt
(
route
.
query
.
dataSource
)
:
(
!
isProductDam
.
value
?
5
:
parseInt
(
route
.
query
.
dataSource
)),
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
ruleField
:
fields
?.
map
(
f
=>
{
return
{
...
...
@@ -287,7 +353,8 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
damGuid
:
isProductDam
.
value
?
damGuid
.
value
:
null
,
dataSource
:
route
.
query
.
dataSource
!=
'1'
?
parseInt
(
route
.
query
.
dataSource
)
:
(
!
isProductDam
.
value
?
5
:
parseInt
(
route
.
query
.
dataSource
)),
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
ruleField
:
[{
guid
:
fields
.
guid
,
...
...
@@ -312,7 +379,8 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
damGuid
:
isProductDam
.
value
?
damGuid
.
value
:
null
,
dataSource
:
route
.
query
.
dataSource
!=
'1'
?
parseInt
(
route
.
query
.
dataSource
)
:
(
!
isProductDam
.
value
?
5
:
parseInt
(
route
.
query
.
dataSource
)),
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
ruleField
:
fields
?.
map
(
f
=>
{
return
{
...
...
@@ -337,7 +405,8 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
damGuid
:
isProductDam
.
value
?
damGuid
.
value
:
null
,
dataSource
:
route
.
query
.
dataSource
!=
'1'
?
parseInt
(
route
.
query
.
dataSource
)
:
(
!
isProductDam
.
value
?
5
:
parseInt
(
route
.
query
.
dataSource
)),
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
differenceRange
:
row
.
differenceRange
,
rows
:
[],
...
...
@@ -357,7 +426,8 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
damGuid
:
isProductDam
.
value
?
damGuid
.
value
:
null
,
dataSource
:
route
.
query
.
dataSource
!=
'1'
?
parseInt
(
route
.
query
.
dataSource
)
:
(
!
isProductDam
.
value
?
5
:
parseInt
(
route
.
query
.
dataSource
)),
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
ruleField
:
fields
.
map
(
f
=>
{
return
{
...
...
@@ -386,7 +456,8 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
damGuid
:
isProductDam
.
value
?
damGuid
.
value
:
null
,
dataSource
:
route
.
query
.
dataSource
!=
'1'
?
parseInt
(
route
.
query
.
dataSource
)
:
(
!
isProductDam
.
value
?
5
:
parseInt
(
route
.
query
.
dataSource
)),
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
ruleField
:
fields
.
map
(
f
=>
{
return
{
...
...
@@ -422,7 +493,8 @@ const transformRulesInfo = (info: any) => {
subjectGuid
:
tableInfo
.
guid
,
dataSourceGuid
:
tableInfo
.
dataSourceGuid
,
databaseName
:
tableInfo
.
dataServerName
,
dataSource
:
route
.
query
.
dataSource
?
parseInt
(
<
string
>
route
.
query
.
dataSource
)
:
null
,
damGuid
:
isProductDam
.
value
?
damGuid
.
value
:
null
,
dataSource
:
route
.
query
.
dataSource
!=
'1'
?
parseInt
(
route
.
query
.
dataSource
)
:
(
!
isProductDam
.
value
?
5
:
parseInt
(
route
.
query
.
dataSource
)),
modelRuleConfList
:
[
Object
.
assign
({},
info
,
{
ruleField
:
info
.
ruleFields
.
map
(
row
=>
{
return
{
...
...
@@ -452,11 +524,11 @@ const save = () => {
saveQualityTable
(
params
).
then
((
res
:
any
)
=>
{
fullScreenLoading
.
value
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
ElMessage
.
success
(
'新建质检表保存成功'
);
//跳到对应的分组下
router
.
push
({
name
:
'qualityRules'
});
ElMessage
.
success
(
'新建质检表保存成功'
);
userStore
.
setTabbar
(
userStore
.
tabbar
.
filter
((
tab
:
any
)
=>
tab
.
fullPath
!==
fullPath
));
dataQualityStore
.
set
(
modelGroupGuid
.
value
);
}
else
{
...
...
@@ -484,7 +556,7 @@ const save = () => {
'选择需要添加质检规则的表,请确保数据库为脱产环境,避免数据质检影响您的生产环境,且允许在该脱产环境建脏数据的库,请知晓!'
:
'选择需要添加质检规则的表'
}}
</span>
</div>
</div>
<TreeTransfer
mode=
"transfer"
:title=
"[route.query.dataSource == '
5' ? '可选元数据目录表' : '可选盘点数据库目录表'
, '已选表']"
<TreeTransfer
mode=
"transfer"
:title=
"[route.query.dataSource == '
4' ? '可选盘点数据库目录表' : (isProductDam ? '产品目录资源表' : '可选元数据目录表')
, '已选表']"
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=
"
{
...
...
@@ -505,7 +577,7 @@ const save = () => {
<div
class=
"panel_content"
>
<div
class=
"form_panel"
>
<ruleForm
ref=
"ruleFormRef"
:toSubjectTables=
"toSubjectTables"
:ruleTypeList=
"ruleTypeList"
:data-source=
"route.query.dataSource as string"
:largeCategoryList=
"largeCategoryList"
:data-source=
"
(!isProductDam && route.query.dataSource == '1') ? '5' :
route.query.dataSource as string"
:largeCategoryList=
"largeCategoryList"
:smallCategoryList=
"smallCategoryList"
></ruleForm>
</div>
</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