Commit 2e74697b authored by LiXuyang's avatar LiXuyang

Merge remote-tracking branch 'origin/master'

parents 3b562f9e bbbb3ada
...@@ -206,7 +206,8 @@ export const DataWarehousePlanningRoute: AppRouteRecordRaw = { ...@@ -206,7 +206,8 @@ export const DataWarehousePlanningRoute: AppRouteRecordRaw = {
{ {
path: 'logicalModel/ERchart', path: 'logicalModel/ERchart',
name: 'logicalChartModel', name: 'logicalChartModel',
component: () => import('@/views/dataWarehousePlanning/logicalModel/modelDetail/ERchart/index.vue'), component: () =>
import('@/views/dataWarehousePlanning/logicalModel/modelDetail/ERchart/index.vue'),
meta: { meta: {
title: '实体关系图', title: '实体关系图',
icon: '', icon: '',
...@@ -245,6 +246,18 @@ export const DataWarehousephysicalModelRoute: AppRouteRecordRaw = { ...@@ -245,6 +246,18 @@ export const DataWarehousephysicalModelRoute: AppRouteRecordRaw = {
icon: '', icon: '',
}, },
}, },
{
path: 'physicalModel/relate',
name: 'relateImage',
component: () =>
import(
'@/views/dataWarehousePlanning/physicalModel/modelDetail/modelRelationship/relateImage.vue'
),
meta: {
title: '模型关系',
icon: '',
},
},
], ],
}; };
...@@ -377,7 +390,8 @@ export const DataStandardRoute: AppRouteRecordRaw = { ...@@ -377,7 +390,8 @@ export const DataStandardRoute: AppRouteRecordRaw = {
{ {
path: 'IndicatorStandards/basicStandardsContrast', path: 'IndicatorStandards/basicStandardsContrast',
name: 'basicStandardsContrast1', name: 'basicStandardsContrast1',
component: () => import('@/views/dataStandards/IndicatorStandards/indicatorStandardsContrast.vue'), component: () =>
import('@/views/dataStandards/IndicatorStandards/indicatorStandardsContrast.vue'),
meta: { meta: {
title: '指标标准对比', title: '指标标准对比',
icon: '', icon: '',
...@@ -431,7 +445,6 @@ export const DataStandardRoute: AppRouteRecordRaw = { ...@@ -431,7 +445,6 @@ export const DataStandardRoute: AppRouteRecordRaw = {
], ],
}; };
export const WorkSpaceRoute: AppRouteRecordRaw = { export const WorkSpaceRoute: AppRouteRecordRaw = {
path: '/workspace', path: '/workspace',
name: 'Workspace', name: 'Workspace',
......
...@@ -9,11 +9,21 @@ type CheckedType = boolean | string | number; ...@@ -9,11 +9,21 @@ type CheckedType = boolean | string | number;
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '名称', title: '质量主体名称',
dataIndex: 'fileName', dataIndex: 'fileName',
width: 150, width: 150,
slots: { customRender: 'fileName' }, slots: { customRender: 'fileName' },
}, },
{
title: '描述',
dataIndex: 'descripe',
width: 150,
},
{
title: '创建者',
dataIndex: 'holder',
width: 150,
},
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'createDate', dataIndex: 'createDate',
...@@ -24,11 +34,6 @@ export const columns: BasicColumn[] = [ ...@@ -24,11 +34,6 @@ export const columns: BasicColumn[] = [
dataIndex: 'updateDate', dataIndex: 'updateDate',
width: 150, width: 150,
}, },
{
title: '拥有者',
dataIndex: 'holder',
width: 150,
},
{ {
title: '原始主体', title: '原始主体',
dataIndex: 'originalPrincipal', dataIndex: 'originalPrincipal',
......
<template>
<BasicModal
v-bind="$attrs"
width="50%"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
minHeight="50"
>
<BasicTable @register="registerAssociationRulesTable" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed } from 'vue';
import { BasicTable, FormSchema, useTable } from '@/components/Table';
import { BasicModal, useModalInner } from '@/components/Modal';
import { associationRulesData } from '@/views/dataQuality/agentClass/mainBody/dataQualityMainBodyData';
defineOptions({ name: 'AccountModal' });
const associationData = ref(associationRulesData);
const associationRulesColumns: { dataIndex: string; width: number; title: string }[] = [
{
title: '规则名称',
dataIndex: 'ruleName',
width: 120,
},
{
title: '质量模板',
dataIndex: 'template',
width: 120,
},
{
title: '关联字段',
dataIndex: 'keyField',
width: 120,
// edit: true,
},
{
title: '规则描述',
dataIndex: 'described',
width: 120,
},
];
const associationSearchFormSchema: FormSchema[] = [
{
field: 'ruleName',
label: '',
componentProps: {
placeholder: '搜索字段',
},
component: 'Input',
colProps: { span: 5 },
},
];
const [registerAssociationRulesTable] = useTable({
api: async () => {
const response = {
pageNum: '1',
pageSize: '10',
pages: '1',
total: associationData.value.length,
code: '',
message: '',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
var data = [];
data = associationData.value.filter((item) => item.parentId !== 0);
return { ...response, data: data };
},
// dataSource: infoData,
columns: associationRulesColumns,
useSearchForm: true,
pagination: false,
formConfig: {
labelWidth: 120,
schemas: associationSearchFormSchema,
autoSubmitOnEnter: true,
},
showIndexColumn: false,
scroll: { y: 400 },
handleSearchInfoFn(info) {
associationData.value = associationRulesData.filter((item) =>
item.ruleName.includes(info.ruleName),
);
// console.log('info', info);
// console.log('tableData', tableData.value);
return info;
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async () => {
setModalProps({ confirmLoading: false });
});
const getTitle = computed(() => '查看关联质量规则');
async function handleSubmit() {
closeModal();
}
</script>
...@@ -383,6 +383,33 @@ export const infoData: any[] = [ ...@@ -383,6 +383,33 @@ export const infoData: any[] = [
}, },
]; ];
export const associationRulesData: any[] = [
{
ruleName: '最低成绩',
template: '学生成绩校验',
keyField: 'score',
described: '最低成绩不能低于60',
},
{
ruleName: '青少年',
template: '年龄限制',
keyField: 'age',
described: '年龄小于18',
},
{
ruleName: '规则1',
template: '质量模板1',
keyField: 'cloums1',
described: '规则描述1',
},
{
ruleName: '规则2',
template: '质量模板2',
keyField: 'cloums2',
described: '规则描述2',
},
];
export const reviewData: any[] = [ export const reviewData: any[] = [
{ {
age: 23, age: 23,
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
label: '复制', label: '复制',
onClick: copyButton.bind(null, record), onClick: copyButton.bind(null, record),
}, },
{
label: '关联',
onClick: handleOpenAssociationModal.bind(null, record),
},
{ {
label: '属性', label: '属性',
onClick: handleEdit.bind(null, record), onClick: handleEdit.bind(null, record),
...@@ -52,6 +56,7 @@ ...@@ -52,6 +56,7 @@
<CreateMainBodyModal @register="registerCreateCreateMainBodyModal" @success="handleSuccess" /> <CreateMainBodyModal @register="registerCreateCreateMainBodyModal" @success="handleSuccess" />
<MainBodyEdit @register="registerMainBodyEditModal" /> <MainBodyEdit @register="registerMainBodyEditModal" />
<StorageManageModal @register="registerStorageManageModal" /> <StorageManageModal @register="registerStorageManageModal" />
<AssociationRulesModal @register="registerAssociationModal" />
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -80,6 +85,7 @@ ...@@ -80,6 +85,7 @@
import CreateMainBodyModal from '@/views/dataQuality/agentClass/mainBody/createMainBodyModal.vue'; import CreateMainBodyModal from '@/views/dataQuality/agentClass/mainBody/createMainBodyModal.vue';
import MainBodyEdit from '@/views/dataQuality/agentClass/mainBody/mainBodyEdit.vue'; import MainBodyEdit from '@/views/dataQuality/agentClass/mainBody/mainBodyEdit.vue';
import StorageManageModal from '@/views/dataQuality/agentClass/mainBody/storageManageModal.vue'; import StorageManageModal from '@/views/dataQuality/agentClass/mainBody/storageManageModal.vue';
import AssociationRulesModal from '@/views/dataQuality/agentClass/mainBody/associationRulesModal.vue';
defineOptions({ name: 'AccountManagement' }); defineOptions({ name: 'AccountManagement' });
const { createMessage, createConfirm } = useMessage(); const { createMessage, createConfirm } = useMessage();
...@@ -93,6 +99,7 @@ ...@@ -93,6 +99,7 @@
const [registerCreateFileModal, { openModal: openCreateFileModal }] = useModal(); // 新建文件夹弹窗 const [registerCreateFileModal, { openModal: openCreateFileModal }] = useModal(); // 新建文件夹弹窗
const [registerMainBodyEditModal, { openModal: openMainBodyEditModal }] = useModal(); // 质量主体编辑 const [registerMainBodyEditModal, { openModal: openMainBodyEditModal }] = useModal(); // 质量主体编辑
const [registerStorageManageModal, { openModal: openStorageManageModal }] = useModal(); // 存储管理弹窗 const [registerStorageManageModal, { openModal: openStorageManageModal }] = useModal(); // 存储管理弹窗
const [registerAssociationModal, { openModal: OpenAssociationModal }] = useModal(); // 关联规则弹窗
const searchInfo = reactive<Recordable>({}); const searchInfo = reactive<Recordable>({});
const tableData = ref([]); const tableData = ref([]);
const [ const [
...@@ -252,6 +259,12 @@ ...@@ -252,6 +259,12 @@
}); });
} }
function handleOpenAssociationModal(record: Recordable) {
OpenAssociationModal(true, {
record,
});
}
/** 删除按钮*/ /** 删除按钮*/
function handleDelete(record: Recordable) { function handleDelete(record: Recordable) {
tableData.value.splice( tableData.value.splice(
......
...@@ -67,7 +67,9 @@ ...@@ -67,7 +67,9 @@
</div> </div>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="4" tab="关联规则"> <a-tab-pane key="4" tab="关联规则">
<div v-if="page === '4'"> </div> <div v-if="page === '4'">
<BasicTable @register="registerAssociationRulesTable" />
</div>
</a-tab-pane> </a-tab-pane>
</Tabs> </Tabs>
</div> </div>
...@@ -89,11 +91,13 @@ ...@@ -89,11 +91,13 @@
infoData, infoData,
reviewData, reviewData,
TreeData, TreeData,
associationRulesData,
} from '@/views/dataQuality/agentClass/mainBody/dataQualityMainBodyData'; } from '@/views/dataQuality/agentClass/mainBody/dataQualityMainBodyData';
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const page = ref('1'); const page = ref('1');
const tableData = ref(infoData); const tableData = ref(infoData);
const associationData = ref(associationRulesData);
const title = ref(''); const title = ref('');
const sql = ref(''); const sql = ref('');
let changeAble = ref(false); let changeAble = ref(false);
...@@ -314,6 +318,76 @@ ...@@ -314,6 +318,76 @@
}, },
]); ]);
}); });
const associationRulesColumns: { dataIndex: string; width: number; title: string }[] = [
{
title: '规则名称',
dataIndex: 'ruleName',
width: 120,
},
{
title: '质量模板',
dataIndex: 'template',
width: 120,
},
{
title: '关联字段',
dataIndex: 'keyField',
width: 120,
// edit: true,
},
{
title: '规则描述',
dataIndex: 'described',
width: 120,
},
];
const associationSearchFormSchema: FormSchema[] = [
{
field: 'ruleName',
label: '',
componentProps: {
placeholder: '搜索字段',
},
component: 'Input',
colProps: { span: 5 },
},
];
const [registerAssociationRulesTable] = useTable({
api: async () => {
const response = {
pageNum: '1',
pageSize: '10',
pages: '1',
total: associationData.value.length,
code: '',
message: '',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
var data = [];
data = associationData.value.filter((item) => item.parentId !== 0);
return { ...response, data: data };
},
// dataSource: infoData,
columns: associationRulesColumns,
useSearchForm: true,
pagination: false,
formConfig: {
labelWidth: 120,
schemas: associationSearchFormSchema,
autoSubmitOnEnter: true,
},
showIndexColumn: false,
scroll: { y: 400 },
handleSearchInfoFn(info) {
associationData.value = associationRulesData.filter((item) =>
item.ruleName.includes(info.ruleName),
);
// console.log('info', info);
// console.log('tableData', tableData.value);
return info;
},
});
function handleCancel() { function handleCancel() {
changeAble.value = false; changeAble.value = false;
......
...@@ -15,13 +15,6 @@ ...@@ -15,13 +15,6 @@
@click="handleMoreCreate" @click="handleMoreCreate"
>批量建表</a-button >批量建表</a-button
> >
<a-button
type="primary"
:disabled="getRowSelection().selectedRowKeys <= 0"
@click="handleWaitUpload"
>设为待发布</a-button
>
<a-button type="primary" :disabled="getRowSelection().selectedRowKeys <= 0">发布</a-button>
<a-button type="primary" @click="handleBaseImport">从元数据导入</a-button> <a-button type="primary" @click="handleBaseImport">从元数据导入</a-button>
<a-button type="primary" :disabled="getRowSelection().selectedRowKeys <= 0">导出</a-button> <a-button type="primary" :disabled="getRowSelection().selectedRowKeys <= 0">导出</a-button>
<a-button type="primary" @click="handleImport">导入</a-button> <a-button type="primary" @click="handleImport">导入</a-button>
......
...@@ -3,15 +3,22 @@ ...@@ -3,15 +3,22 @@
<template #extra> <template #extra>
<a-button type="primary" v-if="!editFlag" @click="handleCreateTable">自动建表</a-button> <a-button type="primary" v-if="!editFlag" @click="handleCreateTable">自动建表</a-button>
<a-button type="primary" v-if="!editFlag" @click="handleVersion">版本管理</a-button> <a-button type="primary" v-if="!editFlag" @click="handleVersion">版本管理</a-button>
<a-button type="primary" @click="handleRelate">模型关系</a-button>
<a-button type="primary" v-if="!editFlag" @click="handleExport">导出</a-button> <a-button type="primary" v-if="!editFlag" @click="handleExport">导出</a-button>
<a-button type="primary" v-if="!editFlag" @click="handleEdit">编辑</a-button> <a-button type="primary" v-if="!editFlag" @click="handleEdit">编辑</a-button>
<a-button type="primary" v-if="!editFlag">删除</a-button> <a-button type="primary" v-if="!editFlag">删除</a-button>
<a-button type="primary" v-if="editFlag">编辑记录</a-button> <a-button type="primary" v-if="editFlag">编辑记录</a-button>
<a-button type="primary" v-if="editFlag">设为待发布</a-button> <a-button type="primary" v-if="editFlag" @click="handleWaitPub">{{
<a-button type="primary" v-if="editFlag" @click="handlePublish">发布</a-button> iswaitPub ? '设为待发布' : '取消待发布'
<a-button type="primary" v-if="editFlag" @click="handleDebug">建表调试</a-button> }}</a-button>
<a-button type="primary" v-if="editFlag" @click="handleSave">保存</a-button> <a-button type="primary" v-if="editFlag" @click="handlePublish" :disabled="iswaitPub">发布</a-button>
<a-button type="primary" v-if="editFlag" @click="handleCancel">取消</a-button> <a-button type="primary" v-if="editFlag" @click="handleDebug" :disabled="!iswaitPub"
>建表调试</a-button
>
<a-button type="primary" v-if="editFlag" @click="handleSave" :disabled="!iswaitPub"
>保存</a-button
>
<a-button type="primary" v-if="editFlag" @click="handleCancel">退出编辑</a-button>
</template> </template>
<template #footer> <template #footer>
...@@ -150,7 +157,9 @@ ...@@ -150,7 +157,9 @@
</BasicForm> </BasicForm>
</div> </div>
</Tabs.TabPane> </Tabs.TabPane>
<Tabs.TabPane key="3" v-if="!editFlag" tab="模型关系" /> <Tabs.TabPane key="3" tab="模型关系">
<ModelRelationship />
</Tabs.TabPane>
<Tabs.TabPane key="4" v-if="!editFlag" tab="模型关联"> <Tabs.TabPane key="4" v-if="!editFlag" tab="模型关联">
<SourceData style="margin-top: 20px" /> <SourceData style="margin-top: 20px" />
<LogicalModel style="margin-top: 20px" /> <LogicalModel style="margin-top: 20px" />
...@@ -167,7 +176,7 @@ ...@@ -167,7 +176,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { reactive, onMounted, ref, nextTick, computed, unref } from 'vue'; import { reactive, onMounted, ref, nextTick, computed, unref } from 'vue';
import { PageWrapper } from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import { useRoute, onBeforeRouteLeave } from 'vue-router'; import {useRoute, onBeforeRouteLeave, useRouter} from 'vue-router';
import { useFilterStore } from '@/store/modules/filterData'; import { useFilterStore } from '@/store/modules/filterData';
import { Descriptions, Select, Tabs } from 'ant-design-vue'; import { Descriptions, Select, Tabs } from 'ant-design-vue';
import DetailInfo from './detailInfo.vue'; import DetailInfo from './detailInfo.vue';
...@@ -195,8 +204,8 @@ ...@@ -195,8 +204,8 @@
import SqlDevelop from '@/views/dataWarehousePlanning/physicalModel/modelDetail/sqlDevelop.vue'; import SqlDevelop from '@/views/dataWarehousePlanning/physicalModel/modelDetail/sqlDevelop.vue';
import ModelCreateTable from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelCreateTable.vue'; import ModelCreateTable from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelCreateTable.vue';
import VersionModel from '@/views/dataWarehousePlanning/physicalModel/modelDetail/versionModel.vue'; import VersionModel from '@/views/dataWarehousePlanning/physicalModel/modelDetail/versionModel.vue';
import ModelPublishTable import ModelPublishTable from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelPublishTable.vue';
from "@/views/dataWarehousePlanning/physicalModel/modelDetail/modelPublishTable.vue"; import ModelRelationship from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelRelationship/modelRelationship.vue';
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
const [registerDebugModal, { openModal: openDebugModal }] = useModal(); const [registerDebugModal, { openModal: openDebugModal }] = useModal();
...@@ -209,6 +218,7 @@ ...@@ -209,6 +218,7 @@
const route = useRoute(); const route = useRoute();
const searchInfo = reactive<Recordable>({}); const searchInfo = reactive<Recordable>({});
const modelName = route.query.modelName; const modelName = route.query.modelName;
const { push } = useRouter();
/** /**
* 属性定义 * 属性定义
*/ */
...@@ -216,6 +226,7 @@ ...@@ -216,6 +226,7 @@
const info = reactive({ ...infoData }); const info = reactive({ ...infoData });
let editFlag = ref(false); let editFlag = ref(false);
let isPublish = ref(false); let isPublish = ref(false);
let iswaitPub = ref(true);
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({ const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 108, labelWidth: 108,
baseColProps: { lg: 12, md: 24 }, baseColProps: { lg: 12, md: 24 },
...@@ -239,7 +250,7 @@ ...@@ -239,7 +250,7 @@
{ reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection }, { reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection },
] = useTable({ ] = useTable({
title: '', title: '',
scroll: {y: 200}, scroll: { y: 200 },
api: async (params) => { api: async (params) => {
console.log('params:', params); console.log('params:', params);
const response = { const response = {
...@@ -251,7 +262,7 @@ ...@@ -251,7 +262,7 @@
message: '', message: '',
data: [], data: [],
}; };
return {...response}; return { ...response };
}, },
rowKey: 'businessId', rowKey: 'businessId',
columns: columnsDetail, columns: columnsDetail,
...@@ -272,8 +283,6 @@ ...@@ -272,8 +283,6 @@
}, },
}); });
/** /**
* 导出 * 导出
*/ */
...@@ -295,6 +304,18 @@ ...@@ -295,6 +304,18 @@
}); });
} }
/** 模型管理*/
function handleRelate() {
push({
path: '/dataWarehousePlanning/physicalModel/relate',
});
}
/** 设为待发布*/
function handleWaitPub() {
iswaitPub.value = !iswaitPub.value;
}
/** 发布*/ /** 发布*/
function handlePublish() { function handlePublish() {
openPublishModal(true, { openPublishModal(true, {
...@@ -334,7 +355,6 @@ ...@@ -334,7 +355,6 @@
*/ */
function handleCancel() { function handleCancel() {
editFlag.value = false; editFlag.value = false;
tabsKey.value = '1';
} }
onMounted(() => { onMounted(() => {
setFieldsValue({ ...infoData }); setFieldsValue({ ...infoData });
......
<template>
<BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { ConnectionModelFormSchema } from './relate.data';
defineOptions({ name: 'ModelModal' });
const isUpdate = ref(false);
const isMove = ref(false);
const rowId = ref('');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 12, md: 24 },
schemas: ConnectionModelFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
isMove.value = !!data?.isMove;
if (unref(isUpdate)) {
// 获取行数据的id
rowId.value = data.record.businessId;
// 塞值
await setFieldsValue({
...data.record,
});
}
});
const getTitle = computed(() =>
isUpdate.value ? '编辑模型关系' : '新建模型关系',
);
/**确定按钮*/
async function handleSubmit() {
await validate();
closeModal();
}
</script>
<template>
<div>
<BasicTable @register="registerTable" :searchInfo="searchInfo">
<template #toolbar>
<a-button
:disabled="getRowSelection().selectedRowKeys <= 0"
type="primary"
@click="handleDelete"
><DeleteTwoTone />删除</a-button
>
<a-button type="primary" @click="handleCrossModel"
><PlusCircleTwoTone />新增模型关系</a-button
>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'clarity:note-edit-line',
onClick: handleCrossEditModel.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
onClick: handleDelete.bind(null, record),
color: 'error',
},
]"
/>
</template>
</template>
</BasicTable>
<CrossModel @register="crossModal" @success="crossSuccess" />
</div>
</template>
<script lang="ts" setup>
import { reactive, onMounted, ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { useRoute, onBeforeRouteLeave } from 'vue-router';
import { crossFormSchema, crossTable } from './relate.data';
import { useFilterStore } from '@/store/modules/filterData';
import { TreeData } from '@/views/dataWarehousePlanning/logicalModel/modelData';
import { crossData } from './relateData';
import { DeleteTwoTone, PlusCircleTwoTone } from '@ant-design/icons-vue';
import CrossModel from './crossModel.vue';
import { useModal } from '@/components/Modal';
import { useMessage } from '@/hooks/web/useMessage';
defineOptions({ name: 'AccountManagement' });
const { createMessage, createConfirm } = useMessage();
const filterStore = useFilterStore();
const route = useRoute();
const searchInfo = reactive<Recordable>({});
const tableData = ref([]);
// 模态框
const [crossModal, { openModal }] = useModal();
// 实体新增
function handleCrossModel() {
openModal(true, {
isUpdate: false,
});
}
// 实体编辑
function handleCrossEditModel(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
});
}
// 模态框保存
function crossSuccess({ isUpdate, values }) {
if (isUpdate) {
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
//修改表单的值
const result = updateTableDataRecord(values.businessId, values);
reload();
} else {
tableData.value.push(values);
reload();
}
}
const [
registerTable,
{ reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection },
] = useTable({
// 数据
api: async (params) => {
console.log('params:', params);
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: crossData.length,
code: '',
message: '',
data: crossData,
};
return { ...response };
},
rowKey: 'businessId',
// 列
columns: crossTable,
rowSelection: true,
showIndexColumn: false,
striped: false,
// 搜索
formConfig: {
labelWidth: 120,
schemas: crossFormSchema,
autoSubmitOnEnter: true,
showActionButtonGroup: false,
},
useSearchForm: true,
showTableSetting: false,
bordered: true,
handleSearchInfoFn(info) {
return info;
},
actionColumn: {
width: 150,
title: '操作',
dataIndex: 'action',
},
});
/** 删除按钮*/
function handleDelete() {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '确认批量删除选中数据吗?',
onOk() {
createMessage.success('批量删除成功!');
},
});
}
/** 列表删除 */
function handleRemove(record) {
createMessage.success('删除成功!');
}
onMounted(() => {
tableData.value = TreeData;
const path = route.path;
if (filterStore.getSearchParams[path]) {
if (JSON.parse(filterStore.getSearchParams[path] !== {})) {
const params = JSON.parse(filterStore.getSearchParams[path]);
getForm().setFieldsValue({
page: params.page,
pageSize: params.pageSize,
username: params.username,
flag: params.flag,
});
searchInfo.institutionId = params.institutionId;
}
}
});
onBeforeRouteLeave((to, from, next) => {
next(); // 允许导航
});
</script>
<style scoped lang="scss">
.vben-basic-table-form-container {
padding: 0;
}
</style>
import {FormSchema} from "@/components/Form";
import {BasicColumn} from "@/components/Table";
import {TreeItem} from "@/components/Tree";
export const ConnectionModelFormSchema: any[] = [
{
field: 'name',
label: '关系名称',
component: 'Input',
required: true,
colProps: { lg: 24, md: 24 },
},
{
field: 'fatherName',
label: '子属性',
component: 'Select',
required: true,
colProps: { lg: 24, md: 24 },
},
{
field: 'fatherPK',
label: '父模型',
component: 'Select',
required: true,
colProps: { lg: 24, md: 24 },
},
{
field: 'fatherNum',
label: '父属性',
component: 'Select',
required: true,
colProps: { lg: 24, md: 24 },
},
{
field: 'comments',
label: '注释',
component: 'InputTextArea',
colProps: { lg: 24, md: 24 },
},
];
export const crossFormSchema: FormSchema[] = [
{
field: 'name',
component: 'Input',
componentProps: {
placeholder: '输入关联关系名称搜索',
},
colProps: { span: 4 },
},
];
export const crossTable: BasicColumn[] = [
{
title: '关系名称',
dataIndex: 'name',
width: 150,
// onEditRow: true,
},
{
title: '子属性',
dataIndex: 'sonAttribute',
width: 150,
// onEditRow: true,
},
{
title: '父模型',
dataIndex: 'fatherModel',
width: 150,
// onEditRow: true,
},
{
title: '父属性',
dataIndex: 'fatherAttribute',
width: 150,
// onEditRow: true,
},
{
title: '注释',
dataIndex: 'comments',
width: 150,
// onEditRow: true,
},
];
export const chartTreeData: TreeItem[] = [
{
title: '物理模型',
key: '1',
children: [
{ title: 'yL_table_orc01', icon: 'ion:cube-outline', key: '3' },
{ title: 'yl_table_torc01', icon: 'ion:cube-outline', key: '4' },
],
},
{
title: '模型关联',
key: '2',
children: [
{ title: 'NEW orc_id_torc_id', icon: 'ion:git-merge-outline', key: '5' },
{ title: 'orc_id_torc_id', icon: 'ion:git-merge-outline', key: '6' },
],
},
];
export const crossData: any[] = [
{
businessId: '1',
name: 'orc_torc_id',
sonAttribute: 'id',
fatherModel: '/物理模型/test_catalog/argodb/Argodb/yl_test',
fatherAttribute: 'id',
comments: '备注',
},
];
<template>
<PageWrapper title="模型关系" contentBackground headerSticky>
<template #extra>
<a-button type="primary">刷新</a-button>
<a-button type="primary">全屏</a-button>
<a-button type="primary">退出</a-button>
</template>
<template #footer>
<div style="display: flex">
<div style="flex: 1; display: flex">
<div style="flex: 1">
<BasicTree
:search="123"
:rightMenuList="{ type: [{ label: '123' }] }"
:treeData="chartTreeData"
:fieldNames="{ key: 'key', title: 'title' }"
defaultExpandLevel="1"
@select="handleSelect"
/>
</div>
<a-button
@click="handleAdd"
style="margin-left: -10px; margin-top: 6px; border-color: #d9d9d9"
size="small"
><PlusOutlined style="color: #9396a4"
/></a-button>
</div>
<div style="flex: 4">
<img
v-if="modelLevel === '1' || modelLevel === '2'"
src="../../../../../assets/images/ERchart.jpg"
class="erchart-img"
/>
<img
v-if="modelLevel === '3' || modelLevel === '4'"
src="../../../../../assets/images/modelrelate.png"
class="erchart-img"
/>
<img
v-if="modelLevel === '5' || modelLevel === '6'"
src="../../../../../assets/images/modelrelate1.png"
class="erchart-img"
/>
</div>
</div>
</template>
<CrossModel @register="crossModal" />
</PageWrapper>
</template>
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import { PageWrapper } from '@/components/Page';
import { BasicTree } from '@/components/Tree';
import { chartTreeData } from './relate.data';
import CrossModel from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelRelationship/crossModel.vue';
import { useModal } from '@/components/Modal';
import { ref } from 'vue';
// 模态框
const [crossModal, { openModal }] = useModal();
let modelLevel = ref('1');
function handleSelect(key) {
if (key[0] !== null && key[0] !== undefined) {
modelLevel.value = key[0];
} else {
modelLevel.value = '0';
}
}
function handleAdd() {
openModal(true);
}
// const options = [
// {
// label: '全部实体',
// value: '1',
// },
// {
// label: '当前模型实体',
// value: '当前模型实体',
// },
// ];
</script>
<style scoped>
.erchart-img {
height: calc(100vh - 200px);
}
</style>
...@@ -1152,6 +1152,14 @@ export const tagDataSourceColumns: BasicColumn[] = [ ...@@ -1152,6 +1152,14 @@ export const tagDataSourceColumns: BasicColumn[] = [
edit: true, edit: true,
}, },
]; ];
export const tagDataBaseColumns: BasicColumn[] = [
{
title: '数据库名',
dataIndex: 'name',
width: 120,
edit: true,
},
];
export const tagSourceColumns: BasicColumn[] = [ export const tagSourceColumns: BasicColumn[] = [
{ {
title: '标签名', title: '标签名',
......
...@@ -111,7 +111,27 @@ ...@@ -111,7 +111,27 @@
// 选中节点 // 选中节点
async function onNodeSelect(node: any) { async function onNodeSelect(node: any) {
selectedNode.value = node; selectedNode.value = node;
title.value = node.workSpaceName; if (
node.workSpaceName == '数据源1' ||
node.workSpaceName == '数据库1' ||
node.workSpaceName == '数据表1'
) {
title.value = 'admin-个人工作区';
} else if (
node.workSpaceName == '数据源2' ||
node.workSpaceName == '数据库2' ||
node.workSpaceName == '数据表2'
) {
title.value = '共享工作区';
} else if (
node.workSpaceName == '数据源3' ||
node.workSpaceName == '数据库3' ||
node.workSpaceName == '数据表3'
) {
title.value = '高级工作区';
} else {
title.value = node.workSpaceName;
}
await getForm().setFieldsValue({ await getForm().setFieldsValue({
workSpaceName: title.value, workSpaceName: title.value,
}); });
......
...@@ -7,7 +7,30 @@ ...@@ -7,7 +7,30 @@
@ok="handleSubmit" @ok="handleSubmit"
> >
<BasicForm @register="registerForm" /> <BasicForm @register="registerForm" />
<BasicTable @register="registerPartitionTable"> <BasicTable v-show="!tableChange" @register="registerPartitionTable">
<template #toolbar>
<a-button type="primary" v-show="isCopy" @click="handDelete">删除</a-button>
<a-button type="primary" v-show="isCopy" @click="handleNewSource">添加</a-button>
</template>
<template #bodyCell="{ column }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
color: 'error',
label: '删除',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null),
},
},
]"
/>
</template>
</template>
</BasicTable>
<BasicTable v-show="tableChange" @register="registerDataBaseTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" v-show="isCopy" @click="handDelete">删除</a-button> <a-button type="primary" v-show="isCopy" @click="handDelete">删除</a-button>
<a-button type="primary" v-show="isCopy" @click="handleNewSource">添加</a-button> <a-button type="primary" v-show="isCopy" @click="handleNewSource">添加</a-button>
...@@ -65,9 +88,9 @@ ...@@ -65,9 +88,9 @@
import { sourceFormData, tagFormData, tagRecordData } from '@/views/metadata/metadataData'; import { sourceFormData, tagFormData, tagRecordData } from '@/views/metadata/metadataData';
import { BasicForm, useForm } from '@/components/Form'; import { BasicForm, useForm } from '@/components/Form';
import { import {
tagDataBaseColumns,
tagDataSourceColumns, tagDataSourceColumns,
tagRuleSchema, tagRuleSchema,
tagSchema,
tagSourceColumns, tagSourceColumns,
} from '@/views/metadata/data'; } from '@/views/metadata/data';
import { BasicTable, TableAction, useTable } from '@/components/Table'; import { BasicTable, TableAction, useTable } from '@/components/Table';
...@@ -86,12 +109,58 @@ ...@@ -86,12 +109,58 @@
const rowId = ref(''); const rowId = ref('');
const isCopy = ref(false); const isCopy = ref(false);
const isForm = ref(false); const isForm = ref(false);
const tableChange = ref(false);
//获取接口数据并放在下拉框里(这里是打开了一个弹框) //获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单 //初始化表单
const [registerForm, { setFieldsValue, resetFields }] = useForm({ const [registerForm, { setFieldsValue, resetFields }] = useForm({
labelWidth: 120, labelWidth: 120,
baseColProps: { lg: 12, md: 24 }, baseColProps: { lg: 12, md: 24 },
schemas: tagSchema, schemas: [
{
field: 'typeNum',
label: '操作类型',
component: 'RadioGroup',
colProps: { lg: 24, md: 24 },
componentProps: {
options: [
{ label: '新增标签', value: '0' },
{ label: '删除标签', value: '1' },
],
},
required: true,
},
{
field: 'workName',
label: '任务名',
component: 'Input',
colProps: { lg: 24, md: 24 },
required: true,
},
{
field: 'remark',
label: '描述',
component: 'Input',
colProps: { lg: 24, md: 24 },
required: true,
},
{
field: 'range',
label: '打标范围',
component: 'RadioGroup',
colProps: { lg: 24, md: 24 },
defaultValue: '0',
componentProps: ({ formModel }) => ({
onChange: () => {
tableChange.value = formModel.range === '1';
},
options: [
{ label: '数据源', value: '0' },
{ label: '数据库', value: '1' },
],
}),
required: true,
},
],
disabled: isForm, disabled: isForm,
showActionButtonGroup: false, showActionButtonGroup: false,
actionColOptions: { actionColOptions: {
...@@ -156,6 +225,33 @@ ...@@ -156,6 +225,33 @@
}, },
scroll: { y: 300 }, scroll: { y: 300 },
}); });
const [registerDataBaseTable] = useTable({
title: '选择数据库',
columns: tagDataBaseColumns,
api: async () => {
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: formData.value.length,
code: '',
message: '',
data: [],
};
var data = [];
data = formData.value.filter((item) => item.businessId !== 100);
return { ...response, data: data };
},
showIndexColumn: false,
pagination: false,
actionColumn: {
width: 80,
title: '操作',
dataIndex: 'action',
ifShow: isCopy,
},
scroll: { y: 300 },
});
const [registerTagTable, { reload: reloadTag }] = useTable({ const [registerTagTable, { reload: reloadTag }] = useTable({
title: '选择标签', title: '选择标签',
api: async () => { api: async () => {
...@@ -185,11 +281,13 @@ ...@@ -185,11 +281,13 @@
}); });
async function handleSubmit() { async function handleSubmit() {
closeModal(); closeModal();
createMessage.success('提交成功');
await resetFields(); await resetFields();
await resetRuleFields(); await resetRuleFields();
await reloadTag(); await reloadTag();
await reload(); await reload();
if (!isForm.value) {
createMessage.success('提交成功');
}
} }
function handDelete() { function handDelete() {
createConfirm({ createConfirm({
......
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