Commit b637c494 authored by 曹泽华's avatar 曹泽华

数据治理

parent 71b59ac3
...@@ -39,7 +39,7 @@ export const tableList: any[] = [ ...@@ -39,7 +39,7 @@ export const tableList: any[] = [
flag: '--', flag: '--',
group: '共享工作组', group: '共享工作组',
}, },
] ];
export const treeDataList = [ export const treeDataList = [
{ {
...@@ -52,20 +52,61 @@ export const treeDataList = [ ...@@ -52,20 +52,61 @@ export const treeDataList = [
value: 2, value: 2,
icon: 'home|svg', icon: 'home|svg',
children: [ children: [
{ label: '企业', { label: '企业', value: 3, icon: 'home|svg', children: [{ label: '企业号', value: 4 }] },
],
},
],
},
];
export const treeObjectDataList = [
{
label: '数据库对象资源',
value: 1,
icon: 'home|svg',
children: [
{
label: 'admin_个人工作区',
value: 2,
icon: 'home|svg',
children: [
{
label: '数据源1',
value: 3, value: 3,
icon: 'home|svg', icon: 'home|svg',
children: [ children: [{ label: '数据库1', value: 4, children: [{ label: '数据表1', value: 5 }] }],
{ label: '企业号', },
value: 4, ],
}, },
], {
label: '共享工作区',
value: 6,
icon: 'home|svg',
children: [
{
label: '数据源2',
value: 7,
icon: 'home|svg',
children: [{ label: '数据库2', value: 8, children: [{ label: '数据表2', value: 9 }] }],
},
],
},
{
label: '高级工作区',
value: 10,
icon: 'home|svg',
children: [
{
label: '数据源3',
value: 11,
icon: 'home|svg',
children: [{ label: '数据库3', value: 12, children: [{ label: '数据表3', value: 13 }] }],
}, },
], ],
}, },
], ],
}, },
] ];
export const treeDataList2 = [ export const treeDataList2 = [
{ {
label: '域', label: '域',
...@@ -76,18 +117,11 @@ export const treeDataList2 = [ ...@@ -76,18 +117,11 @@ export const treeDataList2 = [
label: '共享工作区', label: '共享工作区',
value: 2, value: 2,
icon: 'home|svg', icon: 'home|svg',
children: [ children: [{ label: '日期类', value: 3, icon: 'home|svg', children: [] }],
{ label: '日期类',
value: 3,
icon: 'home|svg',
children: [
],
},
],
}, },
], ],
}, },
] ];
export const treeDataListPath = [ export const treeDataListPath = [
{ {
label: '主体管理', label: '主体管理',
...@@ -99,7 +133,7 @@ export const treeDataListPath = [ ...@@ -99,7 +133,7 @@ export const treeDataListPath = [
{ label: '指标工作区', businessId: 5 }, { label: '指标工作区', businessId: 5 },
], ],
}, },
] ];
export const treeDataListTwo = [ export const treeDataListTwo = [
{ {
label: '默认工作组', label: '默认工作组',
...@@ -111,7 +145,7 @@ export const treeDataListTwo = [ ...@@ -111,7 +145,7 @@ export const treeDataListTwo = [
{ label: '默认工作组04', businessId: 5 }, { label: '默认工作组04', businessId: 5 },
], ],
}, },
] ];
export const options = [ export const options = [
{ {
value: '标准数据', value: '标准数据',
...@@ -120,13 +154,10 @@ export const options = [ ...@@ -120,13 +154,10 @@ export const options = [
{ {
value: '引用文档元模型', value: '引用文档元模型',
label: '引用文档元模型', label: '引用文档元模型',
children: [ children: [],
],
}, },
], ],
}, },
]; ];
export const tableListTwo: any[] = [ export const tableListTwo: any[] = [
{ {
...@@ -134,4 +165,4 @@ export const tableListTwo: any[] = [ ...@@ -134,4 +165,4 @@ export const tableListTwo: any[] = [
name: '某领域办公办文格式撰写标准', name: '某领域办公办文格式撰写标准',
type: 'DOCX', type: 'DOCX',
}, },
] ];
<template> <template>
<BasicModal width="40%" v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit"> <BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" /> <BasicForm @register="registerForm" />
<Divider/> <Divider />
<BasicForm @register="registerFormTwo" /> <BasicForm @register="registerFormTwo" />
<div class="table-container"> <div class="table-container">
<div class="table-row"> <div class="table-row">
<div class="table-cell label"> <div class="table-cell label">
<div> <div>
<Icon icon="ant-design:database-outlined" :size="20" :color="'#42C465'" /> <Icon icon="ant-design:database-outlined" :size="20" :color="'#42C465'" />
<span>短编号</span> <span>短编号</span>
<div>域/共享工作区/短编号</div> <div>域/共享工作区/短编号</div>
</div> </div>
</div> </div>
<div class="table-cell value"> <div class="table-cell value">
<div> <div>
<Icon icon="ant-design:database-outlined" :size="20" :color="'#42C465'" /> <Icon icon="ant-design:database-outlined" :size="20" :color="'#42C465'" />
<span>短编号</span> <span>短编号</span>
<div>域/共享工作区/短编号</div> <div>域/共享工作区/短编号</div>
</div> </div>
...@@ -26,127 +32,116 @@ ...@@ -26,127 +32,116 @@
</div> </div>
<div class="table-row"> <div class="table-row">
<div class="table-cell label"> <div class="table-cell label">
<step-header title="属性"/> <step-header title="属性" />
<Row> <Row>
<Col :span="6"> <Col :span="6"> 域名称 </Col>
域名称 <Col :span="18"> 短编号 </Col>
</Col>
<Col :span="18">
短编号
</Col>
</Row> </Row>
</div> </div>
<div class="table-cell value"> <div class="table-cell value">
<step-header title="属性"/> <step-header title="属性" />
<Row> <Row>
<Col :span="6"> <Col :span="6"> 域名称 </Col>
域名称 <Col :span="18"> 短编号 </Col>
</Col>
<Col :span="18">
短编号
</Col>
</Row> </Row>
</div> </div>
</div> </div>
</div> </div>
<template #footer> <template #footer>
<a-button @click="handleCancel"> 取消</a-button> <a-button @click="handleCancel"> 取消</a-button>
<a-button type="primary" @click="handleSubmitApplication"> 提交申请</a-button> <a-button type="primary" @click="handleSubmitApplication"> 提交申请</a-button>
</template> </template>
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import Icon from '@/components/Icon/Icon.vue'; import Icon from '@/components/Icon/Icon.vue';
import {ref, computed, unref, reactive} from 'vue'; import { ref, computed, unref, reactive } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal'; import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form'; import { BasicForm, useForm } from '@/components/Form';
import {formSchemaPublish, formSchemaPublishTwo} from './referenceDocument.data'; import { formSchemaPublish, formSchemaPublishTwo } from './referenceDocument.data';
import { Divider,Form,Col, Row, } from 'ant-design-vue'; import { Divider, Form, Col, Row } from 'ant-design-vue';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
defineOptions({ name: 'AccountModal' }); import stepHeader from '../../../components/stepHeader.vue';
import stepHeader from '../../../components/stepHeader.vue' import StepHeader from '@/components/stepHeader.vue';
import StepHeader from "@/components/stepHeader.vue";
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: formSchemaPublish,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
const [registerFormTwo] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: formSchemaPublishTwo,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields(); defineOptions({ name: 'AccountModal' });
setModalProps({ confirmLoading: false,showOkBtn:false,showCancelBtn:false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
}
updateSchema({
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: formSchemaPublish,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
const [registerFormTwo] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: formSchemaPublishTwo,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false, showOkBtn: false, showCancelBtn: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
}
updateSchema({});
}); });
});
const getTitle = computed(() => ('发布申请')); const getTitle = computed(() => '发布申请');
function handleCancel() { function handleCancel() {
closeModal(); closeModal();
} }
function handleSubmitApplication() { function handleSubmitApplication() {
closeModal(); closeModal();
createMessage.success('发布成功!'); createMessage.success('发布成功!');
} }
async function handleSubmit() { async function handleSubmit() {
try { try {
const values = await validate(); const values = await validate();
setModalProps({ confirmLoading: true }); setModalProps({ confirmLoading: true });
// TODO custom api // TODO custom api
closeModal(); closeModal();
emit('success', { isUpdate: unref(isUpdate), values: { ...values, id: rowId.value } }); emit('success', { isUpdate: unref(isUpdate), values: { ...values, id: rowId.value } });
} finally { } finally {
setModalProps({ confirmLoading: false }); setModalProps({ confirmLoading: false });
}
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.info_title{ .info_title {
font-size: 15px; font-size: 15px;
font-weight: bold; font-weight: bold;
} }
.table-container { .table-container {
display: grid; display: grid;
grid-template-columns: 2fr 2fr; /* Define two columns with 1:2 ratio */ grid-template-columns: 2fr 2fr; /* Define two columns with 1:2 ratio */
gap: 0; /* Space between cells, to create border effect */ gap: 0; /* Space between cells, to create border effect */
border: 1px solid #ddd; /* Border around the entire table */ border: 1px solid #ddd; /* Border around the entire table */
max-width: 600px; max-width: 600px;
margin: 10px 10px 0; margin: 10px 10px 0;
.table-row { .table-row {
display: contents; display: contents;
.table-cell { .table-cell {
padding: 3%; padding: 3%;
border: 1px solid #ddd; border: 1px solid #ddd;
}
} }
} }
}
</style> </style>
...@@ -123,15 +123,11 @@ export const formSchema: FormSchema[] = [ ...@@ -123,15 +123,11 @@ export const formSchema: FormSchema[] = [
{ {
field: 'modal', field: 'modal',
component: 'Cascader', component: 'Cascader',
label: '关联元模型', label: '路径',
required: true,
componentProps: { componentProps: {
// dataField: 'data', // dataField: 'data',
fieldNames: { labelField: 'label',
title: 'modelName', valueField: 'value',
key: 'businessId',
},
treeData: TreeData,
initFetchParams: { initFetchParams: {
parentCode: '', parentCode: '',
}, },
......
...@@ -11,7 +11,8 @@ import { BasicForm, useForm } from '@/components/Form'; ...@@ -11,7 +11,8 @@ import { BasicForm, useForm } from '@/components/Form';
import { formSchema } from './referenceDocument.data'; import { formSchema } from './referenceDocument.data';
import TreeTwo from './treeTwo.vue' import TreeTwo from './treeTwo.vue'
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import {treeDataList,options} from "./mock"; import {treeDataList, options, treeObjectDataList} from "./mock";
import {TreeData} from "@/views/metadata/metadataData";
defineOptions({ name: 'AccountModal' }); defineOptions({ name: 'AccountModal' });
const emit = defineEmits(['success', 'register']); const emit = defineEmits(['success', 'register']);
...@@ -49,7 +50,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data ...@@ -49,7 +50,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
}, },
{ {
field: 'modal', field: 'modal',
componentProps: { options:options }, componentProps: { options:treeObjectDataList },
}, },
] ]
......
...@@ -218,7 +218,7 @@ export const applySchemas: FormSchema[] = [ ...@@ -218,7 +218,7 @@ export const applySchemas: FormSchema[] = [
}, },
{ {
field: 'name', field: 'name',
label: '资源名称', label: '申请标题',
component: 'Input', component: 'Input',
defaultValue: '申请发布<日期类>等2个域', defaultValue: '申请发布<日期类>等2个域',
componentProps: {}, componentProps: {},
......
<template>
<BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<div class="flex">
<div class="w-[120px]"> 是否重置同步点: </div>
<RadioGroup
v-model:value="radioValue"
:options="[
{ label: '否', value: '2' },
{ label: '是', value: '1' },
]"
/>
</div>
<div v-show="radioValue === '1'">
<Alert
style="margin-top: 20px"
type="info"
message="若指定的位点信息和目前数据库最新的位点中若存在DDL变更,数据解析可能失效"
/>
<RadioGroup style="margin: 20px 120px" v-model:value="value1" :options="valueList" />
<BasicForm v-show="value1 === '1'" @register="registerForm1" />
<div v-show="value1 === '2'" style="display: flex; margin-top: 20px">
<div style="margin: 0 20px">同步点</div>
<Select style="margin-left: 40px" v-model:value="value2" :options="value2List" />
</div>
</div>
<template #insertFooter>
<a-button @click="handleCancel">取消</a-button>
<a-button @click="handleReset">强制重启</a-button>
</template>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, reactive } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { Alert, RadioGroup, Select } from 'ant-design-vue';
import { BasicForm, useForm } from '@/components/Form';
import { resetNameFormSchema, resetNameFormSchema1 } from './maintenance.data';
import { useMessage } from '@/hooks/web/useMessage';
defineOptions({ name: 'AccountModal' });
const value1 = ref('1');
const value2 = ref('1');
const valueList = [
{
label: '指定日志文件',
value: '1',
},
{
label: '指定同步点',
value: '2',
},
];
const value2List = [
{
label: '2023-12-28 18:40:00',
value: '1',
},
{
label: '2023-12-30 12:40:00',
value: '2',
},
];
const radioValue = ref();
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const getTitle = '启动';
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
const form = ref();
//初始化表单
const [registerForm, { setFieldsValue, getFieldsValue, updateSchema, resetFields, validate }] =
useForm({
labelWidth: 120,
baseColProps: { lg: 12, md: 24 },
schemas: resetNameFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
const [
registerForm1,
{
setFieldsValue: setFieldsValue1,
updateSchema: updateSchema1,
resetFields: resetFields1,
validate: validate1,
},
] = useForm({
labelWidth: 120,
baseColProps: { lg: 24, md: 24 },
schemas: resetNameFormSchema1,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({
confirmLoading: false,
showCancelBtn: false,
});
setFieldsValue({
...data.record,
});
});
/**提交按钮*/
function handleSubmit() {
createMessage.success('启动成功!');
closeModal();
}
function handleCancel() {
closeModal();
}
function handleReset() {
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