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

数仓规划-物理模型

parent 66c1ed50
......@@ -416,6 +416,19 @@ export const DataWarehousephysicalModelRoute: AppRouteRecordRaw = {
icon: '',
},
},
{
path: 'assetRelation/historyDetail',
name: 'historyDetail',
component: () =>
import(
'@/views/dataWarehousePlanning/physicalModel/modelDetail/assetRelation/historyDetail.vue'
),
meta: {
title: '编辑历史详情',
icon: '',
},
},
{
path: 'physicalModel/upload',
name: 'pupload',
......
......@@ -28,7 +28,7 @@
>发布</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="handleCreateFolder">新建文件夹</a-button>
<a-button type="primary" @click="handleCreateFile">新建文件</a-button>
......@@ -228,6 +228,10 @@
});
}
function handleExport() {
createMessage.success('导出成功!');
}
/** 新建文件夹*/
function handleCreateFolder() {
openModalAdd(true, {
......
......@@ -2,7 +2,7 @@
<div class="m-4 mr-0 overflow-hidden bg-white">
<BasicTree
ref="treeRef"
:clickRowToExpand="true"
:clickRowToExpand="true"
:defaultExpandAll="true"
:checkable="prop.checkable"
:treeData="treeData"
......@@ -15,7 +15,7 @@
import { nextTick, onMounted, ref, unref } from 'vue';
import { BasicTree, TreeActionType, TreeItem } from '@/components/Tree';
import { Nullable } from '@vben/types';
import { TreeData } from '../modelData';
import { TreeData } from './landData';
import { useMessage } from '@/hooks/web/useMessage';
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 @@
columns,
searchFormSchema,
} 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';
const { createMessage } = useMessage();
......
<template>
<PageWrapper :title="modelName" contentBackground headerSticky>
<PageWrapper :title="modelName" contentBackground headerSticky @back="handleBack">
<template #extra>
<a-button type="primary" v-if="isEdit" @click="handleCancel">取消</a-button>
<a-button type="primary" v-if="isEdit" @click="handleSave">保存</a-button>
......@@ -30,12 +30,12 @@
import { PageWrapper } from '@/components/Page/index.js';
import { useRoute } from 'vue-router';
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 BasicForm from '@/components/Form/src/BasicForm.vue';
import { editFormSchema, detailFormSchema } from './detail.data';
import {useMessage} from "@/hooks/web/useMessage";
import {router} from "@/router";
import { useMessage } from '@/hooks/web/useMessage';
import { router } from '@/router';
const route = useRoute();
const isEdit = ref(false);
......@@ -80,6 +80,10 @@
resetSchema(detailFormSchema);
}
}
function handleBack() {
router.go(-1);
}
function handleRun() {
createConfirm({
iconType: 'success',
......@@ -92,7 +96,7 @@
}
onMounted(() => {
changeSchema(false);
setFieldsValue({checkRule: '物理模型'})
setFieldsValue({ checkRule: '物理模型' });
});
</script>
......
......@@ -3,7 +3,7 @@ export const TreeSystem: any[] = [
delFlag: '0',
flag: '1',
businessId: 100,
modelName: '物理模型',
modelName: '落地检核',
parentId: 0,
'code:': '001',
ancestors: '0',
......
......@@ -109,6 +109,7 @@
} finally {
setModalProps({ confirmLoading: false });
}
createMessage.success('导入成功!');
}
</script>
<style lang="scss" scoped>
......
......@@ -88,7 +88,7 @@ export const entityFormSchema: FormSchema[] = [
},
];
export const columns: BasicColumn[] = [
export const detailColumns: BasicColumn[] = [
{
title: '工作表名',
dataIndex: 'name',
......@@ -96,7 +96,7 @@ export const columns: BasicColumn[] = [
},
{
title: '编号',
dataIndex: 'code',
dataIndex: 'rowId',
width: 120,
},
{
......@@ -114,3 +114,22 @@ export const formSchema: FormSchema[] = [
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[] = [
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 @@
<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>
</template>
<div :class="divHeight > 57 ? 'imgclass1' : 'imgclass2'">
......@@ -14,55 +13,56 @@
/>
</div>
<div v-show="isDetail" ref="info">
<CollapseContainer maxHeight="340px" title="基础收缩示例">
<Tabs v-model:activeKey="tabsKey">
<Tabs.TabPane key="1" tab="基本信息">
<div class="comparsion-title">表信息</div>
<Description
size="middle"
:bordered="false"
:column="2"
:data="infoData"
:schema="checkFormSchema"
/>
<Divider style="width: 48%" />
<div class="comparsion-title">管理元数据</div>
<Description
size="middle"
:bordered="false"
:column="2"
:data="partitioncheckinfoData"
:schema="partitioncheckFormSchema"
/>
</Tabs.TabPane>
<Tabs.TabPane key="2" tab="详细信息">
<div class="comparsion-title">分区信息</div>
<Description
size="middle"
:bordered="false"
:column="1"
:data="areaInfoData"
:schema="areaFormSchema"
/>
<Divider style="width: 50%" />
<div class="comparsion-title">分桶信息</div>
<Description
size="middle"
:bordered="false"
:column="1"
:data="bucketInfoData"
:schema="bucketFormSchema"
/>
<Divider style="width: 50%" />
<div class="comparsion-title">列信息</div>
<BasicTable @register="registerTable" :searchInfo="searchInfo" />
</Tabs.TabPane>
<Tabs.TabPane key="3" tab="模型关联">
<SourceData style="margin-top: 20px" />
<LogicalModel style="margin-top: 20px" />
<SqlDevelop style="margin-top: 40px" />
</Tabs.TabPane>
</Tabs>
<CollapseContainer maxHeight="340px" title="物理模型详情">
<div style="height: 410px; overflow-y: scroll">
<Tabs v-model:activeKey="tabsKey">
<Tabs.TabPane key="1" tab="基本信息">
<div class="comparsion-title">表信息</div>
<Description
size="middle"
:bordered="false"
:column="2"
:data="infoData"
:schema="checkFormSchema"
/>
<Divider style="width: 48%" />
<div class="comparsion-title">管理元数据</div>
<Description
size="middle"
:bordered="false"
:column="2"
:data="partitioncheckinfoData"
:schema="partitioncheckFormSchema"
/>
</Tabs.TabPane>
<Tabs.TabPane key="2" tab="详细信息">
<div class="comparsion-title">分区信息</div>
<Description
size="middle"
:bordered="false"
:column="1"
:data="areaInfoData"
:schema="areaFormSchema"
/>
<Divider style="width: 50%" />
<div class="comparsion-title">分桶信息</div>
<Description
size="middle"
:bordered="false"
:column="1"
:data="bucketInfoData"
:schema="bucketFormSchema"
/>
<Divider style="width: 50%" />
<div class="comparsion-title">列信息</div>
<BasicTable @register="registerTable" :searchInfo="searchInfo" />
</Tabs.TabPane>
<Tabs.TabPane key="3" tab="模型关联">
<SourceData style="margin-top: 20px" />
<LogicalModel style="margin-top: 20px" />
<SqlDevelop style="margin-top: 40px" />
</Tabs.TabPane> </Tabs
></div>
</CollapseContainer>
</div>
</PageWrapper>
......
......@@ -46,6 +46,7 @@
import EntityModel from './entityModel.vue';
import { useModal } from '@/components/Modal';
import { SyncOutlined } from '@ant-design/icons-vue';
import { downloadByData } from '@/utils/file/download';
const { push } = useRouter();
......@@ -143,7 +144,9 @@
}
function handleEntityEditModel(record: Recordable) {
push({
path: '/dataWarehousePlanning/assetRelation/historyDetail',
});
}
onMounted(() => {
......@@ -162,6 +165,10 @@
}
}
});
function handleCrossModel() {
downloadByData('text content', '导入数据标准模版.xls');
}
onBeforeRouteLeave((to, from, 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 @@
<template #file>
<div style="display: flex">
<div>
<a-button>下载文件模板</a-button>
<a-button type="primary" style="margin-left: 5px">选择文件</a-button>
<a-button @click="handleDownByData" style="margin-right: 20px"
>下载文件模板</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>
</template>
......@@ -32,7 +45,7 @@
import { BasicTable, useTable } from '@/components/Table';
import SqlDevelop from '@/views/dataWarehousePlanning/physicalModel/modelDetail/sqlDevelop.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 LogicalModel from '@/views/dataWarehousePlanning/physicalModel/modelDetail/logicalModel.vue';
import DetailInfo from '@/views/dataWarehousePlanning/physicalModel/modelDetail/detailInfo.vue';
......@@ -43,7 +56,14 @@
import { formSchema } from './asset.data';
import { editData } from '@/views/dataWarehousePlanning/physicalModel/modelDetail/assetRelation/assetData';
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 [registerForm, { resetFields }] = useForm({
labelWidth: 100,
......@@ -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({
title: '错误列表',
api: async () => {
......@@ -80,6 +111,9 @@
function handleSubmit() {
createMessage.success('提交成功');
}
function handleDownByData() {
downloadByData('text content', '导入数据标准模版.xls');
}
</script>
<style scoped></style>
......@@ -2,7 +2,6 @@
<PageWrapper title="模型关系" @back="handleGoBack">
<template #extra>
<a-button type="primary">刷新</a-button>
<a-button type="primary">全屏</a-button>
<a-button type="primary" @click="handleQuit">退出</a-button>
</template>
<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