Commit 3126334d authored by chenjiahao's avatar chenjiahao

数据加载bug修正

parent 488b6595
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<BasicModal <BasicModal
v-bind="$attrs" v-bind="$attrs"
@register="registerModal" @register="registerModal"
title="全局新增字段规则" title="批量表名映射"
@ok="handleSubmit" @ok="handleSubmit"
width="700px" width="700px"
minHeight="50" minHeight="50"
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
import { fieldNameMappingRuleTableList } from '@/views/dataIntegration/dataLoading/dataEntryLake/mock'; import { fieldNameMappingRuleTableList } from '@/views/dataIntegration/dataLoading/dataEntryLake/mock';
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 { fieldNameMappingRuleColumns } from '@/views/dataIntegration/dataLoading/dataEntryLake/offlineLoading.data'; import { batchScaleNameMappingColumns } from '@/views/dataIntegration/dataLoading/dataEntryLake/offlineLoading.data';
const fieldNameMappingRuleTable = ref(); const fieldNameMappingRuleTable = ref();
const emit = defineEmits(['success', 'register']); const emit = defineEmits(['success', 'register']);
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
formConfig: { formConfig: {
labelWidth: 160, labelWidth: 160,
}, },
columns: fieldNameMappingRuleColumns, columns: batchScaleNameMappingColumns,
showTableSetting: false, showTableSetting: false,
showIndexColumn: false, showIndexColumn: false,
bordered: false, bordered: false,
......
...@@ -250,7 +250,15 @@ export const NewFieldRuleFormSchema: FormSchema[] = [ ...@@ -250,7 +250,15 @@ export const NewFieldRuleFormSchema: FormSchema[] = [
{ {
field: 'newFieldType', field: 'newFieldType',
label: '新增字段类型', label: '新增字段类型',
component: 'Input', component: 'Select',
componentProps: {
options: [
{ label: 'INT', value: 'INT' },
{ label: 'BIGINT', value: 'BIGINT' },
{ label: 'DECIMAL', value: 'DECIMAL' },
{ label: 'VARCHAR', value: 'VARCHAR' },
],
},
required: true, required: true,
}, },
{ {
...@@ -275,7 +283,15 @@ export const FieldTypeMappingRuleFormSchema: FormSchema[] = [ ...@@ -275,7 +283,15 @@ export const FieldTypeMappingRuleFormSchema: FormSchema[] = [
{ {
field: 'sourceFieldType', field: 'sourceFieldType',
label: '源字段类型', label: '源字段类型',
component: 'Input', component: 'Select',
componentProps: {
options: [
{ label: 'INT', value: 'INT' },
{ label: 'BIGINT', value: 'BIGINT' },
{ label: 'DECIMAL', value: 'DECIMAL' },
{ label: 'VARCHAR', value: 'VARCHAR' },
],
},
required: true, required: true,
}, },
{ {
...@@ -329,6 +345,14 @@ export const DataTransformationRuleFormSchema: FormSchema[] = [ ...@@ -329,6 +345,14 @@ export const DataTransformationRuleFormSchema: FormSchema[] = [
field: 'selectExistingField', field: 'selectExistingField',
label: '选择已有字段', label: '选择已有字段',
component: 'Select', component: 'Select',
componentProps: {
options: [
{ label: 'total_amount', value: 'total_amount' },
{ label: 'payment_id', value: 'payment_id' },
{ label: 'position', value: 'position' },
{ label: 'employee_id', value: 'employee_id' },
],
},
required: true, required: true,
ifShow: false, ifShow: false,
}, },
...@@ -343,10 +367,14 @@ export const DataTransformationRuleFormSchema: FormSchema[] = [ ...@@ -343,10 +367,14 @@ export const DataTransformationRuleFormSchema: FormSchema[] = [
field: 'newFieldType', field: 'newFieldType',
label: '新增字段类型', label: '新增字段类型',
component: 'Select', component: 'Select',
options: [ componentProps: {
{ label: '覆盖已有字段', value: '覆盖已有字段' }, options: [
{ label: '写入新增字段', value: '写入新增字段' }, { label: 'INT', value: 'INT' },
], { label: 'BIGINT', value: 'BIGINT' },
{ label: 'DECIMAL', value: 'DECIMAL' },
{ label: 'VARCHAR', value: 'VARCHAR' },
],
},
required: true, required: true,
ifShow: false, ifShow: false,
}, },
...@@ -354,7 +382,7 @@ export const DataTransformationRuleFormSchema: FormSchema[] = [ ...@@ -354,7 +382,7 @@ export const DataTransformationRuleFormSchema: FormSchema[] = [
field: 'conversionRule', field: 'conversionRule',
label: '转换规则', label: '转换规则',
component: 'RadioGroup', component: 'RadioGroup',
defaultValue: '自定义', defaultValue: '配置规则',
componentProps: ({ formModel, formActionType }) => ({ componentProps: ({ formModel, formActionType }) => ({
onChange: () => { onChange: () => {
const flag = formModel.conversionRule === '自定义'; const flag = formModel.conversionRule === '自定义';
...@@ -553,7 +581,7 @@ export const SingleTableFieldMappingRuleFormSchema: FormSchema[] = [ ...@@ -553,7 +581,7 @@ export const SingleTableFieldMappingRuleFormSchema: FormSchema[] = [
}, },
{ {
field: 'selectiveDataTable', field: 'selectiveDataTable',
label: '选择数据表', label: '源表名',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [ options: [
...@@ -576,6 +604,7 @@ export const PartitionedDataProcessingFormSchema: FormSchema[] = [ ...@@ -576,6 +604,7 @@ export const PartitionedDataProcessingFormSchema: FormSchema[] = [
field: 'partitionType', field: 'partitionType',
label: '分区类型', label: '分区类型',
component: 'RadioGroup', component: 'RadioGroup',
defaultValue: '单值分区',
componentProps: { componentProps: {
options: [{ label: '单值分区', value: '单值分区' }], options: [{ label: '单值分区', value: '单值分区' }],
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<BasicModal <BasicModal
v-bind="$attrs" v-bind="$attrs"
@register="registerModal" @register="registerModal"
title="全局新增字段规则" title="数据转换规则"
@ok="handleSubmit" @ok="handleSubmit"
minHeight="50" minHeight="50"
> >
......
...@@ -76,10 +76,7 @@ ...@@ -76,10 +76,7 @@
<a-button type="primary">导入文件</a-button> <a-button type="primary">导入文件</a-button>
</template> </template>
</BasicForm> </BasicForm>
<div <div v-if="isGetMeta === 'true'" style="width: 20%">
v-if="isGetMeta === 'true'"
style="width: 20%; background: #f4f7fa"
>
<BasicTree <BasicTree
class="btStyle" class="btStyle"
toolbar toolbar
...@@ -90,12 +87,11 @@ ...@@ -90,12 +87,11 @@
:treeData="tableTreeData" :treeData="tableTreeData"
v-model:checkedKeys="myCheckedKeys" v-model:checkedKeys="myCheckedKeys"
@select="handleSelect" @select="handleSelect"
style="background-color: #f4f7fa !important"
> >
<template #headerTitle> <template #headerTitle>
<span style="margin-left: 20px">表名</span> <span style="margin-left: 20px">表名</span>
<a v-if="myCheckedKeys.length > 0" @click="handleDeplys" style="margin-left: 2px" <a v-if="myCheckedKeys.length > 0" @click="handleDeplys" style="margin-left: 2px">
>批量配置</a 批量配置</a
> >
<a v-else style="color: grey; margin-left: 2px">批量配置</a> <a v-else style="color: grey; margin-left: 2px">批量配置</a>
</template> </template>
...@@ -113,7 +109,7 @@ ...@@ -113,7 +109,7 @@
<BasicForm <BasicForm
v-if="isGetMeta === 'true'" v-if="isGetMeta === 'true'"
@register="registerLoadingStrategyForm" @register="registerLoadingStrategyForm"
style="background-color: #f4f7fa !important; width: 50%" style="padding-left: 20px; width: 50%"
> >
<template #incrementalRepresentationColumnAlert> <template #incrementalRepresentationColumnAlert>
<Alert <Alert
...@@ -281,22 +277,23 @@ ...@@ -281,22 +277,23 @@
<!--左侧配置表--> <!--左侧配置表-->
<template #configurationTable> <template #configurationTable>
<!--配置表--> <!--配置表-->
<BasicTable @register="registerConfigurationTable"> <BasicTable title=" " @register="registerConfigurationTable">
<template #toolbar> <template #headerTop>
<div> <div>
<!--展开按钮&配置按钮--> <!--展开按钮&配置按钮-->
<div style="margin-right: 600px"> <div style="display: flex; gap: 5px; justify-content: space-between">
<!--展开按照序号批量选择按钮-->
<div style="display: flex; gap: 5px"> <div style="display: flex; gap: 5px">
<!--展开按照序号批量选择按钮-->
<a-button @click="handleConfigurationTableSelectClick"> <a-button @click="handleConfigurationTableSelectClick">
通过序号批量选择 通过序号批量选择
<Icon v-if="unfoldConfigurationTableSelect" icon="fe:arrow-up" /> <Icon v-if="unfoldConfigurationTableSelect" icon="fe:arrow-up" />
<Icon v-else icon="fe:arrow-down" /> <Icon v-else icon="fe:arrow-down" />
</a-button> </a-button>
<a-input-search style="width: 220px" @search="onSearch" /> <a-input-search style="width: 220px" @search="onSearch" />
<!--配置按钮--> </div>
<!--配置按钮-->
<div style="display: flex; gap: 5px">
<a-button <a-button
style="margin-left: 60px"
:disabled="getConfigurationTableRowSelection().selectedRowKeys <= 0" :disabled="getConfigurationTableRowSelection().selectedRowKeys <= 0"
@click="handlePartitionedDataProcessing" @click="handlePartitionedDataProcessing"
>分区数据处理 >分区数据处理
...@@ -499,6 +496,11 @@ ...@@ -499,6 +496,11 @@
<BatchScaleNameMappingModal @register="registerBatchScaleNameMappingModal" /> <BatchScaleNameMappingModal @register="registerBatchScaleNameMappingModal" />
<ClearConfigurationModal @register="registerClearConfigurationModal" /> <ClearConfigurationModal @register="registerClearConfigurationModal" />
<ViewLogModal @register="registerViewLogsModal" /> <ViewLogModal @register="registerViewLogsModal" />
<NewFieldRuleModal @register="registerNewFieldRuleModal" />
<FieldNameMappingRuleModal @register="registerFieldNameMappingRuleModal" />
<FieldTypeMappingRuleModal @register="registerFieldTypeMappingRuleModal" />
<DataTransformationRuleModal @register="registerDataTransformationRuleModal" />
<SingleTableFieldMappingRuleModal @register="registerSingleTableFieldMappingRuleModal" />
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -527,7 +529,7 @@ ...@@ -527,7 +529,7 @@
tabularPresentationColumns, tabularPresentationColumns,
compareColumns, compareColumns,
tabularPresentationSearchFormSchema, tabularPresentationSearchFormSchema,
compareSearchFormSchema, compareSearchFormSchema, noConfigurationColumns,
} from './offlineLoading.data'; } from './offlineLoading.data';
import Icon from '@/components/Icon/Icon.vue'; import Icon from '@/components/Icon/Icon.vue';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
...@@ -564,6 +566,11 @@ ...@@ -564,6 +566,11 @@
import VersionManageModal from '@/views/dataIntegration/dataLoading/dataEntryLake/versionManageModal.vue'; import VersionManageModal from '@/views/dataIntegration/dataLoading/dataEntryLake/versionManageModal.vue';
import RunOptionsModal from '@/views/dataIntegration/dataLoading/dataEntryLake/runOptionsModal.vue'; import RunOptionsModal from '@/views/dataIntegration/dataLoading/dataEntryLake/runOptionsModal.vue';
import ViewLogModal from '@/views/dataIntegration/dataLoading/dataEntryLake/ViewLogModal.vue'; import ViewLogModal from '@/views/dataIntegration/dataLoading/dataEntryLake/ViewLogModal.vue';
import NewFieldRuleModal from '@/views/dataIntegration/dataLoading/dataEntryLake/newFieldRuleModal.vue';
import FieldNameMappingRuleModal from '@/views/dataIntegration/dataLoading/dataEntryLake/fieldNameMappingRuleModal.vue';
import FieldTypeMappingRuleModal from '@/views/dataIntegration/dataLoading/dataEntryLake/fieldTypeMappingRuleModal.vue';
import DataTransformationRuleModal from '@/views/dataIntegration/dataLoading/dataEntryLake/dataTransformationRuleModal.vue';
import SingleTableFieldMappingRuleModal from '@/views/dataIntegration/dataLoading/dataEntryLake/singleTableFieldMappingRuleModal.vue';
const route = useRoute(); const route = useRoute();
const emit = defineEmits(['success', 'register']); const emit = defineEmits(['success', 'register']);
...@@ -594,7 +601,7 @@ ...@@ -594,7 +601,7 @@
let customSQLFlag = ref(); let customSQLFlag = ref();
let isAutomaticTableConstructionFlag = ref(false); let isAutomaticTableConstructionFlag = ref(false);
let isParsingSQL = ref(false); let isParsingSQL = ref(false);
let isClearTargetTable = ref(false); let isClearTargetTable = ref('否');
const isSave = ref('false'); const isSave = ref('false');
const isRun = ref('false'); const isRun = ref('false');
const key = ref('1'); const key = ref('1');
...@@ -632,6 +639,18 @@ ...@@ -632,6 +639,18 @@
}, },
]; ];
const [registerNewFieldRuleModal, { openModal: openNewFieldRuleModal }] = useModal();
const [registerFieldNameMappingRuleModal, { openModal: openFieldNameMappingRuleModal }] =
useModal();
const [registerFieldTypeMappingRuleModal, { openModal: openFieldTypeMappingRuleModal }] =
useModal();
const [registerDataTransformationRuleModal, { openModal: openDataTransformationRuleModal }] =
useModal();
const [
registerSingleTableFieldMappingRuleModal,
{ openModal: openSingleTableFieldMappingRuleModal },
] = useModal();
const sourceSideConfigurationFormSchema: FormSchema[] = [ const sourceSideConfigurationFormSchema: FormSchema[] = [
{ {
field: 'loadType', field: 'loadType',
...@@ -991,6 +1010,7 @@ ...@@ -991,6 +1010,7 @@
label: '允许最大并发数', label: '允许最大并发数',
component: 'Input', component: 'Input',
colProps: { lg: 12, md: 12 }, colProps: { lg: 12, md: 12 },
defaultValue: '10',
componentProps: { componentProps: {
placeholder: '', placeholder: '',
}, },
...@@ -1045,6 +1065,13 @@ ...@@ -1045,6 +1065,13 @@
componentProps: ({ formModel, formActionType }) => ({ componentProps: ({ formModel, formActionType }) => ({
onChange: () => { onChange: () => {
isAutomaticTableConstructionFlag.value = formModel.isAutomaticTableConstruction === '是'; isAutomaticTableConstructionFlag.value = formModel.isAutomaticTableConstruction === '是';
if(isAutomaticTableConstructionFlag.value){
setColumns(configurationColumns);
reload();
}else {
setColumns(noConfigurationColumns);
reload();
}
// formActionType.updateSchema([{ field: 'quantityBasedAlert', ifShow: flag }]); // formActionType.updateSchema([{ field: 'quantityBasedAlert', ifShow: flag }]);
// formActionType.updateSchema([{ field: 'conditionBasedAlert', ifShow: !flag }]); // formActionType.updateSchema([{ field: 'conditionBasedAlert', ifShow: !flag }]);
}, },
...@@ -1318,7 +1345,7 @@ ...@@ -1318,7 +1345,7 @@
}); });
const [registerLoadingStrategyForm, { updateSchema, setFieldsValue }] = useForm({ const [registerLoadingStrategyForm, { updateSchema, setFieldsValue }] = useForm({
labelWidth: 180, labelWidth: 120,
labelAlign: 'left', labelAlign: 'left',
baseColProps: { lg: 24, md: 24 }, baseColProps: { lg: 24, md: 24 },
schemas: LoadingStrategyFormSchema, schemas: LoadingStrategyFormSchema,
...@@ -1480,6 +1507,7 @@ ...@@ -1480,6 +1507,7 @@
getDataSource, getDataSource,
getRowSelection: getConfigurationTableRowSelection, getRowSelection: getConfigurationTableRowSelection,
setSelectedRowKeys, setSelectedRowKeys,
setColumns,
}, },
] = useTable({ ] = useTable({
api: async () => { api: async () => {
...@@ -1499,7 +1527,7 @@ ...@@ -1499,7 +1527,7 @@
rowSelection: true, rowSelection: true,
striped: false, striped: false,
customRow: configurationTableOnClick, customRow: configurationTableOnClick,
columns: configurationColumns, columns: noConfigurationColumns,
showTableSetting: false, showTableSetting: false,
showIndexColumn: true, showIndexColumn: true,
bordered: false, bordered: false,
...@@ -1884,11 +1912,42 @@ ...@@ -1884,11 +1912,42 @@
} }
function handleEdit(record) { function handleEdit(record) {
createMessage.success('编辑:' + record); switch (record.ruleName) {
case '[全局] 新增字段规则':
console.log('Handling new field rule');
openNewFieldRuleModal(true);
break;
case '[全局] 字段名称映射规则':
console.log('Handling field name mapping rule');
openFieldNameMappingRuleModal(true);
break;
case '[全局] 字段类型映射规则':
console.log('Handling field type mapping rule');
openFieldTypeMappingRuleModal(true);
break;
case '数据转换规则':
console.log('Handling data transformation rule');
openDataTransformationRuleModal(true);
break;
case '[单表] 字段映射规则':
console.log('Handling single table field mapping rule');
openSingleTableFieldMappingRuleModal(true);
break;
default:
console.log('Unknown rule type');
}
// createMessage.success('编辑:' + record);
} }
function handleDeleteRule(record) { function handleDeleteRule(record) {
createMessage.success('删除规则成功' + record); createConfirm({
iconType: 'warning',
title: '删除规则',
content: '是否确认删除规则?',
onOk() {
createMessage.success('删除规则成功');
},
});
} }
function handleDeleteRules() { function handleDeleteRules() {
...@@ -2163,12 +2222,11 @@ ...@@ -2163,12 +2222,11 @@
reloadOtherConfigurationTable(); reloadOtherConfigurationTable();
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.content-padding { .content-padding {
background-color: white; background-color: white;
} }
.modal_top { .modal_top {
padding: 0 0 20px 0;
display: flex; display: flex;
align-items: center; align-items: center;
.title { .title {
...@@ -2189,4 +2247,16 @@ ...@@ -2189,4 +2247,16 @@
.selected-row { .selected-row {
background-color: #5cb3ff; /* 可以根据需要调整颜色 */ background-color: #5cb3ff; /* 可以根据需要调整颜色 */
} }
:deep(.vben-basic-table-form-container) {
padding: 0;
}
:deep(.ant-page-header) {
padding: 5px 24px;
}
:deep(.ant-col-lg-12) {
padding: 5px;
}
</style> </style>
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<BasicModal <BasicModal
v-bind="$attrs" v-bind="$attrs"
@register="registerModal" @register="registerModal"
title="全局新增字段规则" title="全局字段名称映射规则"
@ok="handleSubmit" @ok="handleSubmit"
style="width: 35%" width="35%"
minHeight="50" minHeight="50"
> >
<BasicForm @register="registerForm"> <BasicForm @register="registerForm">
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<BasicModal <BasicModal
v-bind="$attrs" v-bind="$attrs"
@register="registerModal" @register="registerModal"
title="全局新增字段规则" title="全局字段类型映射规则"
@ok="handleSubmit" @ok="handleSubmit"
minHeight="50" minHeight="50"
> >
......
...@@ -48,6 +48,29 @@ export const configurationColumns: BasicColumn[] = [ ...@@ -48,6 +48,29 @@ export const configurationColumns: BasicColumn[] = [
width: 90, width: 90,
}, },
]; ];
export const noConfigurationColumns: BasicColumn[] = [
{
title: '源端',
dataIndex: 'sourceTableName',
},
{
title: '目标端',
dataIndex: 'targetTableName',
edit: true,
},
{
title: '分区数据配置',
dataIndex: 'partitionQuantityConfiguration',
slots: { customRender: 'partitionQuantityConfiguration' },
width: 90,
},
{
title: '清理配置',
dataIndex: 'clearConfiguration',
slots: { customRender: 'clearConfiguration' },
width: 90,
},
];
export const partitionKeyColumns: BasicColumn[] = [ export const partitionKeyColumns: BasicColumn[] = [
{ {
...@@ -157,6 +180,18 @@ export const fieldNameMappingRuleColumns: BasicColumn[] = [ ...@@ -157,6 +180,18 @@ export const fieldNameMappingRuleColumns: BasicColumn[] = [
}, },
]; ];
export const batchScaleNameMappingColumns: BasicColumn[] = [
{
title: '源表名',
dataIndex: 'tableName',
labelWidth: 160,
},
{
title: '目标表名',
dataIndex: 'targetTableName',
},
];
export const singleSourceFieldNameMappingRuleColumns: BasicColumn[] = [ export const singleSourceFieldNameMappingRuleColumns: BasicColumn[] = [
{ {
title: '字段名', title: '字段名',
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<BasicModal <BasicModal
v-bind="$attrs" v-bind="$attrs"
@register="registerModal" @register="registerModal"
title="全局新增字段规则" title="单表字段映射规则"
@ok="handleSubmit" @ok="handleSubmit"
style="width: 35%"
minHeight="50" minHeight="50"
width="50%"
> >
<BasicForm @register="registerForm"> <BasicForm @register="registerForm">
<template #mappingTable> <template #mappingTable>
......
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