Commit 4599edb7 authored by chenjiahao's avatar chenjiahao

数据加载完善

parent 5f0b11cf
...@@ -38,6 +38,10 @@ ...@@ -38,6 +38,10 @@
<template #getMetadata> <template #getMetadata>
<a-button @click="handleGetMetadata" type="primary">获取元数据</a-button> <a-button @click="handleGetMetadata" type="primary">获取元数据</a-button>
</template> </template>
<template #importFile>
<a-button style="margin-right: 5px">下载文件模板</a-button>
<a-button type="primary">导入文件</a-button>
</template>
</BasicForm> </BasicForm>
<div style="width: 20%; padding: 0 5px 5px"> <div style="width: 20%; padding: 0 5px 5px">
<BasicTree <BasicTree
...@@ -69,6 +73,19 @@ ...@@ -69,6 +73,19 @@
</div> </div>
</div> </div>
<BasicForm @register="registerLoadingStrategyForm" style="width: 50%"> <BasicForm @register="registerLoadingStrategyForm" style="width: 50%">
<template #incrementalRepresentationColumnAlert>
<Alert
show-icon
style="font-size: 12px"
message="增量标识列只支持日期类型和整数型字段。"
type="info"
/>
</template>
<template #site>
<Checkbox v-model:checked="siteChecked"> 位点 </Checkbox>
<a-input v-if="siteChecked" style="width: 120px; margin-right: 10px" />
<Checkbox v-if="siteChecked">清理位点</Checkbox>
</template>
<template #quantityBasedAlert> <template #quantityBasedAlert>
<Alert <Alert
show-icon show-icon
...@@ -514,6 +531,7 @@ ...@@ -514,6 +531,7 @@
const deleteOtherConfigurationIds = ref([]); const deleteOtherConfigurationIds = ref([]);
const unfoldAdvancedConfiguration = ref(false); const unfoldAdvancedConfiguration = ref(false);
const unfoldConfigurationTableSelect = ref(false); const unfoldConfigurationTableSelect = ref(false);
const siteChecked = ref(false);
const isEdit = ref(true); const isEdit = ref(true);
const previewCustomSQL = ref('SELECT * FROM user_info,customer_details,order_history'); const previewCustomSQL = ref('SELECT * FROM user_info,customer_details,order_history');
let startId = ref(); let startId = ref();
...@@ -562,6 +580,11 @@ ...@@ -562,6 +580,11 @@
componentProps: ({ formModel, formActionType }) => ({ componentProps: ({ formModel, formActionType }) => ({
onChange: () => { onChange: () => {
loadType.value = formModel.loadType; loadType.value = formModel.loadType;
const flag = formModel.loadType === '增量数据加载';
updateSchema([{ field: 'incrementalRepresentationColumn', ifShow: flag }]);
updateSchema([{ field: 'site', ifShow: flag }]);
updateSchema([{ field: 'incrementalRepresentationColumnAlert', ifShow: flag }]);
updateSchema([{ field: 'incrementalRepresentationColumnAlertDivider', ifShow: flag }]);
}, },
options: [ options: [
{ label: '全量数据加载', value: '全量数据加载' }, { label: '全量数据加载', value: '全量数据加载' },
...@@ -579,6 +602,7 @@ ...@@ -579,6 +602,7 @@
isParsingSQL.value = false; isParsingSQL.value = false;
metadataAcquisitionModeFlag.value = formModel.metadataAcquisitionMode === '自定义SQL'; metadataAcquisitionModeFlag.value = formModel.metadataAcquisitionMode === '自定义SQL';
const flag = !metadataAcquisitionModeFlag.value; const flag = !metadataAcquisitionModeFlag.value;
const isImport = formModel.metadataAcquisitionMode === '导入元数据文件';
updateSchema([{ field: 'filterCondition', ifShow: flag && customSQLFlag.value }]); updateSchema([{ field: 'filterCondition', ifShow: flag && customSQLFlag.value }]);
updateSchema([{ field: 'notCustomSQLTable', ifShow: flag && customSQLFlag.value }]); updateSchema([{ field: 'notCustomSQLTable', ifShow: flag && customSQLFlag.value }]);
updateSchema([{ field: 'customSQL', ifShow: flag }]); updateSchema([{ field: 'customSQL', ifShow: flag }]);
...@@ -593,9 +617,10 @@ ...@@ -593,9 +617,10 @@
]); ]);
updateSchema([{ field: 'sourceDataTableName', ifShow: !flag }]); updateSchema([{ field: 'sourceDataTableName', ifShow: !flag }]);
updateSchema([{ field: 'isBatchCustomSQLTable', ifShow: !flag && isParsingSQL.value }]); updateSchema([{ field: 'isBatchCustomSQLTable', ifShow: !flag && isParsingSQL.value }]);
formActionType.updateSchema([{ field: 'dataBase', ifShow: flag }]); formActionType.updateSchema([{ field: 'dataBase', ifShow: flag && !isImport }]);
formActionType.updateSchema([{ field: 'metadataType', ifShow: flag }]); formActionType.updateSchema([{ field: 'metadataType', ifShow: flag && !isImport }]);
formActionType.updateSchema([{ field: 'getMetadata', ifShow: flag }]); formActionType.updateSchema([{ field: 'getMetadata', ifShow: flag && !isImport }]);
formActionType.updateSchema([{ field: 'importFile', ifShow: flag && isImport }]);
}, },
options: [ options: [
{ label: '从JDBC获取元数据', value: '从JDBC获取元数据' }, { label: '从JDBC获取元数据', value: '从JDBC获取元数据' },
...@@ -671,6 +696,12 @@ ...@@ -671,6 +696,12 @@
label: ' ', label: ' ',
slot: 'getMetadata', slot: 'getMetadata',
}, },
{
field: 'importFile',
label: ' ',
slot: 'importFile',
ifShow: false,
},
{ {
field: 'maximumNumberOfDatabaseConnections', field: 'maximumNumberOfDatabaseConnections',
label: '源库最大连接数', label: '源库最大连接数',
...@@ -682,6 +713,30 @@ ...@@ -682,6 +713,30 @@
]; ];
const LoadingStrategyFormSchema: FormSchema[] = [ const LoadingStrategyFormSchema: FormSchema[] = [
{
field: 'incrementalRepresentationColumn',
label: '增量标识列',
component: 'Input',
required: true,
ifShow: false,
},
{
field: 'incrementalRepresentationColumnAlert',
label: ' ',
slot: 'incrementalRepresentationColumnAlert',
ifShow: false,
},
{
field: 'site',
label: ' ',
slot: 'site',
ifShow: false,
},
{
field: 'incrementalRepresentationColumnAlertDivider',
component: 'Divider',
ifShow: false,
},
{ {
field: 'loadingStrategy', field: 'loadingStrategy',
label: '加载策略', label: '加载策略',
...@@ -791,7 +846,7 @@ ...@@ -791,7 +846,7 @@
}, },
{ {
field: 'sourceDataTableName', field: 'sourceDataTableName',
label: '源端数据表名', label: '源端标识表名',
component: 'Input', component: 'Input',
colProps: { lg: 11, md: 11 }, colProps: { lg: 11, md: 11 },
componentProps: { componentProps: {
...@@ -1629,6 +1684,10 @@ ...@@ -1629,6 +1684,10 @@
router.back(); router.back();
} }
function handleDebug() {
console.log('siteChecked', siteChecked);
}
async function handleSave() { async function handleSave() {
try { try {
const isValid = await validateSourceSideConfigurationForm(); const isValid = await validateSourceSideConfigurationForm();
......
...@@ -185,7 +185,7 @@ export const cardList = [ ...@@ -185,7 +185,7 @@ export const cardList = [
{ {
title: '数据库离线加载', title: '数据库离线加载',
scene: 'databaseOfflineLoading', scene: 'databaseOfflineLoading',
icon: 'iconoir:db', icon: 'majesticons:data-minus',
color: '#9064e9', color: '#9064e9',
description: '支持数据加载导数据仓库(数据加载功能),也支持数仓将数据写入业务库(卸载功能)', description: '支持数据加载导数据仓库(数据加载功能),也支持数仓将数据写入业务库(卸载功能)',
}, },
...@@ -196,11 +196,20 @@ export const cardList = [ ...@@ -196,11 +196,20 @@ export const cardList = [
color: '#9064e9', color: '#9064e9',
description: '支持将文件定期加载入数据仓库中', description: '支持将文件定期加载入数据仓库中',
}, },
// { {
// title: 'Vben Admin', title: '准实时加载',
// icon: 'logos:vue', scene: 'dataDischargeLake',
// color: '#1890ff', icon: 'mdi:database-clock',
// }, color: '#9064e9',
description: '支持从数仓将数据加载到传统关系数据库中,支持目标端(Mysql,Oracle等)。',
},
{
title: '数据出湖',
scene: 'databaseOfflineLoading',
icon: 'icon-park-solid:data-switching',
color: '#9064e9',
description: '支持从数仓将数据加载到传统关系数据库中,支持目标端(Mysql,Oracle等)。',
},
]; ];
export const cardRuleList = [ export const cardRuleList = [
......
...@@ -24,6 +24,12 @@ ...@@ -24,6 +24,12 @@
<div class="sceneSelectionDescription"> <div class="sceneSelectionDescription">
{{ item.description }} {{ item.description }}
</div> </div>
<div v-if="item.title === '文件离线加载'">
<RadioGroup button-style="solid" v-model:value="modeValue">
<Radio value="Excel文件"> Excel文件 </Radio>
<Radio value="文本文件"> 文本文件 </Radio>
</RadioGroup>
</div>
</Card> </Card>
</ListItem> </ListItem>
</Col> </Col>
...@@ -37,11 +43,12 @@ ...@@ -37,11 +43,12 @@
import Icon from '@/components/Icon/Icon.vue'; import Icon from '@/components/Icon/Icon.vue';
import { BasicModal, useModalInner } from '@/components/Modal'; import { BasicModal, useModalInner } from '@/components/Modal';
import { cardList } from './mock'; import { cardList } from './mock';
import { Card, Row, Col, List, ListItem } from 'ant-design-vue'; import { Card, Row, Col, List, ListItem, Radio, RadioGroup } from 'ant-design-vue';
import { router } from '@/router'; import { router } from '@/router';
const emit = defineEmits(['register']); const emit = defineEmits(['register']);
const rowId = ref(''); const rowId = ref('');
const modeValue = ref('Excel文件');
//初始化弹框 //初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async () => {}); const [registerModal, { setModalProps, closeModal }] = useModalInner(async () => {});
...@@ -56,7 +63,8 @@ ...@@ -56,7 +63,8 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.sceneSelectionCard { .sceneSelectionCard {
height: 200px; width: 300px;
min-height: 200px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
...@@ -79,5 +87,6 @@ ...@@ -79,5 +87,6 @@
color: gray; color: gray;
text-align: left; text-align: left;
line-height: 1.2; line-height: 1.2;
margin-bottom: 20px;
} }
</style> </style>
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