Commit ae121f9e authored by 罗林杰's avatar 罗林杰

Merge remote-tracking branch 'origin/master'

parents 9370f5da f9b42ea1
<template> <template>
<Card :loading="loading"> <Card :loading="loading">
<div class="centent1"> <div class="centent1"> 我的流程 </div>
我的流程
</div>
<div class="centent2"> <div class="centent2">
<div style="display: flex;justify-content: center;width:100%"> <div style="display: flex; justify-content: center">
<div style="margin-left: 18%">我发起的</div>
<div style="margin-left: 30%">我的代办</div>
</div>
<div style="display: flex;justify-content: center;">
<template v-for="(item, index) in CardList2" :key="item.title"> <template v-for="(item, index) in CardList2" :key="item.title">
<Card <div>
size="small" <div style="margin-bottom: 5px"
:loading="loading" ><div v-if="index === 1" style="padding-left: 22px">我发起的</div>
hoverable="true" <div v-else-if="index === 3" style="padding-left: 22px">我的代办</div>
class="md:w-25 w-full !md:mt-0 h-25 md:h-25" <div v-else>&nbsp;</div>
:class="[{ 'md:mr-4': index + 1 < 4, 'mt-4': index > 0,'bg-color':(index % 4) + 1 },`bg-color-${(index % 4) + 1}`]"
>
<div :class="`centent2-1`" class="md:h-20">
<div>
<span class="centent2-1-1">{{item.total}}</span>
<span>{{item.title}}</span>
</div>
</div> </div>
</Card> <Card
<Divider v-if="index === 2" :class="`centent2-2`" type="vertical" class="md:h-25" /> size="small"
:loading="loading"
hoverable="true"
class="md:w-25 w-full !md:mt-0 h-25 md:h-25"
:class="[
{ 'md:mr-4': index + 1 < 4, 'mt-4': index > 0, 'bg-color': (index % 4) + 1 },
`bg-color-${(index % 4) + 1}`,
]"
>
<div :class="`centent2-1`" class="md:h-20">
<div>
<span class="centent2-1-1">{{ item.total }}</span>
<span>{{ item.title }}</span>
</div>
</div>
</Card>
</div>
<Divider v-if="index === 2" :class="`centent2-2`" type="vertical" class="md:h-35" />
</template> </template>
</div> </div>
</div> </div>
...@@ -33,12 +37,17 @@ ...@@ -33,12 +37,17 @@
<List.Item class="centent3" @click=""> <List.Item class="centent3" @click="">
<List.Item.Meta class="centent3-1"> <List.Item.Meta class="centent3-1">
<template #avatar> <template #avatar>
<Icon style="font-size: 20px" v-if="item.icon" :icon="item.icon" :color="item.color" /> <Icon
style="font-size: 20px"
v-if="item.icon"
:icon="item.icon"
:color="item.color"
/>
</template> </template>
<template #title> <template #title>
<div class="centent3-1-1"> <div class="centent3-1-1">
<span>{{ item.title }}</span> <span>{{ item.title }}</span>
<span style="color:rgb(161, 161, 161);">当前审批人: {{item.approver}}</span> <span style="color: rgb(161, 161, 161)">当前审批人: {{ item.approver }}</span>
</div> </div>
</template> </template>
<template #description> <template #description>
...@@ -54,52 +63,52 @@ ...@@ -54,52 +63,52 @@
</Card> </Card>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Tag, Card,Select,List,Divider } from 'ant-design-vue'; import { Tag, Card, Select, List, Divider } from 'ant-design-vue';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import {ListData, TableData2,CardList2} from "./overviewMallResourceData"; import { ListData, TableData2, CardList2 } from './overviewMallResourceData';
import {columns2} from "./overviewMallResource.data"; import { columns2 } from './overviewMallResource.data';
import { ref } from 'vue'; import { ref } from 'vue';
import Icon from '@/components/Icon/Icon.vue'; import Icon from '@/components/Icon/Icon.vue';
const dataList = ref(ListData) const dataList = ref(ListData);
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.centent2{ .centent2 {
.centent2-1{ .centent2-1 {
display: flex; display: flex;
align-items: center;
justify-content: center;
.centent2-1-1{
display:flex;
justify-content: center;
align-items: center; align-items: center;
font-size: 20px; justify-content: center;
.centent2-1-1 {
display: flex;
justify-content: center;
align-items: center;
font-size: 20px;
}
}
.centent2-2 {
margin-right: 20px;
border: 1px solid rgb(240, 242, 243);
} }
} }
.centent2-2{ .centent1 {
margin-right: 20px; display: flex;
border:1px solid rgb(240, 242, 243); margin-bottom: 10px;
font-weight: bold;
} }
} .centent3 {
.centent1{ background-color: rgb(250, 251, 252);
display: flex; margin-top: 10px;
margin-bottom: 10px; .centent3-1 {
font-weight: bold; display: flex !important;
} align-items: center !important;
.centent3{ .centent3-1-1 {
background-color: rgb(250, 251, 252); display: flex;
margin-top: 10px; justify-content: space-between;
.centent3-1{ }
display: flex !important; .centent3-1-2 {
align-items: center !important; display: flex;
.centent3-1-1{ justify-content: space-between;
display: flex; }
justify-content: space-between;
}
.centent3-1-2{
display: flex;
justify-content: space-between;
} }
} }
}
</style> </style>
...@@ -5,7 +5,7 @@ export const columns: BasicColumn[] = [ ...@@ -5,7 +5,7 @@ export const columns: BasicColumn[] = [
title: '名称', title: '名称',
dataIndex: 'name', dataIndex: 'name',
width: 120, width: 120,
// slots: { customRender: 'name' }, slots: { customRender: 'name' },
}, },
{ {
title: '场景', title: '场景',
......
...@@ -72,8 +72,17 @@ ...@@ -72,8 +72,17 @@
<a-button @click="handleGetMetadata" type="primary">获取元数据</a-button> <a-button @click="handleGetMetadata" type="primary">获取元数据</a-button>
</template> </template>
<template #importFile> <template #importFile>
<a-button style="margin-right: 5px">下载文件模板</a-button> <div style="display: flex">
<a-button type="primary">导入文件</a-button> <a-button style="margin-right: 5px">下载文件模板</a-button>
<!-- <a-button type="primary">导入文件</a-button>-->
<BasicUpload
:maxSize="20"
:maxNumber="1"
@change="handleChange"
:api="userImport"
:accept="['.xlsx, .xls']"
/>
</div>
</template> </template>
</BasicForm> </BasicForm>
<div v-if="isGetMeta === 'true'" style="width: 20%"> <div v-if="isGetMeta === 'true'" style="width: 20%">
...@@ -549,10 +558,12 @@ ...@@ -549,10 +558,12 @@
tabularPresentationTableList, tabularPresentationTableList,
compareTableList, compareTableList,
} from './mock'; } from './mock';
import { userImport } from '@/api/system/user/user';
import { router } from '@/router'; import { router } from '@/router';
import { DeleteOutlined } from '@ant-design/icons-vue'; import { DeleteOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import { BasicUpload } from '@/components/Upload';
import GetMetadataModal from '@/views/dataIntegration/dataLoading/dataEntryLake/getMetadataModal.vue'; import GetMetadataModal from '@/views/dataIntegration/dataLoading/dataEntryLake/getMetadataModal.vue';
import DeplysModal from '@/views/dataIntegration/dataLoading/dataEntryLake/DeplysModal.vue'; import DeplysModal from '@/views/dataIntegration/dataLoading/dataEntryLake/DeplysModal.vue';
import CodeEditor from '@/components/CodeEditor/src/CodeEditor.vue'; import CodeEditor from '@/components/CodeEditor/src/CodeEditor.vue';
...@@ -1163,7 +1174,7 @@ ...@@ -1163,7 +1174,7 @@
placeholder: '', placeholder: '',
options: [ options: [
{ label: 'ORC', value: 'ORC' }, { label: 'ORC', value: 'ORC' },
{ label: 'TORC', value: 'ORC' }, { label: 'TORC', value: 'TORC' },
{ label: 'Text', value: 'Text' }, { label: 'Text', value: 'Text' },
], ],
}, },
...@@ -1770,6 +1781,11 @@ ...@@ -1770,6 +1781,11 @@
router.back(); router.back();
} }
function handleChange(list: string[]) {
console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', list);
createMessage.success(`文件上传成功`);
}
function handleDebug() { function handleDebug() {
isEdit.value = 'debug'; isEdit.value = 'debug';
key.value = '4'; key.value = '4';
...@@ -1951,9 +1967,17 @@ ...@@ -1951,9 +1967,17 @@
} }
function handleDeleteRules() { function handleDeleteRules() {
createMessage.success( // createMessage.success(
'批量删除成功!' + getMappingRuleConfigurationRowSelection().selectedRowKeys, // '批量删除成功!' + getMappingRuleConfigurationRowSelection().selectedRowKeys,
); // );
createConfirm({
iconType: 'warning',
title: '删除规则',
content: '是否确认删除规则?',
onOk() {
createMessage.success('批量删除成功!');
},
});
} }
function handleMoveTop(source) { function handleMoveTop(source) {
......
...@@ -81,6 +81,9 @@ ...@@ -81,6 +81,9 @@
/> />
</template> </template>
</template> </template>
<template #name="{ text, record }">
<a @click="handleDetails(record)">{{ text }}</a>
</template>
</BasicTable> </BasicTable>
<MoveFile @register="registerMoveFile" @success="handleMoveSuccess" /> <MoveFile @register="registerMoveFile" @success="handleMoveSuccess" />
<ImportModal @register="registerImport" @success="handleImportSuccess" /> <ImportModal @register="registerImport" @success="handleImportSuccess" />
...@@ -90,7 +93,7 @@ ...@@ -90,7 +93,7 @@
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from 'vue'; import { onMounted, ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import { PageWrapper } from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
...@@ -210,7 +213,7 @@ ...@@ -210,7 +213,7 @@
}); });
} }
/**发布按钮*/ /**发布按钮*/
function handlePublish() { function handlePublish(record) {
createConfirm({ createConfirm({
iconType: 'warning', iconType: 'warning',
title: '确认发布', title: '确认发布',
...@@ -273,6 +276,32 @@ ...@@ -273,6 +276,32 @@
}); });
} }
function handleDetails(record) {
console.log(record);
let scene = ref('');
switch (record.scene) {
case '离线加载':
scene.value = 'databaseOfflineLoading';
break;
case '文件加载':
scene.value = 'fileOfflineLoading';
break;
case '准实时加载':
scene.value = 'dataDischargeLake';
break;
case '数据出湖':
scene.value = '';
break;
default:
}
router.push({
path: '/dataIntegration/dataLoading/dataEntryLake/' + scene.value,
query: {
isEdit: true,
},
});
}
/** 移动*/ /** 移动*/
function handleMoveSuccess({ isMove, values }) { function handleMoveSuccess({ isMove, values }) {
const rowSelection = getRowSelection().selectedRowKeys; const rowSelection = getRowSelection().selectedRowKeys;
......
...@@ -197,19 +197,19 @@ export const cardList = [ ...@@ -197,19 +197,19 @@ export const cardList = [
description: '支持将文件定期加载入数据仓库中', description: '支持将文件定期加载入数据仓库中',
}, },
{ {
title: '非结构化数据离线加载', title: '非结构化数据加载',
scene: 'dataDischargeLake', scene: 'dataDischargeLake',
icon: 'mdi:database-clock', icon: 'mdi:database-clock',
color: '#9064e9', color: '#9064e9',
description: '支持将NoSQL(mongodb)类型数据库数据加载到数据仓库中', description: '支持将NoSQL(mongodb)类型数据库数据加载到数据仓库中',
}, },
{ // {
title: '数据库到文件', // title: '数据库到文件',
scene: 'databaseOfflineLoading', // scene: 'databaseOfflineLoading',
icon: 'icon-park-solid:data-switching', // icon: 'icon-park-solid:data-switching',
color: '#9064e9', // color: '#9064e9',
description: '支持数仓的数据库数据定期卸载到指定文件系统的文件夹', // description: '支持数仓的数据库数据定期卸载到指定文件系统的文件夹',
}, // },
]; ];
export const cardRuleList = [ export const cardRuleList = [
......
...@@ -183,12 +183,12 @@ export const fieldNameMappingRuleColumns: BasicColumn[] = [ ...@@ -183,12 +183,12 @@ export const fieldNameMappingRuleColumns: BasicColumn[] = [
export const batchScaleNameMappingColumns: BasicColumn[] = [ export const batchScaleNameMappingColumns: BasicColumn[] = [
{ {
title: '源表名', title: '源表名',
dataIndex: 'tableName', dataIndex: 'fieldName',
labelWidth: 160, labelWidth: 160,
}, },
{ {
title: '目标表名', title: '目标表名',
dataIndex: 'targetTableName', dataIndex: 'targetFieldName',
}, },
]; ];
......
...@@ -27,12 +27,7 @@ ...@@ -27,12 +27,7 @@
@click="handlePublish" @click="handlePublish"
>发布</a-button >发布</a-button
> >
<a-button <a-button type="primary" @click="handleBaseImport">从元数据导入</a-button>
type="primary"
:disabled="getRowSelection().selectedRowKeys <= 0"
@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>
<a-button type="primary" @click="handleCreateFolder">新建文件夹</a-button> <a-button type="primary" @click="handleCreateFolder">新建文件夹</a-button>
...@@ -99,10 +94,7 @@ ...@@ -99,10 +94,7 @@
import { useGo } from '@/hooks/web/usePage'; import { useGo } from '@/hooks/web/usePage';
import { useRoute, onBeforeRouteLeave, useRouter } from 'vue-router'; import { useRoute, onBeforeRouteLeave, useRouter } from 'vue-router';
import { useFilterStore } from '@/store/modules/filterData'; import { useFilterStore } from '@/store/modules/filterData';
import { import { TreesData, TreeSystem } from '@/views/dataWarehousePlanning/physicalModel/modelData';
TreesData,
TreeSystem
} from '@/views/dataWarehousePlanning/physicalModel/modelData';
import ModelTree from '@/views/dataWarehousePlanning/physicalModel/ModelTree.vue'; import ModelTree from '@/views/dataWarehousePlanning/physicalModel/ModelTree.vue';
import RadioButtonGroup from '@/components/Form/src/components/RadioButtonGroup.vue'; import RadioButtonGroup from '@/components/Form/src/components/RadioButtonGroup.vue';
import ModelMoreCreate from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelMoreCreate.vue'; import ModelMoreCreate from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelMoreCreate.vue';
......
...@@ -10,99 +10,96 @@ ...@@ -10,99 +10,96 @@
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, unref } from 'vue'; import { ref, computed, unref } 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 {physicalModelAdd } from './model.data'; import { physicalModelAdd } from './model.data';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { TreeData } from '@/views/dataWarehousePlanning/physicalModel/modelData'; import { TreeData } from '@/views/dataWarehousePlanning/physicalModel/modelData';
import { router } from '@/router'; import { router } from '@/router';
defineOptions({ name: 'ModelAdd' }); defineOptions({ name: 'ModelAdd' });
const emit = defineEmits(['success', 'register']); const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const isUpdate = ref(true); const isUpdate = ref(true);
const isMove = ref(false); const isMove = ref(false);
const rowId = ref(''); const rowId = ref('');
//获取接口数据并放在下拉框里(这里是打开了一个弹框) //获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单 //初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({ const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100, labelWidth: 100,
baseColProps: { lg: 12, md: 24 }, baseColProps: { lg: 12, md: 24 },
schemas: physicalModelAdd, schemas: physicalModelAdd,
showActionButtonGroup: false, showActionButtonGroup: false,
actionColOptions: { actionColOptions: {
span: 23, span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
isMove.value = !!data?.isMove;
if (unref(isUpdate)) {
// 获取行数据的id
rowId.value = data.record.businessId;
// 塞值
setFieldsValue({
...data.record,
});
}
const treeList = handleTree(TreeData, 'businessId', undefined, undefined, undefined);
console.log('treeList', treeList);
updateSchema([
{
field: 'modelId',
componentProps: {
treeData: treeList,
},
}, },
]); });
}); //初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
const getTitle = computed(() => '新建文件夹'); resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
isMove.value = !!data?.isMove;
if (unref(isUpdate)) {
// 获取行数据的id
rowId.value = data.record.businessId;
// 塞值
setFieldsValue({
...data.record,
});
}
function handleTree(data, id, parentId, children, rootId) { const treeList = handleTree(TreeData, 'businessId', undefined, undefined, undefined);
id = id || 'id'; console.log('treeList', treeList);
parentId = parentId || 'parentId'; updateSchema([
children = children || 'children'; {
rootId = field: 'modelId',
rootId || componentProps: {
Math.min.apply( treeData: treeList,
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
}
/**确定按钮*/ const getTitle = computed(() => '新建文件夹');
function handleSubmit() {
router.push({
path: '/metaModel/physicsModel/EditRowTable',
query: {
}, 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;
}
closeModal() /**确定按钮*/
} function handleSubmit() {
router.push({
path: '/metaModel/physicsModel/EditRowTable',
query: {},
});
closeModal();
}
</script> </script>
...@@ -169,6 +169,7 @@ export const TreeData: any[] = [ ...@@ -169,6 +169,7 @@ export const TreeData: any[] = [
delFlag: '0', delFlag: '0',
flag: '1', flag: '1',
businessId: 100, businessId: 100,
value: 100,
modelName: '物理模型', modelName: '物理模型',
parentId: 0, parentId: 0,
'code:': '001', 'code:': '001',
...@@ -182,44 +183,52 @@ export const TreeData: any[] = [ ...@@ -182,44 +183,52 @@ export const TreeData: any[] = [
}, },
{ {
businessId: 101, businessId: 101,
value: 101,
modelName: '个人工作区', modelName: '个人工作区',
parentId: 100, parentId: 100,
}, },
{ {
businessId: 201, businessId: 201,
value: 201,
modelName: '数仓1', modelName: '数仓1',
parentId: 101, parentId: 101,
}, },
{ {
businessId: 301, businessId: 301,
value: 301,
modelName: 'argodb_test', modelName: 'argodb_test',
parentId: 201, parentId: 201,
}, },
{ {
businessId: 401, businessId: 401,
value: 401,
modelName: 'dw_prd_contract_f', modelName: 'dw_prd_contract_f',
parentId: 301, parentId: 301,
}, },
{ {
businessId: 102, businessId: 102,
value: 102,
modelName: '共享工作区', modelName: '共享工作区',
parentId: 100, parentId: 100,
}, },
{ {
businessId: 202, businessId: 202,
value: 202,
modelName: '数仓2', modelName: '数仓2',
parentId: 102, parentId: 102,
}, },
{ {
businessId: 302, businessId: 302,
value: 302,
modelName: 'argodb_test', modelName: 'argodb_test',
parentId: 202, parentId: 202,
}, },
{ {
businessId: 402, businessId: 402,
value: 402,
modelName: 'dw_prd_contract_f', modelName: 'dw_prd_contract_f',
parentId: 302, parentId: 302,
}, },
......
<template>
<div class="m-4 mr-0 overflow-hidden bg-white">
<BasicTree
ref="treeRef"
treeWrapperClassName="h-[calc(100%-35px)] overflow-auto"
: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 '@/views/dataWarehousePlanning/physicalModel/modelData';
defineOptions({ name: 'DeptTree' });
const emit = defineEmits(['select']);
const prop = defineProps({
checkable: {
type: Boolean,
default: false,
},
});
const treeData = ref<TreeItem[]>([]);
const treeRef = ref<Nullable<TreeActionType>>(null);
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(keys) {
emit('select', keys[0]);
}
onMounted(() => {
fetch();
});
</script>
<template>
<BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import {dataSourceFormSchema, modelFormSchema} from './model.data';
import { useMessage } from '@/hooks/web/useMessage';
import { TreeData } from '@/views/dataWarehousePlanning/physicalModel/modelData';
import {ref, unref} from "vue";
import {physicalModelAdd} from "@/views/dataWarehousePlanning/physicalModel/model.data";
const { createMessage } = useMessage();
const getTitle = '关联元数据';
const isUpdate = ref(true);
const rowId = ref('');
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 12, md: 24 },
schemas: dataSourceFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 获取行数据的id
rowId.value = data.record.businessId;
// 塞值
await setFieldsValue({
...data.record,
});
}
const treeList = handleTree(TreeData, 'businessId', undefined, undefined, undefined);
console.log('treeList', treeList);
await updateSchema([
{
field: 'modelId',
componentProps: {
treeData: treeList,
},
},
]);
});
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 handleSubmit() {
closeModal();
createMessage.success('关联成功');
}
</script>
<style scoped></style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<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">全屏</a-button>
<a-button type="primary">退出</a-button> <a-button type="primary" @click="handleQuit">退出</a-button>
</template> </template>
<img src="../../../../../assets/images/assetER.png" style="width: 100%" /> <img src="../../../../../assets/images/assetER.png" style="width: 100%" />
</PageWrapper> </PageWrapper>
...@@ -36,6 +36,9 @@ ...@@ -36,6 +36,9 @@
function handleGoBack() { function handleGoBack() {
router.go(-1); router.go(-1);
} }
function handleQuit() {
router.go(-1);
}
function handleAdd() { function handleAdd() {
openModal(true); openModal(true);
} }
......
<template>
<BasicModal
width="40%"
height="200px"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { createSqlFormSchema } from './model.data';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
const getTitle = '关联元数据';
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 12, md: 24 },
schemas: createSqlFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {});
function handleSubmit() {
closeModal();
createMessage.success('新建成功');
}
</script>
<style scoped></style>
...@@ -401,14 +401,16 @@ ...@@ -401,14 +401,16 @@
/** 发布*/ /** 发布*/
function handlePublish() { function handlePublish() {
console.log('editStatus', editStatus); createConfirm({
if (editStatus === '编辑中') { iconType: 'info',
openFailModal(true); title: '发布',
} else { content: '确认进入到申请发布页面?',
push({ onOk() {
path: '/dataWarehousePlanning/physicalModel/upload', push({
}); path: '/dataWarehousePlanning/physicalModel/upload',
} });
},
});
} }
function handleGoBack() { function handleGoBack() {
......
import { BasicColumn, FormSchema } from '@/components/Table'; import { BasicColumn, FormSchema } from '@/components/Table';
import { DescItem } from '@/components/Description'; import { DescItem } from '@/components/Description';
import { TreeData } from '@/views/metadata/metadataData';
// 引入开关组件 // 引入开关组件
export const entityColumns: BasicColumn[] = [ export const entityColumns: BasicColumn[] = [
{ {
...@@ -74,6 +75,144 @@ export const PhysicalColumns: BasicColumn[] = [ ...@@ -74,6 +75,144 @@ export const PhysicalColumns: BasicColumn[] = [
width: 150, width: 150,
}, },
]; ];
export const dataSourceFormSchema: FormSchema[] = [
{
field: 'modelId',
label: '关联元数据',
component: 'TreeSelect',
colProps: { lg: 24, md: 24 },
componentProps: {
fieldNames: {
label: 'workSpaceName',
value: 'businessId',
},
treeData: handleTree(TreeData, 'businessId', undefined, undefined, undefined),
},
},
];
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;
}
export const createSqlFormSchema: FormSchema[] = [
{
field: 'sqlName',
label: '名称',
component: 'Input',
colProps: { lg: 24, md: 24 },
},
{
field: 'sqlPath',
label: '路径',
component: 'TreeSelect',
componentProps: {
treeData: [
{
title: 'DMP_admin-个人工作区',
value: '0-0-0',
icon: 'ion:desktop-outline',
children: [
{ title: 'employee', value: '0-0-0-1', icon: 'ant-design:line-chart-outlined' },
{ title: 'employee1', value: '0-0-0-2', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '共享工作区',
value: '0-0-1',
icon: 'ion:desktop-outline',
children: [
{ title: 'employee2', value: '0-0-0-3', icon: 'ant-design:line-chart-outlined' },
{ title: 'employee3', value: '0-0-0-4', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '商城工作区',
value: '0-0-3',
icon: 'ion:desktop-outline',
children: [
{ title: 'employee4', value: '0-0-0-7', icon: 'ant-design:line-chart-outlined' },
{ title: 'employee5', value: '0-0-0-8', icon: 'ant-design:line-chart-outlined' },
],
},
],
},
colProps: { lg: 24 },
},
{
field: 'relateDes',
label: '关联描述',
component: 'Input',
colProps: { lg: 24, md: 24 },
},
];
export const relateSqlFormSchema: FormSchema[] = [
{
field: 'relateSql',
label: '关联Sql文件',
component: 'TreeSelect',
componentProps: {
treeData: [
{
title: 'DMP_admin-个人工作区',
value: '0-0-0',
icon: 'ion:desktop-outline',
children: [
{ title: 'employee', value: '0-0-0-1', icon: 'ant-design:line-chart-outlined' },
{ title: 'employee1', value: '0-0-0-2', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '共享工作区',
value: '0-0-1',
icon: 'ion:desktop-outline',
children: [
{ title: 'employee2', value: '0-0-0-3', icon: 'ant-design:line-chart-outlined' },
{ title: 'employee3', value: '0-0-0-4', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '商城工作区',
value: '0-0-3',
icon: 'ion:desktop-outline',
children: [
{ title: 'employee4', value: '0-0-0-7', icon: 'ant-design:line-chart-outlined' },
{ title: 'employee5', value: '0-0-0-8', icon: 'ant-design:line-chart-outlined' },
],
},
],
},
colProps: { lg: 24 },
},
{
field: 'relateDes',
label: '关联描述',
component: 'InputTextArea',
colProps: { lg: 24, md: 24 },
},
];
export const SqlDevelopColumns: BasicColumn[] = [ export const SqlDevelopColumns: BasicColumn[] = [
{ {
...@@ -375,13 +514,10 @@ export const piblishCreateFormSchema: any[] = [ ...@@ -375,13 +514,10 @@ export const piblishCreateFormSchema: any[] = [
{ {
field: 'editDataBase', field: 'editDataBase',
label: '待修改元数据', label: '待修改元数据',
component: 'InputSearch', component: 'Select',
componentProps: { componentProps: {
itemIcon: 'settings-outline', itemIcon: 'settings-outline',
options: [ options: [{ label: 'dw_prd_oontract_quot_h_s', value: 'dw_prd_oontract_quot_h_s' }],
{ label: '版本V1.0', value: '版本V1.0' },
{ label: '版本V1.1', value: '版本V1.1' },
],
}, },
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
required: true, required: true,
...@@ -556,7 +692,6 @@ export const phycomparisonInfoSchema: DescItem[] = [ ...@@ -556,7 +692,6 @@ export const phycomparisonInfoSchema: DescItem[] = [
}, },
]; ];
export const failColumns: BasicColumn[] = [ export const failColumns: BasicColumn[] = [
{ {
title: '模型名称', title: '模型名称',
......
...@@ -76,14 +76,6 @@ export const entityData: any[] = [ ...@@ -76,14 +76,6 @@ export const entityData: any[] = [
syncTime: '2024-11-01 13:44:16', syncTime: '2024-11-01 13:44:16',
operateName: 'user', operateName: 'user',
}, },
{
name: 'pltable_yca12',
dataBase: 'INCEPTOR',
modelId: '/sdfasdf/y_test/pltable_yca12',
relateTime: '2023/12/30 12:21:09',
syncTime: '2024-02-11 10:14:16',
operateName: 'user',
},
]; ];
export const PhysicalData: any[] = [ export const PhysicalData: any[] = [
......
<template> <template>
<PageWrapper title="模型关系" contentBackground headerSticky @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">全屏</a-button>
<a-button type="primary">退出</a-button> <a-button type="primary" @click="handleQuit">退出</a-button>
</template> </template>
<template #footer> <template #footer>
<div style="display: flex"> <div style="display: flex">
...@@ -26,21 +26,56 @@ ...@@ -26,21 +26,56 @@
/></a-button> /></a-button>
</div> </div>
<div style="flex: 4"> <div style="flex: 4">
<img <div :class="divHeight > 57 ? 'imgclass1' : 'imgclass2'">
v-if="modelLevel === '1' || modelLevel === '2'" <img src="../../../../../assets/images/ERchart.jpg" class="erchart-img" />
src="../../../../../assets/images/ERchart.jpg" </div>
class="erchart-img" <div v-show="modelLevel === '3' || modelLevel === '4'" ref="info">
/> <CollapseContainer title="基础收缩示例">
<img <Tabs v-model:activeKey="tabsKey">
v-if="modelLevel === '3' || modelLevel === '4'" <Tabs.TabPane key="1" tab="基本信息">
src="../../../../../assets/images/modelrelate.png" <div class="comparsion-title">表信息</div>
class="erchart-img" <Description
/> size="middle"
<img :bordered="false"
v-if="modelLevel === '5' || modelLevel === '6'" :column="2"
src="../../../../../assets/images/modelrelate1.png" :data="infoData"
class="erchart-img" :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>
</CollapseContainer>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -56,24 +91,75 @@ ...@@ -56,24 +91,75 @@
import { chartTreeData } from './relate.data'; import { chartTreeData } from './relate.data';
import CrossModel from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelRelationship/crossModel.vue'; import CrossModel from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelRelationship/crossModel.vue';
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import { ref } from 'vue'; import { computed, onBeforeUnmount, onMounted, ref } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { Divider, Tabs } from 'ant-design-vue';
import { CollapseContainer } from '@/components/Container';
import { BasicForm } from '@/components/Form';
import {
areaFormSchema,
areaInfoData,
bucketFormSchema,
bucketInfoData,
checkFormSchema,
infoData,
partitioncheckFormSchema,
partitioncheckinfoData,
} from '@/views/dataWarehousePlanning/physicalModel/upload/uploadData';
import { Description } from '@/components/Description';
import { BasicTable, useTable } from '@/components/Table';
import { checkinfoData } from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelData';
import { checkcolumnsDetail } from '@/views/dataWarehousePlanning/physicalModel/model.data';
// 模态框 // 模态框
const [crossModal, { openModal }] = useModal(); const [crossModal, { openModal }] = useModal();
const tabsKey = ref('1');
let modelLevel = ref('1'); let modelLevel = ref('1');
// 获取目标 div
const height = ref(0);
const [
registerTable,
{ reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection },
] = useTable({
scroll: { y: 200 },
api: async (params) => {
console.log('params:', params);
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: checkinfoData.length,
code: '',
message: '',
data: checkinfoData,
};
return { ...response };
},
columns: checkcolumnsDetail,
showIndexColumn: false,
rowSelection: false,
pagination: true,
useSearchForm: false,
showTableSetting: false,
bordered: true,
});
function handleSelect(key) { function handleSelect(key) {
if (key[0] !== null && key[0] !== undefined) { if (key[0] !== null && key[0] !== undefined) {
modelLevel.value = key[0]; modelLevel.value = key[0];
} else { } else {
modelLevel.value = '0'; modelLevel.value = '0';
} }
console.log('dasd', modelLevel.value);
} }
function handleAdd() { function handleAdd() {
openModal(true); openModal(true);
} }
function handleQuit() {
router.go(-1);
}
const router = useRouter(); const router = useRouter();
function handleGoBack() { function handleGoBack() {
router.go(-1); router.go(-1);
...@@ -88,10 +174,57 @@ ...@@ -88,10 +174,57 @@
// value: '当前模型实体', // value: '当前模型实体',
// }, // },
// ]; // ];
const divHeight = ref(0); // Store the height of the div
const info = ref(null); // Reference to the info div
// Function to update divHeight based on the element's height
const updateHeight = () => {
if (info.value) {
divHeight.value = info.value.offsetHeight;
}
};
onMounted(() => {
// Set the initial height on mount
if (info.value) {
updateHeight();
// Set up ResizeObserver to monitor the size changes of the div
const resizeObserver = new ResizeObserver(updateHeight);
resizeObserver.observe(info.value);
// Cleanup observer when the component is unmounted
onBeforeUnmount(() => {
resizeObserver.disconnect();
});
}
});
</script> </script>
<style scoped> <style scoped>
.erchart-img { .erchart-img {
height: calc(100vh - 200px); width: 100%;
object-fit: cover;
}
.comparsion-title {
font-size: 14px;
font-weight: 550;
margin-bottom: 15px;
}
.info {
width: 100%;
padding: 10px;
background-color: lightblue;
resize: both;
overflow: auto;
}
.imgclass1 {
height: 300px;
overflow-y: hidden;
}
.imgclass2 {
height: 700px;
overflow-y: hidden;
} }
</style> </style>
<template>
<BasicModal
width="40%"
height="200px"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { relateSqlFormSchema} from './model.data';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
const getTitle = '关联元数据';
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 12, md: 24 },
schemas: relateSqlFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {});
function handleSubmit() {
closeModal();
createMessage.success('关联成功');
}
</script>
<style scoped></style>
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
</template> </template>
</template> </template>
</BasicTable> </BasicTable>
<SourceDataModal @register="dataModal" />
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -32,15 +34,19 @@ ...@@ -32,15 +34,19 @@
import { entityData } from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelData'; import { entityData } from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelData';
import EntityModel from './entityModel.vue'; import EntityModel from './entityModel.vue';
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import { useMessage } from '@/hooks/web/useMessage';
import SourceDataModal
from "@/views/dataWarehousePlanning/physicalModel/modelDetail/SourceDataModal.vue";
const { push } = useRouter(); const { push } = useRouter();
const { createMessage, createConfirm } = useMessage();
defineOptions({ name: 'AccountManagement' }); defineOptions({ name: 'AccountManagement' });
const props = defineProps({ const props = defineProps({
editFlag: Boolean, editFlag: Boolean,
}); });
// 模态框 // 模态框
const [entityModal, { openModal }] = useModal(); const [dataModal, { openModal }] = useModal();
// 实体新增 // 实体新增
function handleEntityModel() { function handleEntityModel() {
openModal(true, { openModal(true, {
...@@ -48,7 +54,20 @@ ...@@ -48,7 +54,20 @@
}); });
} }
// 实体编辑 // 实体编辑
function handleEntityEditModel(record: Recordable) {} function handleEntityEditModel(record: Recordable) {
createConfirm({
iconType: 'warning',
title: '解除绑定',
okText: '确定',
content: '确定解除与元数据的关联关系吗?',
onOk() {
createMessage.success('解除绑定成功!');
},
});
}
function handleCrossModel() {
openModal();
}
function entitySuccess({ isUpdate, values }) { function entitySuccess({ isUpdate, values }) {
if (isUpdate) { if (isUpdate) {
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中 // 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
...@@ -70,7 +89,7 @@ ...@@ -70,7 +89,7 @@
] = useTable({ ] = useTable({
title: '关联元数据', title: '关联元数据',
// 定高 // 定高
scroll: {y: 150}, scroll: { y: 150 },
// 数据 // 数据
api: async (params) => { api: async (params) => {
console.log('params:', params); console.log('params:', params);
...@@ -83,7 +102,7 @@ ...@@ -83,7 +102,7 @@
message: '', message: '',
data: entityData, data: entityData,
}; };
return {...response}; return { ...response };
}, },
rowKey: 'businessId', rowKey: 'businessId',
// 列 // 列
......
...@@ -2,8 +2,15 @@ ...@@ -2,8 +2,15 @@
<div> <div>
<BasicTable @register="registerTable" :searchInfo="searchInfo"> <BasicTable @register="registerTable" :searchInfo="searchInfo">
<template #toolbar> <template #toolbar>
<a-button style="color: #0960bd" type="link"><PlusOutlined />新建Sql文件</a-button> <a-button style="color: #0960bd" type="link" @click="handleCreateSql"
<a-button type="link" @click="handleRelieve" :disabled="getRowSelection().selectedRowKeys <= 0">批量解绑</a-button> ><PlusOutlined />新建Sql文件</a-button
>
<a-button
type="link"
@click="handleRelieve"
:disabled="getRowSelection().selectedRowKeys <= 0"
>批量解绑</a-button
>
<a-button style="color: #0960bd" type="link" @click="handleCrossModel" <a-button style="color: #0960bd" type="link" @click="handleCrossModel"
><Icon icon="ant-design:link-outlined" />关联Sql文件</a-button ><Icon icon="ant-design:link-outlined" />关联Sql文件</a-button
> >
...@@ -21,6 +28,8 @@ ...@@ -21,6 +28,8 @@
</template> </template>
</template> </template>
</BasicTable> </BasicTable>
<CreateSqlModal @register="createSqlModal" />
<RelateSqlModal @register="relateSqlModal" />
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -38,6 +47,8 @@ ...@@ -38,6 +47,8 @@
} from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelData'; } from '@/views/dataWarehousePlanning/physicalModel/modelDetail/modelData';
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import { DeleteTwoTone, PlusOutlined } from '@ant-design/icons-vue'; import { DeleteTwoTone, PlusOutlined } from '@ant-design/icons-vue';
import CreateSqlModal from '@/views/dataWarehousePlanning/physicalModel/modelDetail/createSqlModal.vue';
import RelateSqlModal from '@/views/dataWarehousePlanning/physicalModel/modelDetail/relateSqlModal.vue';
const { push } = useRouter(); const { push } = useRouter();
const { createMessage, createConfirm } = useMessage(); const { createMessage, createConfirm } = useMessage();
...@@ -47,15 +58,28 @@ ...@@ -47,15 +58,28 @@
editFlag: Boolean, editFlag: Boolean,
}); });
// 模态框 // 模态框
const [entityModal, { openModal }] = useModal(); const [createSqlModal, { openModal: openCreateModal }] = useModal();
// 实体新增 const [relateSqlModal, { openModal: openRelateModal }] = useModal();
function handleEntityModel() { // 实体编辑
openModal(true, { function handleEntityEditModel(record: Recordable) {
isUpdate: false, createConfirm({
iconType: 'warning',
title: '解除绑定',
okText: '确定',
content: '确定解除与Sql开发的关联关系吗?',
onOk() {
createMessage.success('解除绑定成功!');
},
}); });
} }
// 实体编辑
function handleEntityEditModel(record: Recordable) {} function handleCreateSql() {
openCreateModal();
}
function handleCrossModel() {
openRelateModal();
}
function entitySuccess({ isUpdate, values }) { function entitySuccess({ isUpdate, values }) {
if (isUpdate) { if (isUpdate) {
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中 // 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
...@@ -77,7 +101,7 @@ ...@@ -77,7 +101,7 @@
] = useTable({ ] = useTable({
title: 'Sql开发', title: 'Sql开发',
// 定高 // 定高
scroll: {y: 150}, scroll: { y: 150 },
// 数据 // 数据
api: async (params) => { api: async (params) => {
console.log('params:', params); console.log('params:', params);
...@@ -90,7 +114,7 @@ ...@@ -90,7 +114,7 @@
message: '', message: '',
data: sqlDevelopData, data: sqlDevelopData,
}; };
return {...response}; return { ...response };
}, },
rowKey: 'businessId', rowKey: 'businessId',
// 列 // 列
......
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
/> />
<Divider style="width: 50%" /> <Divider style="width: 50%" />
<div class="comparsion-title">列信息</div> <div class="comparsion-title">列信息</div>
<BasicTable @register="registerTable" :searchInfo="searchInfo" /> <BasicTable @register="registerTable" :searchInfo="searchInfo" />
</div> </div>
</template> </template>
......
...@@ -72,7 +72,9 @@ ...@@ -72,7 +72,9 @@
import BasicTable from '@/components/Table/src/BasicTable.vue'; import BasicTable from '@/components/Table/src/BasicTable.vue';
import { useTable } from '@/components/Table'; import { useTable } from '@/components/Table';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
const router = useRouter(); const router = useRouter();
const { push } = useRouter(); const { push } = useRouter();
const basicVersion = ref('V1.0 2023-06-15 15:34:40'); const basicVersion = ref('V1.0 2023-06-15 15:34:40');
...@@ -91,6 +93,7 @@ ...@@ -91,6 +93,7 @@
} }
function handleSubmit() { function handleSubmit() {
router.go(-1); router.go(-1);
createMessage.success('提交成功');
} }
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({ const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100, labelWidth: 100,
......
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