Commit 21ba825a authored by 曹泽华's avatar 曹泽华

数仓规划-物理模型

parent 66c1ed50
...@@ -416,6 +416,19 @@ export const DataWarehousephysicalModelRoute: AppRouteRecordRaw = { ...@@ -416,6 +416,19 @@ export const DataWarehousephysicalModelRoute: AppRouteRecordRaw = {
icon: '', icon: '',
}, },
}, },
{
path: 'assetRelation/historyDetail',
name: 'historyDetail',
component: () =>
import(
'@/views/dataWarehousePlanning/physicalModel/modelDetail/assetRelation/historyDetail.vue'
),
meta: {
title: '编辑历史详情',
icon: '',
},
},
{ {
path: 'physicalModel/upload', path: 'physicalModel/upload',
name: 'pupload', name: 'pupload',
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
>发布</a-button >发布</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" @click="handleExport">导出</a-button>
<a-button type="primary" @click="handleImport">导入</a-button> <a-button type="primary" @click="handleImport">导入</a-button>
<a-button type="primary" @click="handleCreateFolder">新建文件夹</a-button> <a-button type="primary" @click="handleCreateFolder">新建文件夹</a-button>
<a-button type="primary" @click="handleCreateFile">新建文件</a-button> <a-button type="primary" @click="handleCreateFile">新建文件</a-button>
...@@ -228,6 +228,10 @@ ...@@ -228,6 +228,10 @@
}); });
} }
function handleExport() {
createMessage.success('导出成功!');
}
/** 新建文件夹*/ /** 新建文件夹*/
function handleCreateFolder() { function handleCreateFolder() {
openModalAdd(true, { openModalAdd(true, {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="m-4 mr-0 overflow-hidden bg-white"> <div class="m-4 mr-0 overflow-hidden bg-white">
<BasicTree <BasicTree
ref="treeRef" ref="treeRef"
:clickRowToExpand="true" :clickRowToExpand="true"
:defaultExpandAll="true" :defaultExpandAll="true"
:checkable="prop.checkable" :checkable="prop.checkable"
:treeData="treeData" :treeData="treeData"
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import { nextTick, onMounted, ref, unref } from 'vue'; import { nextTick, onMounted, ref, unref } from 'vue';
import { BasicTree, TreeActionType, TreeItem } from '@/components/Tree'; import { BasicTree, TreeActionType, TreeItem } from '@/components/Tree';
import { Nullable } from '@vben/types'; import { Nullable } from '@vben/types';
import { TreeData } from '../modelData'; import { TreeData } from './landData';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
defineOptions({ name: 'DeptTree' }); defineOptions({ name: 'DeptTree' });
......
<template>
<div class="m-4 mr-0 overflow-hidden bg-white">
<BasicTree
ref="treeRef"
:clickRowToExpand="true"
:defaultExpandAll="true"
:checkable="prop.checkable"
:treeData="treeData"
:fieldNames="{ key: 'businessId', title: 'modelName' }"
@select="handleSelect"
/>
</div>
</template>
<script lang="ts" setup>
import { nextTick, onMounted, ref, unref } from 'vue';
import { BasicTree, TreeActionType, TreeItem } from '@/components/Tree';
import { Nullable } from '@vben/types';
import { TreeData } from '../../modelData';
import { useMessage } from '@/hooks/web/useMessage';
defineOptions({ name: 'DeptTree' });
const emit = defineEmits(['select', 'getNode']);
const prop = defineProps({
checkable: {
type: Boolean,
default: false,
},
});
const treeData = ref<TreeItem[]>([]);
const treeRef = ref<Nullable<TreeActionType>>(null);
const { createMessage } = useMessage();
function getTree() {
const tree = unref(treeRef);
if (!tree) {
throw new Error('tree is null!');
}
return tree;
}
async function fetch() {
const data = TreeData;
treeData.value = handleTree(data, 'businessId', undefined, undefined, undefined);
await nextTick(() => {
getTree().expandAll(true);
});
}
function handleTree(data, id, parentId, children, rootId) {
id = id || 'id';
parentId = parentId || 'parentId';
children = children || 'children';
rootId =
rootId ||
Math.min.apply(
Math,
data.map((item) => {
return item[parentId];
}),
) ||
0;
// 对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data));
// 循环所有项
const treeData = cloneData.filter((father) => {
const branchArr = cloneData.filter((child) => {
// 返回每一项的子级数组
return father[id] === child[parentId];
});
branchArr.length > 0 ? (father.children = branchArr) : '';
// 返回第一层
return father[parentId] === rootId;
});
return treeData !== '' ? treeData : data;
}
function handleSelect() {
const keys = getTree().getSelectedKeys();
const node = getTree().getSelectedNode(keys[0]);
emit('getNode', node);
}
onMounted(() => {
fetch();
});
</script>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
columns, columns,
searchFormSchema, searchFormSchema,
} from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelData'; } from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelData';
import ModelTree from '@/views/dataWarehousePlanning/physicalModel/landCheck/ModelTree.vue'; import ModelTree from '@/views/dataWarehousePlanning/physicalModel/landCheck/checkDetail/ModelTree.vue';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage(); const { createMessage } = useMessage();
......
<template> <template>
<PageWrapper :title="modelName" contentBackground headerSticky> <PageWrapper :title="modelName" contentBackground headerSticky @back="handleBack">
<template #extra> <template #extra>
<a-button type="primary" v-if="isEdit" @click="handleCancel">取消</a-button> <a-button type="primary" v-if="isEdit" @click="handleCancel">取消</a-button>
<a-button type="primary" v-if="isEdit" @click="handleSave">保存</a-button> <a-button type="primary" v-if="isEdit" @click="handleSave">保存</a-button>
...@@ -30,12 +30,12 @@ ...@@ -30,12 +30,12 @@
import { PageWrapper } from '@/components/Page/index.js'; import { PageWrapper } from '@/components/Page/index.js';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useForm } from '@/components/Form'; import { useForm } from '@/components/Form';
import {onMounted, ref} from 'vue'; import { onMounted, ref } from 'vue';
import CheckRange from '@/views/dataWarehousePlanning/physicalModel/landCheck/checkDetail/checkRange.vue'; import CheckRange from '@/views/dataWarehousePlanning/physicalModel/landCheck/checkDetail/checkRange.vue';
import BasicForm from '@/components/Form/src/BasicForm.vue'; import BasicForm from '@/components/Form/src/BasicForm.vue';
import { editFormSchema, detailFormSchema } from './detail.data'; import { editFormSchema, detailFormSchema } from './detail.data';
import {useMessage} from "@/hooks/web/useMessage"; import { useMessage } from '@/hooks/web/useMessage';
import {router} from "@/router"; import { router } from '@/router';
const route = useRoute(); const route = useRoute();
const isEdit = ref(false); const isEdit = ref(false);
...@@ -80,6 +80,10 @@ ...@@ -80,6 +80,10 @@
resetSchema(detailFormSchema); resetSchema(detailFormSchema);
} }
} }
function handleBack() {
router.go(-1);
}
function handleRun() { function handleRun() {
createConfirm({ createConfirm({
iconType: 'success', iconType: 'success',
...@@ -92,7 +96,7 @@ ...@@ -92,7 +96,7 @@
} }
onMounted(() => { onMounted(() => {
changeSchema(false); changeSchema(false);
setFieldsValue({checkRule: '物理模型'}) setFieldsValue({ checkRule: '物理模型' });
}); });
</script> </script>
......
...@@ -3,7 +3,7 @@ export const TreeSystem: any[] = [ ...@@ -3,7 +3,7 @@ export const TreeSystem: any[] = [
delFlag: '0', delFlag: '0',
flag: '1', flag: '1',
businessId: 100, businessId: 100,
modelName: '物理模型', modelName: '落地检核',
parentId: 0, parentId: 0,
'code:': '001', 'code:': '001',
ancestors: '0', ancestors: '0',
......
...@@ -109,6 +109,7 @@ ...@@ -109,6 +109,7 @@
} finally { } finally {
setModalProps({ confirmLoading: false }); setModalProps({ confirmLoading: false });
} }
createMessage.success('导入成功!');
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -88,7 +88,7 @@ export const entityFormSchema: FormSchema[] = [ ...@@ -88,7 +88,7 @@ export const entityFormSchema: FormSchema[] = [
}, },
]; ];
export const columns: BasicColumn[] = [ export const detailColumns: BasicColumn[] = [
{ {
title: '工作表名', title: '工作表名',
dataIndex: 'name', dataIndex: 'name',
...@@ -96,7 +96,7 @@ export const columns: BasicColumn[] = [ ...@@ -96,7 +96,7 @@ export const columns: BasicColumn[] = [
}, },
{ {
title: '编号', title: '编号',
dataIndex: 'code', dataIndex: 'rowId',
width: 120, width: 120,
}, },
{ {
...@@ -114,3 +114,22 @@ export const formSchema: FormSchema[] = [ ...@@ -114,3 +114,22 @@ export const formSchema: FormSchema[] = [
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
}, },
]; ];
export const columns: BasicColumn[] = [
{
title: '工作表名',
dataIndex: 'name',
width: 120,
},
{
title: '行号',
dataIndex: 'rowId',
width: 120,
},
{
title: '错误类型',
dataIndex: 'type',
width: 120,
},
];
...@@ -45,3 +45,43 @@ export const editData: any[] = [ ...@@ -45,3 +45,43 @@ export const editData: any[] = [
type: '数据源不存在', type: '数据源不存在',
}, },
]; ];
export const detailData: any[] = [
{
name: 'Sheet0',
rowId: 'C2',
type: '数据源不存在',
},
{
name: 'Sheet1',
rowId: 'C3',
type: '数据源不存在',
},
{
name: 'Sheet2',
rowId: 'C4',
type: '数据源不存在',
},
{
name: 'Sheet3',
rowId: 'C5',
type: '数据源不存在',
},
{
name: 'Sheet4',
rowId: 'C6',
type: '数据源不存在',
},
{
name: 'Sheet5',
rowId: 'C7',
type: '数据源不存在',
},
{
name: 'Sheet6',
rowId: 'C8',
type: '数据源不存在',
},
];
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<template #extra> <template #extra>
<a-button type="primary">导出</a-button> <a-button type="primary">导出</a-button>
<a-button type="primary">刷新</a-button> <a-button type="primary">刷新</a-button>
<a-button type="primary">全屏</a-button>
<a-button type="primary" @click="handleQuit">退出</a-button> <a-button type="primary" @click="handleQuit">退出</a-button>
</template> </template>
<div :class="divHeight > 57 ? 'imgclass1' : 'imgclass2'"> <div :class="divHeight > 57 ? 'imgclass1' : 'imgclass2'">
...@@ -14,55 +13,56 @@ ...@@ -14,55 +13,56 @@
/> />
</div> </div>
<div v-show="isDetail" ref="info"> <div v-show="isDetail" ref="info">
<CollapseContainer maxHeight="340px" title="基础收缩示例"> <CollapseContainer maxHeight="340px" title="物理模型详情">
<Tabs v-model:activeKey="tabsKey"> <div style="height: 410px; overflow-y: scroll">
<Tabs.TabPane key="1" tab="基本信息"> <Tabs v-model:activeKey="tabsKey">
<div class="comparsion-title">表信息</div> <Tabs.TabPane key="1" tab="基本信息">
<Description <div class="comparsion-title">表信息</div>
size="middle" <Description
:bordered="false" size="middle"
:column="2" :bordered="false"
:data="infoData" :column="2"
:schema="checkFormSchema" :data="infoData"
/> :schema="checkFormSchema"
<Divider style="width: 48%" /> />
<div class="comparsion-title">管理元数据</div> <Divider style="width: 48%" />
<Description <div class="comparsion-title">管理元数据</div>
size="middle" <Description
:bordered="false" size="middle"
:column="2" :bordered="false"
:data="partitioncheckinfoData" :column="2"
:schema="partitioncheckFormSchema" :data="partitioncheckinfoData"
/> :schema="partitioncheckFormSchema"
</Tabs.TabPane> />
<Tabs.TabPane key="2" tab="详细信息"> </Tabs.TabPane>
<div class="comparsion-title">分区信息</div> <Tabs.TabPane key="2" tab="详细信息">
<Description <div class="comparsion-title">分区信息</div>
size="middle" <Description
:bordered="false" size="middle"
:column="1" :bordered="false"
:data="areaInfoData" :column="1"
:schema="areaFormSchema" :data="areaInfoData"
/> :schema="areaFormSchema"
<Divider style="width: 50%" /> />
<div class="comparsion-title">分桶信息</div> <Divider style="width: 50%" />
<Description <div class="comparsion-title">分桶信息</div>
size="middle" <Description
:bordered="false" size="middle"
:column="1" :bordered="false"
:data="bucketInfoData" :column="1"
:schema="bucketFormSchema" :data="bucketInfoData"
/> :schema="bucketFormSchema"
<Divider style="width: 50%" /> />
<div class="comparsion-title">列信息</div> <Divider style="width: 50%" />
<BasicTable @register="registerTable" :searchInfo="searchInfo" /> <div class="comparsion-title">列信息</div>
</Tabs.TabPane> <BasicTable @register="registerTable" :searchInfo="searchInfo" />
<Tabs.TabPane key="3" tab="模型关联"> </Tabs.TabPane>
<SourceData style="margin-top: 20px" /> <Tabs.TabPane key="3" tab="模型关联">
<LogicalModel style="margin-top: 20px" /> <SourceData style="margin-top: 20px" />
<SqlDevelop style="margin-top: 40px" /> <LogicalModel style="margin-top: 20px" />
</Tabs.TabPane> <SqlDevelop style="margin-top: 40px" />
</Tabs> </Tabs.TabPane> </Tabs
></div>
</CollapseContainer> </CollapseContainer>
</div> </div>
</PageWrapper> </PageWrapper>
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
import EntityModel from './entityModel.vue'; import EntityModel from './entityModel.vue';
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import { SyncOutlined } from '@ant-design/icons-vue'; import { SyncOutlined } from '@ant-design/icons-vue';
import { downloadByData } from '@/utils/file/download';
const { push } = useRouter(); const { push } = useRouter();
...@@ -143,7 +144,9 @@ ...@@ -143,7 +144,9 @@
} }
function handleEntityEditModel(record: Recordable) { function handleEntityEditModel(record: Recordable) {
push({
path: '/dataWarehousePlanning/assetRelation/historyDetail',
});
} }
onMounted(() => { onMounted(() => {
...@@ -162,6 +165,10 @@ ...@@ -162,6 +165,10 @@
} }
} }
}); });
function handleCrossModel() {
downloadByData('text content', '导入数据标准模版.xls');
}
onBeforeRouteLeave((to, from, next) => { onBeforeRouteLeave((to, from, next) => {
next(); // 允许导航 next(); // 允许导航
}); });
......
<template>
<PageWrapper title="资产关系编辑历史详情" contentBackground headerSticky @back="handleBack">
<template #footer>
<BasicTable @register="registerTable" />
</template>
</PageWrapper>
</template>
<script lang="ts" setup>
import { PageWrapper } from '@/components/Page/index.js';
import { BasicTable, useTable } from '@/components/Table';
import { detailColumns } from './asset.data';
import { detailData } from './assetData';
import {useRouter} from "vue-router";
const router = useRouter();
const [registerTable, { reload }] = useTable({
api: async () => {
const response = {
pageNum: '1',
pageSize: '10',
pages: '1',
total: detailData.length,
code: '',
message: '',
data: detailData,
};
return { ...response };
},
pagination: false,
columns: detailColumns,
useSearchForm: false,
showTableSetting: false,
bordered: true,
showIndexColumn: false,
});
function handleBack() {
router.go(-1);
}
</script>
<style scoped></style>
...@@ -7,8 +7,21 @@ ...@@ -7,8 +7,21 @@
<template #file> <template #file>
<div style="display: flex"> <div style="display: flex">
<div> <div>
<a-button>下载文件模板</a-button> <a-button @click="handleDownByData" style="margin-right: 20px"
<a-button type="primary" style="margin-left: 5px">选择文件</a-button> >下载文件模板</a-button
>
<Upload
v-model:file-list="fileList"
name="file"
:headers="headers"
@change="handleChange"
:max-count="1"
>
<a-button type="primary">
<UploadOutlined />
选择文件
</a-button>
</Upload>
</div> </div>
</div> </div>
</template> </template>
...@@ -32,7 +45,7 @@ ...@@ -32,7 +45,7 @@
import { BasicTable, useTable } from '@/components/Table'; import { BasicTable, useTable } from '@/components/Table';
import SqlDevelop from '@/views/dataWarehousePlanning/physicalModel/modelDetail/sqlDevelop.vue'; import SqlDevelop from '@/views/dataWarehousePlanning/physicalModel/modelDetail/sqlDevelop.vue';
import SourceData from '@/views/dataWarehousePlanning/physicalModel/modelDetail/sourceData.vue'; import SourceData from '@/views/dataWarehousePlanning/physicalModel/modelDetail/sourceData.vue';
import { Select, Tabs } from 'ant-design-vue'; import { Select, Tabs, Upload } from 'ant-design-vue';
import BasicForm from '@/components/Form/src/BasicForm.vue'; import BasicForm from '@/components/Form/src/BasicForm.vue';
import LogicalModel from '@/views/dataWarehousePlanning/physicalModel/modelDetail/logicalModel.vue'; import LogicalModel from '@/views/dataWarehousePlanning/physicalModel/modelDetail/logicalModel.vue';
import DetailInfo from '@/views/dataWarehousePlanning/physicalModel/modelDetail/detailInfo.vue'; import DetailInfo from '@/views/dataWarehousePlanning/physicalModel/modelDetail/detailInfo.vue';
...@@ -43,7 +56,14 @@ ...@@ -43,7 +56,14 @@
import { formSchema } from './asset.data'; import { formSchema } from './asset.data';
import { editData } from '@/views/dataWarehousePlanning/physicalModel/modelDetail/assetRelation/assetData'; import { editData } from '@/views/dataWarehousePlanning/physicalModel/modelDetail/assetRelation/assetData';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { downloadByData } from '@/utils/file/download';
import { UploadOutlined } from '@ant-design/icons-vue';
import { ref } from 'vue';
const fileList = ref([]);
const headers = {
authorization: 'authorization-text',
};
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const [registerForm, { resetFields }] = useForm({ const [registerForm, { resetFields }] = useForm({
labelWidth: 100, labelWidth: 100,
...@@ -55,6 +75,17 @@ ...@@ -55,6 +75,17 @@
}, },
}); });
const handleChange = (model) => {
const type = fileList.value[0].name.slice(fileList.value[0].name.lastIndexOf('.') + 1);
console.log('type', type);
if (['xls', 'xlsx'].includes(type)) {
model.fileType = 'excel';
} else {
model.fileType = 'other';
}
model.fileName = fileList.value[0].name;
model.sheetName = 'Sheet1,Sheet2,Sheet3';
};
const [registerTable, { reload }] = useTable({ const [registerTable, { reload }] = useTable({
title: '错误列表', title: '错误列表',
api: async () => { api: async () => {
...@@ -80,6 +111,9 @@ ...@@ -80,6 +111,9 @@
function handleSubmit() { function handleSubmit() {
createMessage.success('提交成功'); createMessage.success('提交成功');
} }
function handleDownByData() {
downloadByData('text content', '导入数据标准模版.xls');
}
</script> </script>
<style scoped></style> <style scoped></style>
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<PageWrapper title="模型关系" @back="handleGoBack"> <PageWrapper title="模型关系" @back="handleGoBack">
<template #extra> <template #extra>
<a-button type="primary">刷新</a-button> <a-button type="primary">刷新</a-button>
<a-button type="primary">全屏</a-button>
<a-button type="primary" @click="handleQuit">退出</a-button> <a-button type="primary" @click="handleQuit">退出</a-button>
</template> </template>
<template #footer> <template #footer>
......
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