Commit f0a2f5bd authored by chenjiahao's avatar chenjiahao

数据质量-主体类-质量主体-存储管理

parent 5f380c7f
......@@ -34,7 +34,7 @@ export const columns: BasicColumn[] = [
dataIndex: 'originalPrincipal',
slots: { customRender: 'originalPrincipal' },
width: 150,
}
},
];
export const searchFormSchema: FormSchema[] = [
{
......@@ -104,6 +104,104 @@ export const MoveFormSchema: any[] = [
},
];
/**存储管理*/
export const StorageSchema: FormSchema[] = [
{
field: 'isStorage',
label: '存储主体问题数据明细',
component: 'Checkbox',
colProps: { lg: 12, md: 24 },
componentProps: ({ formModel, formActionType }) => ({
onChange: () => {
formActionType.updateSchema([{ field: 'isStorageInHDFS', ifShow: formModel.isStorage }]);
formActionType.updateSchema([{ field: 'handle', ifShow: formModel.isStorage }]);
formActionType.updateSchema([{ field: 'isAutoClear', ifShow: formModel.isStorage }]);
formActionType.updateSchema([{ field: 'clear', ifShow: formModel.isStorage }]);
formActionType.updateSchema([{ field: 'divider', ifShow: formModel.isStorage }]);
},
}),
},
{
field: 'isStorageInHDFS',
label: '存储到HDFS',
labelWidth: 85,
component: 'Checkbox',
colProps: { lg: 12, md: 24 },
ifShow: false,
},
{
field: 'handle',
label: '手动清理',
component: 'BasicTitle',
ifShow: false,
colProps: { lg: 24, md: 24 },
},
{
field: 'clear',
label: '清理',
component: 'Input',
labelWidth: 30,
colProps: { lg: 24, md: 24 },
ifShow: false,
slot: 'clear',
},
{
field: 'divider',
component: 'Divider',
ifShow: false,
colProps: { lg: 24, md: 24 },
},
{
field: 'isAutoClear',
label: '自动清理',
labelWidth: 70,
component: 'Checkbox',
colProps: { lg: 12, md: 24 },
ifShow: false,
componentProps: ({ formModel, formActionType }) => ({
onChange: () => {
formActionType.updateSchema([{ field: 'maxRetentionTime', ifShow: formModel.isAutoClear }]);
formActionType.updateSchema([{ field: 'inspectionCycle', ifShow: formModel.isAutoClear }]);
formActionType.updateSchema([{ field: 'inspectionTime', ifShow: formModel.isAutoClear }]);
},
}),
},
{
field: 'maxRetentionTime',
label: '最长保留时间',
component: 'Input',
colProps: { lg: 24, md: 24 },
componentProps: {
addonAfter: '天',
},
ifShow: false,
},
{
field: 'inspectionCycle',
label: '检查周期',
component: 'Select',
colProps: { lg: 24, md: 24 },
componentProps: {
options: [
{ label: '每天', value: '每天' },
{ label: '每周', value: '每周' },
{ label: '每月', value: '每月' },
{ label: '每年', value: '每年' },
],
},
ifShow: false,
},
{
field: 'inspectionTime',
label: '检查时间',
component: 'Input',
colProps: { lg: 24, md: 24 },
ifShow: false,
slot: 'isStorageInHDFS',
},
];
export const resetNameFormSchema: FormSchema[] = [
{
field: 'fileName',
......@@ -197,4 +295,3 @@ export const createTaskFormSchema: FormSchema[] = [
colProps: { lg: 24, md: 24 },
},
];
......@@ -123,6 +123,10 @@ export const TreeData: any[] = [
dimensionCodeColumn: 'code',
questionTablePrefix: 'quailty_',
dimensionMeaningColumn: 'code',
sql:
'SELECT COUNT(*)\n' +
'FROM $(table a}\n' +
'WHERE ${column a}IS NOT NULL AND ${column a}NOT IN (${range a})',
isIndependent: true,
},
{
......@@ -157,6 +161,10 @@ export const TreeData: any[] = [
holder: 'admin',
createDate: '2024-10-23 12:04:04',
updateDate: '2024-10-23 12:04:04',
originalPrincipal: '贫困毕业生',
dimensionCodeColumn: 'code',
questionTablePrefix: 'quailty_',
dimensionMeaningColumn: 'code',
icon: 'ant-design:partition-outlined',
},
{
......@@ -174,181 +182,13 @@ export const TreeData: any[] = [
holder: 'admin',
createDate: '2024-10-23 12:04:04',
updateDate: '2024-10-23 12:04:04',
originalPrincipal: '贫困毕业生',
dimensionCodeColumn: 'code',
questionTablePrefix: 'quailty_',
dimensionMeaningColumn: 'code',
icon: 'ant-design:partition-outlined',
},
];
export const DetailTreeData: any[] = [
{
delFlag: '0',
flag: '1',
businessId: 100,
fileName: '任务',
parentId: 0,
'code:': '001',
ancestors: '0',
orderNum: 0,
// "children" : [ ],
selectType: null,
fileSize: '1024KB',
location: '位置1',
holder: 'admin',
createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04',
},
{
delFlag: '0',
flag: '1',
businessId: 101,
fileName: '代码文件',
parentId: 100,
'code:': '002',
ancestors: '0,100',
orderNum: 1,
// "children" : [ ],
selectType: null,
fileSize: '1024KB',
location: '位置1',
holder: 'admin',
createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04',
},
{
delFlag: '0',
flag: '1',
businessId: 102,
fileName: '数据处理',
parentId: 100,
'code:': '003',
ancestors: '0,100',
orderNum: 2,
// "children" : [ ],
selectType: null,
fileSize: '1024KB',
location: '位置1',
holder: 'admin',
createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04',
},
{
delFlag: '0',
flag: '1',
businessId: 103,
fileName: '任务流',
parentId: 100,
'code:': '003',
ancestors: '0,100',
orderNum: 2,
// "children" : [ ],
selectType: null,
fileSize: '1024KB',
location: '位置1',
holder: 'admin',
createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04',
},
{
delFlag: '0',
flag: '1',
businessId: 401,
fileName: '脚本',
parentId: 101,
'code:': '002',
ancestors: '0,100,101',
orderNum: 1,
// "children" : [ ],
selectType: null,
fileSize: '1024KB',
location: '位置1',
holder: 'admin',
createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04',
},
{
delFlag: '0',
flag: '1',
businessId: 402,
fileName: 'SQL',
parentId: 101,
'code:': '002',
ancestors: '0,100,101',
orderNum: 1,
// "children" : [ ],
selectType: null,
fileSize: '1024KB',
location: '位置1',
holder: 'admin',
createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04',
},
{
delFlag: '0',
flag: '1',
businessId: 403,
fileName: '数据加载',
parentId: 102,
'code:': '002',
ancestors: '0,100,102',
orderNum: 1,
// "children" : [ ],
selectType: null,
fileSize: '1024KB',
location: '位置1',
holder: 'admin',
createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04',
},
{
delFlag: '0',
flag: '1',
businessId: 404,
fileName: '数据同步',
parentId: 102,
'code:': '002',
ancestors: '0,100,102',
orderNum: 1,
// "children" : [ ],
selectType: null,
fileSize: '1024KB',
location: '位置1',
holder: 'admin',
createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04',
},
{
delFlag: '0',
flag: '1',
businessId: 405,
fileName: '数据质量',
parentId: 102,
'code:': '002',
ancestors: '0,100,102',
orderNum: 1,
// "children" : [ ],
selectType: null,
fileSize: '1024KB',
location: '位置1',
holder: 'admin',
createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04',
},
{
delFlag: '0',
flag: '1',
businessId: 406,
fileName: '嵌套任务流',
parentId: 103,
'code:': '002',
ancestors: '0,100,103',
orderNum: 1,
// "children" : [ ],
selectType: null,
fileSize: '1024KB',
location: '位置1',
holder: 'admin',
createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04',
},
];
export const fileData: any[] = [
{
delFlag: '0',
......@@ -412,68 +252,6 @@ export const fileData: any[] = [
},
];
export const addUserData: any[] = [
{
delFlag: '0',
flag: '1',
businessId: 400,
username: 'tianjia1',
nickName: '添加用户1',
userType: '1',
name: '添加用户1',
roleName: '工作区访客',
createDate: '2024-10-24 10:04:04',
institutionId: null,
institutionName: '',
code: '123f',
identity: '1',
roleIds: null,
roleNames: '三级用户',
roleList: null,
menuList: [],
},
{
delFlag: '0',
flag: '1',
businessId: 402,
username: 'tianjia2',
nickName: '添加用户2',
userType: '1',
name: '添加用户2',
roleName: '工作区访客',
createDate: '2024-10-25 10:05:05',
sex: '0',
institutionId: null,
institutionName: '',
code: '123a',
identity: '1',
roleIds: null,
roleNames: null,
roleList: null,
menuList: [],
},
{
delFlag: '0',
flag: '1',
businessId: 403,
username: 'tianjia3',
nickName: '添加用户3',
userType: '1',
name: '添加用户3',
roleName: '工作区访客',
createDate: '2024-10-26 10:06:06',
sex: '1',
institutionId: null,
institutionName: '',
code: '123c',
identity: '1',
roleIds: null,
roleNames: '超级管理员',
roleList: null,
menuList: [],
},
];
export const infoData: any[] = [
{
tableName: 'st',
......
......@@ -51,6 +51,7 @@
<CreateFile @register="registerCreateFileModal" @success="handleAddSuccess" />
<CreateMainBodyModal @register="registerCreateCreateMainBodyModal" @success="handleSuccess" />
<MainBodyEdit @register="registerMainBodyEditModal" />
<StorageManageModal @register="registerStorageManageModal" />
</PageWrapper>
</template>
<script lang="ts" setup>
......@@ -78,6 +79,7 @@
import { router } from '@/router';
import CreateMainBodyModal from '@/views/dataQuality/agentClass/mainBody/createMainBodyModal.vue';
import MainBodyEdit from '@/views/dataQuality/agentClass/mainBody/mainBodyEdit.vue';
import StorageManageModal from '@/views/dataQuality/agentClass/mainBody/storageManageModal.vue';
defineOptions({ name: 'AccountManagement' });
const { createMessage, createConfirm } = useMessage();
......@@ -90,6 +92,7 @@
useModal(); // 新建质量主体弹窗
const [registerCreateFileModal, { openModal: openCreateFileModal }] = useModal(); // 新建文件夹弹窗
const [registerMainBodyEditModal, { openModal: openMainBodyEditModal }] = useModal(); // 质量主体编辑
const [registerStorageManageModal, { openModal: openStorageManageModal }] = useModal(); // 存储管理弹窗
const searchInfo = reactive<Recordable>({});
const tableData = ref([]);
const [
......@@ -243,6 +246,12 @@
});
}
function handleSaveManage(record: Recordable) {
openStorageManageModal(true, {
record,
});
}
/** 删除按钮*/
function handleDelete(record: Recordable) {
tableData.value.splice(
......
......@@ -5,7 +5,6 @@
@register="registerModal"
:title="title"
:showOkBtn="false"
v-model:visible="showModal"
@cancel="handleCancel"
>
<div class="mianBodyEditContainer">
......@@ -39,8 +38,14 @@
<div class="editor">
<textarea v-model="sql" placeholder="请输入内容..."></textarea>
</div>
<a-button @click="handleRun">测试运行</a-button>
<div v-if="isRun"> <BasicTable @register="registerColumnInformationTable" /></div>
<a-button type="primary" @click="handleRun">测试运行</a-button>
<div v-if="isRun">
<strong>检测结果</strong>
<p>️✅包含主键</p>
<p>✅包含维度</p>
<p>✅运行结果</p>
<BasicTable @register="registerReviewTable" />
</div>
</div>
</div>
</a-tab-pane>
......@@ -67,6 +72,7 @@
</Tabs>
</div>
</BasicModal>
<StorageManageModal @register="registerStorageManageModal" />
</template>
<script setup lang="ts">
import { BasicColumn, BasicTable, useTable } from '@/components/Table';
......@@ -78,6 +84,7 @@
import { useMessage } from '@/hooks/web/useMessage';
import { informationData, tbData } from '@/views/metadata/metadataData';
import { informationColumns, tbSearchFormSchema } from '@/views/metadata/data';
import StorageManageModal from '@/views/dataQuality/agentClass/mainBody/storageManageModal.vue';
import {
infoData,
reviewData,
......@@ -240,7 +247,7 @@
},
},
{
field: 'questionTablePrefix ',
field: 'questionTablePrefix',
label: '问题数据表名前缀',
required: true,
colProps: { lg: 12, md: 12 },
......@@ -288,18 +295,17 @@
span: 23,
},
});
const [registerModal, { closeModal }] = useModalInner(async (data) => {
const [registerModal, { closeModal }] = useModalInner((data) => {
resetFields();
title.value = data.record.fileName;
isIndependent.value = data.record.isIndependent;
// console.log('isIndependent.value', isIndependent.value);
let record = data.record;
await resetFields();
await setFieldsValue({
...record,
sql.value = data.record.sql;
setFieldsValue({
...data.record,
});
changeAble.value = true;
const treeList = handleTree(TreeData, 'businessId', undefined, undefined, undefined);
await updateSchema([
updateSchema([
{
field: 'originalPrincipal',
componentProps: {
......@@ -315,7 +321,6 @@
}
function handleRun() {
changeAble.value = false;
isRun.value = true;
}
......@@ -354,6 +359,13 @@
});
return treeData !== '' ? treeData : data;
}
const [registerStorageManageModal, { openModal: openStorageManageModal }] = useModal(); // 存储管理弹窗
function handleStorage(record: Recordable) {
openStorageManageModal(true, {
record,
});
}
</script>
<style scoped lang="scss">
.editor {
......
<template>
<BasicModal
v-bind="$attrs"
@register="registerModal"
title="存储管理"
@ok="handleSubmit"
minHeight="50"
>
<BasicForm @register="registerForm">
<template #clear="{ model, field }">
<DatePicker style="width: 55%" />之前所有的执行记录
<a-button v-model="model.clear" @click="handleClear" style="margin-left: 5px" type="error"
>清理</a-button
>
</template>
<template #isStorageInHDFS="{ model, field }">
<a-input style="width: 60px; margin-right: 5px" /><a-input
style="width: 60px; margin-right: 5px"
/>
</template>
</BasicForm>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, reactive } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { StorageSchema } from './account.data';
import { useMessage } from '@/hooks/web/useMessage';
import { DatePicker } from 'ant-design-vue';
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 160,
labelAlign: 'left',
baseColProps: { span: 24 },
schemas: StorageSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
});
/**确定按钮*/
function handleSubmit() {
createMessage.success('保存成功!');
closeModal();
}
/**确定按钮*/
function handleClear() {
createMessage.success('清理成功!');
closeModal();
}
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment