Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bigDataSystem
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
bigDataSystem
Commits
30eb46f8
Commit
30eb46f8
authored
Nov 14, 2024
by
LiXuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
版本管理
parent
a407e696
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
296 additions
and
20 deletions
+296
-20
index.ts
src/router/routes/index.ts
+1
-1
addNewVersion.vue
src/views/dataQuality/dataSheet/rule/addNewVersion.vue
+59
-0
index.vue
src/views/dataQuality/dataSheet/rule/index.vue
+20
-6
rule.data.ts
src/views/dataQuality/dataSheet/rule/rule.data.ts
+103
-1
ruleData.ts
src/views/dataQuality/dataSheet/rule/ruleData.ts
+14
-0
ruleEditModel.vue
src/views/dataQuality/dataSheet/rule/ruleEditModel.vue
+25
-12
versionManage.vue
src/views/dataQuality/dataSheet/rule/versionManage.vue
+74
-0
No files found.
src/router/routes/index.ts
View file @
30eb46f8
...
@@ -386,7 +386,7 @@ export const QualityRuleRoute: AppRouteRecordRaw = {
...
@@ -386,7 +386,7 @@ export const QualityRuleRoute: AppRouteRecordRaw = {
{
{
path
:
'ruleMoreAdd'
,
path
:
'ruleMoreAdd'
,
name
:
'RuleMoreAdd'
,
name
:
'RuleMoreAdd'
,
component
:
()
=>
import
(
'@/views/dataQuality/rule/ruleMoreAdd.vue'
),
component
:
()
=>
import
(
'@/views/dataQuality/
dataSheet/
rule/ruleMoreAdd.vue'
),
meta
:
{
meta
:
{
title
:
'质量规则批量创建'
,
title
:
'质量规则批量创建'
,
icon
:
''
,
icon
:
''
,
...
...
src/views/dataQuality/dataSheet/rule/addNewVersion.vue
0 → 100644
View file @
30eb46f8
<
template
>
<BasicModal
width=
"40%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
>
<BasicForm
@
register=
"registerForm"
/>
</BasicModal>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
unref
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
addNewVersionFormSchema
,
}
from
'@/views/dataQuality/dataSheet/rule/rule.data'
;
import
BasicForm
from
'@/components/Form/src/BasicForm.vue'
;
import
{
useForm
}
from
'@/components/Form'
;
const
emit
=
defineEmits
([
'handle-submit-new-version'
]);
const
isUpdate
=
ref
(
true
);
const
rowId
=
ref
(
''
);
// const getTitle = computed(() => (isUpdate.value ? '质量规则详情' : '新建规则'));
const
getTitle
=
'提交新版本'
;
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
await
resetFields
();
setModalProps
({
confirmLoading
:
false
});
isUpdate
.
value
=
!!
data
?.
isUpdate
;
if
(
unref
(
isUpdate
))
{
// 获取行数据的id
rowId
.
value
=
data
.
record
.
businessId
;
// 塞值
await
setFieldsValue
({
...
data
.
record
,
});
}
});
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
getFieldsValue
,
validate
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
addNewVersionFormSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
// 确认按钮配置
submitButtonOptions
:
{
text
:
'提交新版本'
,
},
});
/**确定按钮*/
async
function
handleSubmit
()
{
await
validate
();
closeModal
();
emit
(
'handle-submit-new-version'
,
getFieldsValue
().
describe
);
}
</
script
>
src/views/dataQuality/dataSheet/rule/index.vue
View file @
30eb46f8
...
@@ -54,6 +54,7 @@
...
@@ -54,6 +54,7 @@
},
},
{
{
icon: 'ion:chevron-down-circle-outline',
icon: 'ion:chevron-down-circle-outline',
onClick: handleVersion.bind(null, record),
},
},
{
{
// 删除
// 删除
...
@@ -70,11 +71,12 @@
...
@@ -70,11 +71,12 @@
</
template
>
</
template
>
</template>
</template>
</BasicTable>
</BasicTable>
<Rule
Model
@
register=
"rule
Modal"
/>
<Rule
EditModel
:is-add=
"isAdd"
@
register=
"ruleEdit
Modal"
/>
<RuleMoreUpdate
@
register=
"ruleMoreUpdateModel"
/>
<RuleMoreUpdate
@
register=
"ruleMoreUpdateModel"
/>
<RuleGroupAddModel
@
register=
"ruleGroupAddModel"
/>
<RuleGroupAddModel
@
register=
"ruleGroupAddModel"
/>
<RuleGroupEditModel
@
register=
"ruleGroupEditModel"
/>
<RuleGroupEditModel
@
register=
"ruleGroupEditModel"
/>
<MoveInGroupModel
@
register=
"moveInGroupModel"
/>
<MoveInGroupModel
@
register=
"moveInGroupModel"
/>
<VersionManage
@
register=
"versionManage"
/>
</PageWrapper>
</PageWrapper>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
...
@@ -84,7 +86,7 @@
...
@@ -84,7 +86,7 @@
import
{
ruleFormSchema
,
ruleTable
}
from
'@/views/dataQuality/dataSheet/rule/rule.data'
;
import
{
ruleFormSchema
,
ruleTable
}
from
'@/views/dataQuality/dataSheet/rule/rule.data'
;
import
{
Tabs
}
from
'ant-design-vue'
;
import
{
Tabs
}
from
'ant-design-vue'
;
import
{
ruleData
,
treeData
,
treeData1
,
treeData2
}
from
'./ruleData'
;
import
{
ruleData
,
treeData
,
treeData1
,
treeData2
}
from
'./ruleData'
;
import
Rule
Model
from
'./rule
Model.vue'
;
import
Rule
EditModel
from
'./ruleEdit
Model.vue'
;
import
RuleMoreUpdate
from
'./ruleMoreUpdateModel.vue'
;
import
RuleMoreUpdate
from
'./ruleMoreUpdateModel.vue'
;
import
RuleGroupAddModel
from
'./ruleGroupAddModel.vue'
;
import
RuleGroupAddModel
from
'./ruleGroupAddModel.vue'
;
import
RuleGroupEditModel
from
'./ruleGroupEditModel.vue'
;
import
RuleGroupEditModel
from
'./ruleGroupEditModel.vue'
;
...
@@ -92,16 +94,18 @@
...
@@ -92,16 +94,18 @@
import
{
useModal
}
from
'@/components/Modal'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
{
useRouter
}
from
'vue-router'
;
import
{
useRouter
}
from
'vue-router'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
h
}
from
'vue'
;
import
{
h
,
ref
}
from
'vue'
;
import
{
FolderAddOutlined
,
SettingOutlined
}
from
'@ant-design/icons-vue'
;
import
{
FolderAddOutlined
,
SettingOutlined
}
from
'@ant-design/icons-vue'
;
// 模态框
// 模态框
const
isAdd
=
ref
(
true
);
const
{
push
}
=
useRouter
();
const
{
push
}
=
useRouter
();
const
{
createMessage
,
createConfirm
}
=
useMessage
();
const
{
createMessage
,
createConfirm
}
=
useMessage
();
const
[
rule
Modal
,
{
openModal
:
openRule
Model
}]
=
useModal
();
const
[
rule
EditModal
,
{
openModal
:
openRuleEdit
Model
}]
=
useModal
();
const
[
ruleMoreUpdateModel
,
{
openModal
:
openRuleMoreUpdateModel
}]
=
useModal
();
const
[
ruleMoreUpdateModel
,
{
openModal
:
openRuleMoreUpdateModel
}]
=
useModal
();
const
[
ruleGroupAddModel
,
{
openModal
:
openRuleGroupAddModel
}]
=
useModal
();
const
[
ruleGroupAddModel
,
{
openModal
:
openRuleGroupAddModel
}]
=
useModal
();
const
[
ruleGroupEditModel
,
{
openModal
:
openRuleGroupEditModel
}]
=
useModal
();
const
[
ruleGroupEditModel
,
{
openModal
:
openRuleGroupEditModel
}]
=
useModal
();
const
[
moveInGroupModel
,
{
openModal
:
openMoveInGroupModel
}]
=
useModal
();
const
[
moveInGroupModel
,
{
openModal
:
openMoveInGroupModel
}]
=
useModal
();
const
[
versionManage
,
{
openModal
:
openVersionManage
}]
=
useModal
();
const
actionList
:
TreeActionItem
[]
=
[
const
actionList
:
TreeActionItem
[]
=
[
{
{
render
:
(
node
)
=>
{
render
:
(
node
)
=>
{
...
@@ -132,7 +136,8 @@
...
@@ -132,7 +136,8 @@
];
];
// 新增
// 新增
function
handleAdd
()
{
function
handleAdd
()
{
openRuleModel
(
true
,
{
isAdd
.
value
=
true
openRuleEditModel
(
true
,
{
isUpdate
:
false
,
isUpdate
:
false
,
});
});
}
}
...
@@ -166,12 +171,21 @@
...
@@ -166,12 +171,21 @@
* 列表编辑
* 列表编辑
*/
*/
function
handleEdit
(
record
)
{
function
handleEdit
(
record
)
{
openRuleModel
(
true
,
{
isAdd
.
value
=
false
openRuleEditModel
(
true
,
{
record
,
record
,
isUpdate
:
true
,
isUpdate
:
true
,
});
});
}
}
/**
* 历史版本
*/
function
handleVersion
()
{
openVersionManage
(
true
,
{
isUpdate
:
false
,
});
}
/**
/**
* 批量编辑
* 批量编辑
*/
*/
...
...
src/views/dataQuality/dataSheet/rule/rule.data.ts
View file @
30eb46f8
import
{
BasicColumn
}
from
'@/components/Table'
;
import
{
BasicColumn
,
FormSchema
}
from
'@/components/Table'
;
export
const
ruleFormSchema
=
[
export
const
ruleFormSchema
=
[
{
{
...
@@ -164,6 +164,79 @@ export const ruleModelFormSchema: any[] = [
...
@@ -164,6 +164,79 @@ export const ruleModelFormSchema: any[] = [
colProps
:
{
lg
:
24
,
md
:
24
},
colProps
:
{
lg
:
24
,
md
:
24
},
},
},
];
];
export
const
ruleEditModelFormSchema
:
any
[]
=
[
{
field
:
'rule'
,
label
:
'规则名称'
,
required
:
true
,
component
:
'Input'
,
colProps
:
{
lg
:
24
,
md
:
24
},
},
{
field
:
'distinct'
,
label
:
'规则描述'
,
component
:
'Input'
,
colProps
:
{
lg
:
24
,
md
:
24
},
},
{
field
:
'group'
,
label
:
'所属规则组'
,
slot
:
'group'
,
colProps
:
{
lg
:
24
,
md
:
24
},
},
{
field
:
'dataSource'
,
label
:
'检查数据源'
,
required
:
true
,
slot
:
'dataSource'
,
component
:
'Select'
,
colProps
:
{
lg
:
24
,
md
:
24
},
},
{
field
:
'dataSource'
,
label
:
'数据源'
,
slot
:
'dataSourceTxt'
,
colProps
:
{
lg
:
24
,
md
:
24
},
},
{
field
:
'model'
,
label
:
'关键模板'
,
required
:
true
,
component
:
'Select'
,
componentProps
:
{
options
:
[{
label
:
'公民身份号码'
,
value
:
'公民身份号码'
}],
},
colProps
:
{
lg
:
24
,
md
:
24
},
},
{
field
:
'config'
,
label
:
'参数配置'
,
slot
:
'config'
,
colProps
:
{
lg
:
24
,
md
:
24
},
},
{
field
:
'whiteList'
,
label
:
'质量白名单'
,
component
:
'Select'
,
colProps
:
{
lg
:
24
,
md
:
24
},
},
{
field
:
'preview'
,
label
:
'SQL预览'
,
component
:
'InputTextArea'
,
componentProps
:
{
placeholder
:
'请输入描述'
,
rows
:
4
,
},
colProps
:
{
lg
:
24
,
md
:
24
},
},
{
field
:
'task'
,
label
:
'关联质量任务'
,
slot
:
'task'
,
colProps
:
{
lg
:
24
,
md
:
24
},
},
];
export
const
configColumn
:
BasicColumn
[]
=
[
export
const
configColumn
:
BasicColumn
[]
=
[
{
{
title
:
'参数'
,
title
:
'参数'
,
...
@@ -354,3 +427,32 @@ export const moveInGroupFormSchema = [
...
@@ -354,3 +427,32 @@ export const moveInGroupFormSchema = [
colProps
:
{
lg
:
24
,
md
:
24
},
colProps
:
{
lg
:
24
,
md
:
24
},
},
},
];
];
export
const
addNewVersionFormSchema
=
[
{
field
:
'describe'
,
label
:
'版本说明'
,
component
:
'InputTextArea'
,
componentProps
:
{
placeholder
:
'请输入内容'
,
autoSize
:
{
minRows
:
2
,
maxRows
:
6
},
maxlength
:
255
,
showCount
:
true
,
},
colProps
:
{
lg
:
24
,
md
:
24
},
},
];
export
const
versionFormSchema
:
FormSchema
[]
=
[
{
field
:
'field1'
,
component
:
'InputSearch'
,
colProps
:
{
span
:
12
,
},
componentProps
:
{
placeholder
:
'输入关键字搜索'
,
onChange
:
(
e
:
any
)
=>
{
console
.
log
(
e
);
},
},
},
];
src/views/dataQuality/dataSheet/rule/ruleData.ts
View file @
30eb46f8
...
@@ -260,3 +260,17 @@ export const ruleGroupEditData = [
...
@@ -260,3 +260,17 @@ export const ruleGroupEditData = [
group
:
''
,
group
:
''
,
},
},
];
];
export
const
versionModelList
=
[
{
version
:
'V2'
,
time
:
'2022/10/27 18:53:43'
,
created
:
'admin'
,
describe
:
'batch create version'
,
},
{
version
:
'V1'
,
time
:
'2022/10/27 18:17:37'
,
created
:
'admin'
,
describe
:
'batch create version'
,
},
];
src/views/dataQuality/dataSheet/rule/ruleModel.vue
→
src/views/dataQuality/dataSheet/rule/rule
Edit
Model.vue
View file @
30eb46f8
...
@@ -95,23 +95,29 @@
...
@@ -95,23 +95,29 @@
</
template
>
</
template
>
</BasicForm>
</BasicForm>
<RuleGroupAddModel
@
register=
"ruleGroupAddModel"
/>
<RuleGroupAddModel
@
register=
"ruleGroupAddModel"
/>
<AddNewVersion
@
register=
"addNewVersion"
@
handle-submit-new-version=
"handleSubmitNewVersion"
/>
</BasicModal>
</BasicModal>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
unref
,
onMounted
}
from
'vue'
;
import
{
ref
,
computed
,
unref
,
defineProps
}
from
'vue'
;
import
{
Select
}
from
'ant-design-vue'
;
import
{
Select
}
from
'ant-design-vue'
;
import
{
BasicModal
,
useModalInner
,
useModal
}
from
'@/components/Modal'
;
import
{
BasicModal
,
useModalInner
,
useModal
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
import
{
configColumn
,
configColumn
,
ruleModelFormSchema
,
ruleEditModelFormSchema
,
ruleModelFormSchema
,
taskColumn
,
taskColumn
,
}
from
'@/views/dataQuality/dataSheet/rule/rule.data'
;
}
from
'@/views/dataQuality/dataSheet/rule/rule.data'
;
import
BasicTable
from
'@/components/Table/src/BasicTable.vue'
;
import
BasicTable
from
'@/components/Table/src/BasicTable.vue'
;
import
RuleGroupAddModel
from
'./ruleGroupAddModel.vue'
;
import
RuleGroupAddModel
from
'./ruleGroupAddModel.vue'
;
import
AddNewVersion
from
'./addNewVersion.vue'
;
import
{
useTable
}
from
'@/components/Table'
;
import
{
useTable
}
from
'@/components/Table'
;
import
{
configData
,
taskData
}
from
'@/views/dataQuality/dataSheet/rule/ruleData'
;
import
{
configData
,
taskData
}
from
'@/views/dataQuality/dataSheet/rule/ruleData'
;
const
props
=
defineProps
({
disabled
:
{
type
:
Boolean
,
default
:
false
},
isAdd
:
{
type
:
Boolean
,
default
:
false
},
});
const
isUpdate
=
ref
(
true
);
const
isUpdate
=
ref
(
true
);
const
rowId
=
ref
(
''
);
const
rowId
=
ref
(
''
);
const
getTitle
=
computed
(()
=>
(
isUpdate
.
value
?
'质量规则详情'
:
'新建规则'
));
const
getTitle
=
computed
(()
=>
(
isUpdate
.
value
?
'质量规则详情'
:
'新建规则'
));
...
@@ -122,24 +128,25 @@
...
@@ -122,24 +128,25 @@
}
}
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
const
[
ruleGroupAddModel
,
{
openModal
:
openRuleGroupAddModel
}]
=
useModal
();
const
[
ruleGroupAddModel
,
{
openModal
:
openRuleGroupAddModel
}]
=
useModal
();
const
[
addNewVersion
,
{
openModal
:
openAddNewVersion
}]
=
useModal
();
//初始化表单
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
labelWidth
:
100
,
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
rule
ModelFormSchema
,
schemas
:
props
.
isAdd
?
ruleModelFormSchema
:
ruleEdit
ModelFormSchema
,
showActionButtonGroup
:
false
,
showActionButtonGroup
:
false
,
disabled
:
props
.
disabled
,
actionColOptions
:
{
actionColOptions
:
{
span
:
23
,
span
:
23
,
},
},
// 确认按钮配置
submitButtonOptions
:
{
text
:
'提交新版本'
,
},
});
});
//初始化弹框
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
await
resetFields
();
await
resetFields
();
setModalProps
({
confirmLoading
:
false
});
setModalProps
({
confirmLoading
:
false
,
okText
:
props
.
disabled
?
'回滚'
:
props
.
isAdd
?
'确定'
:
'提交新版本'
,
});
isUpdate
.
value
=
!!
data
?.
isUpdate
;
isUpdate
.
value
=
!!
data
?.
isUpdate
;
if
(
unref
(
isUpdate
))
{
if
(
unref
(
isUpdate
))
{
// 获取行数据的id
// 获取行数据的id
...
@@ -204,6 +211,12 @@
...
@@ -204,6 +211,12 @@
/**确定按钮*/
/**确定按钮*/
async
function
handleSubmit
()
{
async
function
handleSubmit
()
{
await
validate
();
await
validate
();
openAddNewVersion
(
true
,
{
isUpdate
:
false
,
});
}
/**确定按钮*/
async
function
handleSubmitNewVersion
(
describe
)
{
closeModal
();
closeModal
();
}
}
</
script
>
</
script
>
src/views/dataQuality/dataSheet/rule/versionManage.vue
0 → 100644
View file @
30eb46f8
<
template
>
<BasicModal
width=
"40%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
>
<BasicForm
:labelWidth=
"100"
:schemas=
"versionFormSchema"
:showActionButtonGroup=
"false"
/>
<List>
<template
v-for=
"item in versionModelList"
:key=
"item.id"
>
<List
.
Item
>
<List
.
Item
.
Meta
>
<template
#
title
>
<div
style=
"display: flex"
>
<div
style=
"flex: 1"
>
<span>
{{
item
.
version
}}
</span>
<span
style=
"margin-left: 20px"
>
{{
item
.
time
}}
</span>
</div>
<div>
<a-button
@
click=
"handleRollback(item)"
><RollbackOutlined
/></a-button>
</div>
</div>
</
template
>
<
template
#
description
>
<div>
{{
item
.
created
}}
</div>
<div>
{{
item
.
describe
}}
</div>
</
template
>
</List
.Item.Meta
>
</List
.Item
>
</template>
</List>
<RuleEditModel
:disabled=
"true"
@
register=
"ruleEditModel"
/>
</BasicModal>
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
unref
}
from
'vue'
;
import
{
BasicForm
}
from
'@/components/Form'
;
import
{
BasicModal
,
useModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
List
}
from
'ant-design-vue'
;
import
{
RollbackOutlined
}
from
'@ant-design/icons-vue'
;
import
{
versionFormSchema
}
from
'./rule.data'
;
import
{
versionModelList
}
from
'./ruleData'
;
import
RuleEditModel
from
'./ruleEditModel.vue'
;
const
[
ruleEditModel
,
{
openModal
:
openRuleEditModel
}]
=
useModal
();
const
isUpdate
=
ref
(
true
);
const
rowId
=
ref
(
''
);
// const getTitle = computed(() => (isUpdate.value ? '质量规则详情' : '新建规则'));
const
getTitle
=
'版本管理'
;
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
setModalProps
({
confirmLoading
:
false
});
isUpdate
.
value
=
!!
data
?.
isUpdate
;
if
(
unref
(
isUpdate
))
{
// 获取行数据的id
rowId
.
value
=
data
.
record
.
businessId
;
}
});
function
handleRollback
(
record
)
{
openRuleEditModel
(
true
,
{
record
,
isUpdate
:
true
,
});
}
/**确定按钮*/
async
function
handleSubmit
()
{
closeModal
();
}
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment