Commit 6af9a742 authored by LiXuyang's avatar LiXuyang

逻辑模型详情

parent 0e4cee7a
...@@ -59,15 +59,158 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -59,15 +59,158 @@ export const searchFormSchema: FormSchema[] = [
colProps: { span: 7 }, colProps: { span: 7 },
}, },
]; ];
export const searchFormTwoSchema: FormSchema[] = [ export const entityColumns: BasicColumn[] = [
{
title: '实体名称',
dataIndex: 'name',
width: 150,
// onEditRow: true,
},
{
title: '实体描述',
dataIndex: 'txt',
width: 150,
// onEditRow: true,
},
{
title: '实体英文名',
dataIndex: 'engName',
width: 150,
// onEditRow: true,
},
{
title: '资产责任人',
dataIndex: 'person',
width: 150,
// onEditRow: true,
},
{
title: '所属部门',
dataIndex: 'deptName',
width: 150,
},
];
export const entityFormSchema: FormSchema[] = [
{
field: 'name',
component: 'Input',
componentProps: {
placeholder: '输入实体名称搜索',
},
colProps: { span: 4 },
},
];
export const connectionTable: BasicColumn[] = [
{
title: '名称',
dataIndex: 'name',
width: 150,
// onEditRow: true,
},
{
title: '父实体名称',
dataIndex: 'fatherName',
width: 150,
// onEditRow: true,
},
{
title: '父实体属性PK',
dataIndex: 'fatherPK',
width: 150,
// onEditRow: true,
},
{
title: '父端基数',
dataIndex: 'fatherNum',
width: 150,
// onEditRow: true,
},
{
title: '子实体名称',
dataIndex: 'sonName',
width: 150,
},
{
title: '子实体属性PK',
dataIndex: 'sonPK',
width: 150,
},
{
title: '子端基数',
dataIndex: 'sonNum',
width: 150,
},
];
export const connectionFormSchema: FormSchema[] = [
{
field: 'name',
component: 'Input',
componentProps: {
placeholder: '输入关联关系名称搜索',
},
colProps: { span: 4 },
},
];
export const crossTable: BasicColumn[] = [
{
title: '名称',
dataIndex: 'name',
width: 150,
// onEditRow: true,
},
{
title: '父逻辑模型名称',
dataIndex: 'fatherModelName',
width: 150,
// onEditRow: true,
},
{
title: '父实体名称',
dataIndex: 'fatherName',
width: 150,
// onEditRow: true,
},
{
title: '父实体属性PK',
dataIndex: 'fatherPK',
width: 150,
// onEditRow: true,
},
{
title: '父端基数',
dataIndex: 'fatherNum',
width: 150,
// onEditRow: true,
},
{
title: '子逻辑模型名称',
dataIndex: 'sonModelName',
width: 150,
},
{
title: '子实体名称',
dataIndex: 'sonName',
width: 150,
},
{
title: '子实体属性PK',
dataIndex: 'sonPK',
width: 150,
},
{
title: '子端基数',
dataIndex: 'sonNum',
width: 150,
},
];
export const crossFormSchema: FormSchema[] = [
{ {
field: 'name', field: 'name',
label: '名称',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
placeholder: '输入关键字搜索主题域名称、英文名', placeholder: '输入关联关系名称搜索',
}, },
colProps: { span: 10 }, colProps: { span: 4 },
}, },
]; ];
export const modelFormSchema: any[] = [ export const modelFormSchema: any[] = [
...@@ -152,7 +295,7 @@ export const editFormSchema: any[] = [ ...@@ -152,7 +295,7 @@ export const editFormSchema: any[] = [
component: 'Input', component: 'Input',
colProps: { lg: 12, md: 12 }, colProps: { lg: 12, md: 12 },
}, },
] ];
/**移动*/ /**移动*/
export const MoveFormSchema: any[] = [ export const MoveFormSchema: any[] = [
{ {
...@@ -170,3 +313,89 @@ export const MoveFormSchema: any[] = [ ...@@ -170,3 +313,89 @@ export const MoveFormSchema: any[] = [
required: true, required: true,
}, },
]; ];
// entityModel
export const EntityModelFormSchema: any[] = [
{
field: 'name',
label: '实体名称',
component: 'Input',
required: true,
colProps: { lg: 24, md: 24 },
},
{
field: 'txt',
label: '实体描述',
component: 'Input',
colProps: { lg: 24, md: 24 },
},
{
field: 'engName',
label: '英文实体名',
component: 'Input',
colProps: { lg: 24, md: 24 },
},
{
field: 'person',
label: '资产责任人',
component: 'Select',
colProps: { lg: 24, md: 24 },
},
{
field: 'deptName',
label: '所属部门',
component: 'Select',
colProps: { lg: 24, md: 24 },
},
];
// connectionModel
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: '父实体属性PK',
component: 'Select',
required: true,
colProps: { lg: 24, md: 24 },
},
{
field: 'fatherNum',
label: '父端基数',
component: 'Select',
required: true,
colProps: { lg: 24, md: 24 },
},
{
field: 'sonName',
label: '子实体名称',
component: 'Select',
required: true,
colProps: { lg: 24, md: 24 },
},
{
field: 'sonPK',
label: '子实体属性PK',
component: 'Select',
required: true,
colProps: { lg: 24, md: 24 },
},
{
field: 'sonNum',
label: '子端基数',
component: 'Select',
required: true,
colProps: { lg: 24, md: 24 },
},
];
export const infoData = {
txt: 'DW层的数仓模型',
num: '2',
createTime: '2023-06-15 15:11:56',
updateTime: '2023-06-15 15:11:56',
uploadTime: '2023-06-15 15:43:09',
createBy: 'admin',
uploadBy: 'admin',
};
export const entityData: any[] = [
{
businessId: '1',
name: 'dw_产品合约行情历史',
txt: 'dw_产品合约行情历史',
engName: 'dw_prd_contract_quot_h_s',
person: 'admin',
deptName: '机构管理/数据平台治理部',
},
{
businessId: '2',
name: 'dw_合约',
txt: 'dw_合约',
engName: 'dw_prd_contract_f',
person: 'admin',
deptName: '机构管理/数据平台治理部',
},
];
export const connectionData: any[] = [
{
name: '合约_行情',
fatherName: 'dw_合约',
fatherPK: '合约号',
fatherNum: '1',
sonName: 'dw_产品合约行情历史',
sonPK: '合约号',
sonNum: '1',
},
{
name: '合约_行情',
fatherName: 'dw_合约',
fatherPK: '合约号',
fatherNum: '1',
sonName: 'dw_产品合约行情历史',
sonPK: '合约号',
sonNum: '1',
},
{
name: '合约_行情',
fatherName: 'dw_合约',
fatherPK: '合约号',
fatherNum: '1',
sonName: 'dw_产品合约行情历史',
sonPK: '合约号',
sonNum: '1',
},
{
name: '合约_行情',
fatherName: 'dw_合约',
fatherPK: '合约号',
fatherNum: '1',
sonName: 'dw_产品合约行情历史',
sonPK: '合约号',
sonNum: '1',
},
{
name: '合约_行情',
fatherName: 'dw_合约',
fatherPK: '合约号',
fatherNum: '1',
sonName: 'dw_产品合约行情历史',
sonPK: '合约号',
sonNum: '1',
},
];
export const crossData: any[] = [
{
name: '合约_行情',
fatherModelName: 'SDM_DM数仓模型',
fatherName: 'dm_会员客户合约盈亏每日深汇',
fatherPK: '合约号',
fatherNum: '1',
sonModelName: 'SDM_DM数仓模型',
sonName: 'dw_合约',
sonPK: '合约号',
sonNum: '1',
},
];
<template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<ModelTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
<BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
<template #toolbar>
<a-button type="primary" @click="handleImport">导入</a-button>
<a-button type="primary" @click="handleExport">导出</a-button>
<a-button type="primary" @click="handleCreateFile">新建文件夹</a-button>
<a-button type="primary" @click="handleCreateModel">新建文件</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
// icon: 'clarity:note-edit-line',
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
color: 'error',
label: '删除',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
{
label: '移动',
onClick: handleMove.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
<ModelModal @register="registerModal" :modelData="modelData" @success="handleSuccess" />
<ModelEdit @register="registerModelEdit" @success="handleSuccess" />
</PageWrapper>
</template>
<script lang="ts" setup>
import { reactive, onMounted, ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import ModelTree from './ModelTree.vue';
import { useMessage } from '@/hooks/web/useMessage';
import { useModal } from '@/components/Modal';
import ModelModal from './modelModal.vue';
import ModelEdit from './ModelEdit.vue';
import { useRouter } from 'vue-router';
import {columns, searchFormSchema, searchFormTwoSchema} from './model.data';
import { useGo } from '@/hooks/web/usePage';
import { useRoute, onBeforeRouteLeave } from 'vue-router';
import { useFilterStore } from '@/store/modules/filterData';
import { TreeData } from '@/views/dataWarehousePlanning/logicalModel/modelEdit/modelData';
defineOptions({ name: 'AccountManagement' });
const modelData = ref({
titel:''
});
const { createMessage } = useMessage();
const filterStore = useFilterStore();
const route = useRoute();
const go = useGo();
const { push } = useRouter();
const [registerModal, { openModal }] = useModal();
const [registerModelEdit, { openModal: openEditUserModal }] = useModal();
const [registerAddUserModal, { openModal: addUserModal }] = useModal();
const [registerMoveUser, { openModal: openMoveUserModal }] = useModal();
const searchInfo = reactive<Recordable>({});
const tableData = ref([]);
const [
registerTable,
{ reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection },] = useTable({
title: '',
api: async (params) => {
console.log('params:', params);
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: tableData.value.length,
code: '',
message: '',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
var data = [];
//按照部门筛选 如果有进行过滤相应部门的 没有就赋值全部
var data = [];
data = tableData.value.filter((item) => item.businessId !== 100);
return { ...response, data: data };
},
rowKey: 'businessId',
columns,
rowSelection: true,
formConfig: {
labelWidth: 120,
schemas: searchFormTwoSchema,
autoSubmitOnEnter: true,
resetFunc: () => {
searchInfo.modelId = '';
},
},
useSearchForm: true,
showTableSetting: false,
bordered: true,
handleSearchInfoFn(info) {
return info;
},
actionColumn: {
width: 150,
title: '操作',
dataIndex: 'action',
},
});
function handleImport(){
console.log("导入")
}
function handleExport(){
console.log("导出")
}
/** 新增文件*/
function handleCreateModel() {
modelData.value.titel = "新增文件"
openModal(true, {
titel: "新增文件",
isUpdate: false,
});
}
/** 新增文件夹*/
function handleCreateFile() {
modelData.value.titel = "新增文件夹"
openModal(true, {
titel: "新增文件夹",
isUpdate: false,
});
}
/** 移动按钮*/
function handleMove(record: Recordable) {
openMoveUserModal(true, {
record,
isMove: true,
});
}
/** 编辑按钮*/
function handleEdit(record: Recordable) {
openEditUserModal(true, {
record,
isUpdate: true,
});
}
/** 删除按钮*/
function handleDelete(record: Recordable) {
tableData.value.splice(
tableData.value.findIndex((item) => item.businessId === record.businessId),
1,
);
createMessage.success('删除成功!');
reload();
}
/** 新增/编辑成功*/
function handleSuccess({ isUpdate, values }) {
if (isUpdate) {
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
//修改表单的值
const result = updateTableDataRecord(values.businessId, values);
reload();
} else {
tableData.value.push(values);
reload();
}
}
/** 进入二级主题域 */
function showDetails(record) {
push({
path: '/monthlyPlan/monthlyPlanEdit',
query: record.modelName,
});
}
/** 移动*/
function handleMoveSuccess({ isMove, values }) {
const rowSelection = getRowSelection().selectedRowKeys;
if (rowSelection.length > 0) {
//批量移动
for (let i = 0; i < rowSelection.length; i++) {
const result = updateTableDataRecord(values[i].institutionId, values[i]);
}
} else {
//单个移动
const result = updateTableDataRecord(values.businessId, values);
}
reload();
}
/** 部门树的select*/
function handleSelect(modelId = '') {
searchInfo.modelId = modelId;
reload();
}
function handleView(record: Recordable) {
go('/system/account_detail/' + record.id);
}
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) => {
const params = Object.assign({}, getSearchInfo(), getForm().getFieldsValue());
filterStore.setSearchParams({
path: from.path,
param: {
...params,
},
});
next(); // 允许导航
});
</script>
import { getAllRoleList } from '@/api/system/role/role';
import { BasicColumn, FormSchema } from '@/components/Table';
import { h } from 'vue';
import { Tag, Switch } from 'ant-design-vue';
import { useMessage } from '@/hooks/web/useMessage';
import { changeFlagApi } from '@/api/system/user/user';
// 引入开关组件
type CheckedType = boolean | string | number;
export const TreeData: any[] = [
{
delFlag: '0',
flag: '1',
businessId: 100,
modelName: '知识库模型',
parentId: 0,
'code:': '001',
ancestors: '0',
orderNum: 0,
holder: 'admin',
createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04',
// "children" : [ ],
selectType: null,
},
{
delFlag: '0',
flag: '1',
businessId: 101,
modelName: '知识库模型1',
EngName:'modelOne',
describe:'知识库模型1,数据多',
workArea:'默认工作组',
parentId: 100,
'code:': '002',
ancestors: '0,100',
orderNum: 1,
// "children" : [ ],
selectType: null,
holder: 'admin',
createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04',
},
{
delFlag: '0',
flag: '1',
businessId: 102,
modelName: '知识库模型2',
EngName:'modelTwo',
describe:'知识库模型2,数据少',
workArea:'默认工作组',
parentId: 100,
'code:': '002',
ancestors: '0,100',
orderNum: 1,
// "children" : [ ],
selectType: null,
holder: 'admin',
createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04',
},
{
delFlag: '0',
flag: '1',
businessId: 103,
modelName: '知识库模型3',
EngName:'modelThree',
describe:'知识库模型3,数据很多',
workArea:'默认工作组',
parentId: 100,
'code:': '002',
ancestors: '0,100',
orderNum: 1,
// "children" : [ ],
selectType: null,
holder: 'admin',
createDate: '2024-10-24 10:04:04',
updateDate: '2024-10-24 10:04:04',
},
];
export const modelData: any[] = [
{
delFlag: '0',
flag: '1',
businessId: 309,
username: 'yonghu1',
nickName: '测试用户1',
userType: '1',
name: '测试用户1',
createDate: '2024-10-24 10:04:04',
institutionId: 105,
institutionName: '财务部门',
code: '123f',
identity: '1',
roleIds: null,
roleNames: '三级用户',
roleList: null,
menuList: [],
},
{
delFlag: '0',
flag: '1',
businessId: 310,
username: 'yonghu2',
nickName: '测试用户2',
userType: '1',
name: '测试用户2',
createDate: '2024-10-25 10:05:05',
sex: '0',
institutionId: 105,
institutionName: '财务部门',
code: '123a',
identity: '1',
roleIds: null,
roleNames: null,
roleList: null,
menuList: [],
},
{
delFlag: '0',
flag: '1',
businessId: 317,
username: 'yonghu3',
nickName: '测试用户3',
userType: '1',
name: '测试用户3',
createDate: '2024-10-26 10:06:06',
sex: '1',
institutionId: 102,
institutionName: '研发部门',
code: '123c',
identity: '1',
roleIds: null,
roleNames: '超级管理员',
roleList: null,
menuList: [],
},
{
delFlag: '0',
flag: '1',
businessId: 318,
username: 'yonghu4',
nickName: '测试用户4',
userType: '1',
name: '测试用户4',
createDate: '2024-10-26 10:06:06',
sex: '1',
institutionId: 102,
institutionName: '研发部门',
code: '123b',
identity: '1',
roleIds: null,
roleNames: '超级管理员',
roleList: null,
menuList: [],
},
{
delFlag: '0',
flag: '1',
businessId: 319,
username: 'yonghu5',
nickName: '测试用户5',
userType: '1',
name: '测试用户5',
createDate: '2024-10-26 10:06:06',
sex: '1',
institutionId: 102,
institutionName: '研发部门',
code: '123x',
identity: '1',
roleIds: null,
roleNames: '超级管理员',
roleList: null,
menuList: [],
},
];
export const editTableData: any[] = [
{
businessId: 1,
name: '数据源',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '库名',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '表名',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '资产类型',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '表类型',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '表注释',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '存储类型',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '是否为事务表',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '创建时间',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '创建者',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '发布时间',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '发布者',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
];
export const editColumnData: any[] = [
{
businessId: 1,
name: '列名',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '字段类型',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '字段类型参数',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '长度',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '精度',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '是否可为空',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '字段注释',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
];
export const editBucketData: any[] = [
{
businessId: 1,
name: '分桶数',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '分桶字段',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '排序字段',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '排序方式',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
];
export const editAreaData: any[] = [
{
businessId: 1,
name: '分区类型',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '分区字段',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '分区名',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
{
businessId: 1,
name: '分区值',
description: '',
englishName: '',
isWrite: 0,
isShow: 0,
type: '',
},
];
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
]); ]);
}); });
const getTitle = computed(() => '新建元模型'); const getTitle = computed(() => '新建文件');
function handleTree(data, id, parentId, children, rootId) { function handleTree(data, id, parentId, children, rootId) {
id = id || 'id'; id = id || 'id';
......
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