Commit 9c06e647 authored by 罗林杰's avatar 罗林杰

Merge remote-tracking branch 'origin/master'

parents 4f02a2a4 defa2a6d
......@@ -901,6 +901,15 @@ export const taskSchedulingRoute: AppRouteRecordRaw = {
icon: '',
},
},
{
path: 'supplyNumber/addTask',
name: 'addTask',
component: () => import('@/views/taskScheduling/taskFlowMaintenance/supplyNumber/addTask.vue'),
meta: {
title: '新建补数任务',
icon: '',
},
},
],
};
......
<template>
<BasicModal
v-bind="$attrs"
@register="registerModal"
title="全局新增字段规则"
@ok="handleSubmit"
width="700px"
minHeight="50"
>
<BasicForm @register="registerForm">
<template #regularExpressionAlert>
<Alert
show-icon
style="font-size: 12px"
message="示例:去除源端字段名中下划线+数字后缀;原字段名表达式填写_[0-9]*,目标字段名表达式不填写任何内容"
type="info"
/>
</template>
<template #reviewButton>
<a-button
@click="handlePreview"
style="width: 100%; color: white; background-color: #24a866"
>预览</a-button
>
</template>
<template #reviewTable>
<BasicTable style="width: 100%" @register="registerFieldNameMappingRuleTable" />
</template>
</BasicForm>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, onMounted } from 'vue';
import { Alert } from 'ant-design-vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { BatchScaleNameMappingFormSchema } from './dataEntry.data';
import { fieldNameMappingRuleTableList } from '@/views/dataIntegration/dataLoading/dataEntryLake/mock';
import BasicTable from '@/components/Table/src/BasicTable.vue';
import { useTable } from '@/components/Table';
import { fieldNameMappingRuleColumns } from '@/views/dataIntegration/dataLoading/dataEntryLake/offlineLoading.data';
const fieldNameMappingRuleTable = ref();
const emit = defineEmits(['success', 'register']);
const [registerForm, { validate }] = useForm({
labelWidth: 100,
labelAlign: 'left',
baseColProps: { span: 24 },
schemas: BatchScaleNameMappingFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { closeModal, setModalProps }] = useModalInner(async () => {});
const [registerFieldNameMappingRuleTable, { reload }] = useTable({
api: async () => {
const response = {
pageNu: '1',
pageSize: '5',
pages: '1',
total: fieldNameMappingRuleTable.value.length,
code: '',
message: '',
data: fieldNameMappingRuleTable.value,
};
return { ...response };
},
scroll: { y: 300 },
rowKey: 'businessId',
formConfig: {
labelWidth: 160,
},
columns: fieldNameMappingRuleColumns,
showTableSetting: false,
showIndexColumn: false,
bordered: false,
pagination: false,
});
async function handleSubmit() {
try {
setModalProps({ confirmLoading: true });
await validate();
closeModal();
} finally {
setModalProps({ confirmLoading: false });
}
// closeModal();
}
function handlePreview() {
fieldNameMappingRuleTable.value = fieldNameMappingRuleTableList;
reload();
}
onMounted(() => {
setModalProps({ canFullscreen: false });
});
</script>
<template>
<BasicModal
v-bind="$attrs"
@register="registerModal"
:title="title"
@ok="handleSubmit"
minHeight="50"
>
<BasicForm @register="registerForm">
<template #cleaningConditionAlert>
<Alert
style="font-size: 12px"
type="info"
message="仅支持对事务表进行按条件清理配置,否则会执行失败"
show-icon
/>
</template>
<template #cleaningConfiguration>
<Textarea
rows="6"
v-model:value="cleaningConfigurationValue"
placeholder='"添加目标数据库的清理语句的where条件,支持引用在任务中定义的普通参数例如 update_Time > "2023-10-10"'
/>
<a-button type="link" @click="handleReset"> 清空配置 </a-button>
</template>
</BasicForm>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, reactive } from 'vue';
import { Alert, Textarea } from 'ant-design-vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { ClearConfigurationFormSchema } from './dataEntry.data';
import { useMessage } from '@/hooks/web/useMessage';
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const title = ref('');
const cleaningConfigurationValue = ref('');
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm] = useForm({
labelWidth: 100,
baseColProps: { span: 24 },
schemas: ClearConfigurationFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { closeModal, setModalProps }] = useModalInner(async (data) => {
setModalProps({ canFullscreen: false });
title.value = data.sourceTableName + '清理配置';
});
async function handleSubmit() {
closeModal();
}
function handleReset() {
cleaningConfigurationValue.value = null;
}
</script>
......@@ -48,7 +48,6 @@
},
{
field: 'incrementIdentificationColumnAlert',
component: 'Slot',
slot: 'incrementIdentificationColumnAlert',
ifShow: false,
},
......
<template>
<BasicModal
v-bind="$attrs"
@register="registerModal"
title="分区数据处理"
@ok="handleSubmit"
minHeight="50"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, onMounted } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { PartitionedDataProcessingFormSchema } from './dataEntry.data';
import { useMessage } from '@/hooks/web/useMessage';
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm] = useForm({
labelWidth: 180,
labelAlign: 'left',
baseColProps: { span: 24 },
schemas: PartitionedDataProcessingFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { closeModal, setModalProps }] = useModalInner(async () => {});
onMounted(() => {
setModalProps({ canFullscreen: false });
});
async function handleSubmit() {
closeModal();
}
</script>
......@@ -239,25 +239,17 @@ export const NewFieldRuleFormSchema: FormSchema[] = [
},
{
field: 'newFieldRuleAlert',
component: 'Slot',
slot: 'newFieldRuleAlert',
},
{
field: 'newFieldName',
label: '规则名称',
label: '新增字段名称',
component: 'Input',
required: true,
},
// {
// field: 'newFieldType',
// label: '规则名称',
// component: 'Slot',
// slot: 'newFieldType',
// required: true,
// },
{
field: 'newFieldType',
label: '规则名称',
label: '新增字段类型',
component: 'Input',
required: true,
},
......@@ -278,7 +270,6 @@ export const FieldTypeMappingRuleFormSchema: FormSchema[] = [
},
{
field: 'newFieldRuleAlert',
component: 'Slot',
slot: 'newFieldRuleAlert',
},
{
......@@ -392,7 +383,6 @@ export const FieldNameMappingRuleFormSchema: FormSchema[] = [
},
{
field: 'regularExpressionAlert',
component: 'Slot',
slot: 'regularExpressionAlert',
},
{
......@@ -463,13 +453,93 @@ export const FieldNameMappingRuleFormSchema: FormSchema[] = [
{
field: 'reviewButton',
label: '',
component: 'Slot',
slot: 'reviewButton',
},
{
field: 'reviewTable',
label: '',
component: 'Slot',
slot: 'reviewTable',
},
];
export const BatchScaleNameMappingFormSchema: FormSchema[] = [
{
field: 'regularExpression',
label: '正则表达式',
component: 'Checkbox',
componentProps: ({ formModel, formActionType }) => ({
onChange: () => {
const flag = formModel.regularExpression;
formActionType.updateSchema([{ field: 'sourceDatabaseNameExpression', ifShow: flag }]);
formActionType.updateSchema([{ field: 'targetLibraryNameExpression', ifShow: flag }]);
},
}),
},
{
field: 'regularExpressionAlert',
slot: 'regularExpressionAlert',
},
{
field: 'sourceDatabaseNameExpression',
label: '源库名表达式',
component: 'Input',
defaultValue: '^(.*)$',
required: true,
ifShow: false,
},
{
field: 'targetLibraryNameExpression',
label: '目标库名表达式',
defaultValue: 'test_$1_obs',
component: 'Input',
ifShow: false,
},
{
field: 'addPrefix',
label: '添加前缀',
component: 'Checkbox',
componentProps: ({ formModel, formActionType }) => ({
onChange: () => {
const flag = formModel.addPrefix;
formActionType.updateSchema([{ field: 'prefixExpression', ifShow: flag }]);
},
}),
},
{
field: 'prefixExpression',
label: '表达式',
component: 'Input',
defaultValue: 'test_',
required: true,
ifShow: false,
},
{
field: 'addSuffixation',
label: '添加后缀',
component: 'Checkbox',
componentProps: ({ formModel, formActionType }) => ({
onChange: () => {
const flag = formModel.addSuffixation;
formActionType.updateSchema([{ field: 'suffixationExpression', ifShow: flag }]);
},
}),
},
{
field: 'suffixationExpression',
label: '表达式',
component: 'Input',
defaultValue: '_obs',
required: true,
ifShow: false,
},
{
field: 'reviewButton',
label: '',
slot: 'reviewButton',
},
{
field: 'reviewTable',
label: '',
slot: 'reviewTable',
},
];
......@@ -497,11 +567,53 @@ export const SingleTableFieldMappingRuleFormSchema: FormSchema[] = [
},
{
field: 'mappingTable',
component: 'Slot',
slot: 'mappingTable',
},
];
export const PartitionedDataProcessingFormSchema: FormSchema[] = [
{
field: 'partitionType',
label: '分区类型',
component: 'RadioGroup',
componentProps: {
options: [{ label: '单值分区', value: '单值分区' }],
},
},
{
field: 'overwritesTheSingleValuePartitionRawData',
label: '覆盖单值分区原数据',
component: 'Switch',
defaultValue: false,
},
{
field: 'partitionKeyName',
label: '分区键名',
component: 'Input',
},
{
field: 'partitionKeyValue',
label: '分区键值',
component: 'Input',
},
];
export const ClearConfigurationFormSchema: FormSchema[] = [
{
field: 'cleaningCondition',
label: '清理条件',
component: 'BasicTitle',
},
{
field: 'cleaningConditionAlert',
slot: 'cleaningConditionAlert',
},
{
field: 'cleaningConfiguration',
slot: 'cleaningConfiguration',
},
];
export const recommendColumns: BasicColumn[] = [
{
title: '参数名',
......
......@@ -923,6 +923,57 @@ export const getMetadataTableList = [
},
];
export const configurationTableList = [
{
sourceTableName: 'bm_datasource',
targetTableName: 'bm_datasource',
configurationMode: 0,
businessId: '8',
},
{
sourceTableName: 'user_info',
targetTableName: 'user_info',
configurationMode: 1,
businessId: '1',
},
{
sourceTableName: 'customer_details',
targetTableName: 'customer_details',
configurationMode: 1,
businessId: '2',
},
{
sourceTableName: 'order_history',
targetTableName: 'order_history',
configurationMode: 1,
businessId: '3',
},
{
sourceTableName: 'product_inventory',
targetTableName: 'product_inventory',
configurationMode: 1,
businessId: '4',
},
{
sourceTableName: 'transaction_logs',
targetTableName: 'transaction_logs',
configurationMode: 1,
businessId: '5',
},
{
sourceTableName: 'employee_records',
targetTableName: 'employee_records',
configurationMode: 1,
businessId: '6',
},
{
sourceTableName: 'payment_details',
targetTableName: 'payment_details',
configurationMode: 1,
businessId: '7',
},
];
export const mappingRuleConfigurationTableList = [
{
businessId: '1',
......@@ -951,7 +1002,7 @@ export const mappingRuleConfigurationTableList = [
},
];
export const newFieldTypeOptions = [
export const fieldTypeOptions = [
'INT', // 整型
'BIGINT', // 大整型
'FLOAT', // 浮点型
......@@ -1181,7 +1232,6 @@ export const goalFieldNameMappingRuleTableList = [
{
businessId: '1',
ownershipTableId: '1',
fieldName: 'uuid',
targetFieldName: 'test_uuid_obs',
annotation: '-',
fieldType: 'VARCHAR(50)',
......@@ -1189,7 +1239,6 @@ export const goalFieldNameMappingRuleTableList = [
{
businessId: '2',
ownershipTableId: '1',
fieldName: 'catalog_id',
targetFieldName: 'test_catalog_id_obs',
annotation: '-',
fieldType: 'BIGINT(19)',
......@@ -1197,7 +1246,6 @@ export const goalFieldNameMappingRuleTableList = [
{
businessId: '3',
ownershipTableId: '1',
fieldName: 'name',
targetFieldName: 'test_name_obs',
annotation: '-',
fieldType: 'VARCHAR(255)',
......@@ -1205,7 +1253,6 @@ export const goalFieldNameMappingRuleTableList = [
{
businessId: '4',
ownershipTableId: '1',
fieldName: 'description',
targetFieldName: 'test_description_obs',
annotation: '-',
fieldType: 'TEXT',
......@@ -1213,7 +1260,6 @@ export const goalFieldNameMappingRuleTableList = [
{
businessId: '5',
ownershipTableId: '2',
fieldName: 'uuid',
targetFieldName: 'test_uuid_obs_2',
annotation: '-',
fieldType: 'VARCHAR(50)',
......@@ -1221,7 +1267,6 @@ export const goalFieldNameMappingRuleTableList = [
{
businessId: '6',
ownershipTableId: '2',
fieldName: 'user_id',
targetFieldName: 'test_user_id_obs',
annotation: '-',
fieldType: 'BIGINT(19)',
......@@ -1229,7 +1274,6 @@ export const goalFieldNameMappingRuleTableList = [
{
businessId: '7',
ownershipTableId: '2',
fieldName: 'username',
targetFieldName: 'test_username_obs',
annotation: '-',
fieldType: 'VARCHAR(255)',
......@@ -1237,7 +1281,6 @@ export const goalFieldNameMappingRuleTableList = [
{
businessId: '8',
ownershipTableId: '2',
fieldName: 'email',
targetFieldName: 'test_email_obs',
annotation: '-',
fieldType: 'VARCHAR(255)',
......@@ -1245,7 +1288,6 @@ export const goalFieldNameMappingRuleTableList = [
{
businessId: '9',
ownershipTableId: '3',
fieldName: 'uuid',
targetFieldName: 'test_uuid_obs_3',
annotation: '-',
fieldType: 'VARCHAR(50)',
......@@ -1253,7 +1295,6 @@ export const goalFieldNameMappingRuleTableList = [
{
businessId: '10',
ownershipTableId: '3',
fieldName: 'order_id',
targetFieldName: 'test_order_id_obs',
annotation: '-',
fieldType: 'BIGINT(19)',
......@@ -1261,7 +1302,6 @@ export const goalFieldNameMappingRuleTableList = [
{
businessId: '11',
ownershipTableId: '3',
fieldName: 'total_amount',
targetFieldName: 'test_total_amount_obs',
annotation: '-',
fieldType: 'DECIMAL(10,2)',
......@@ -1315,3 +1355,57 @@ export const runOptionsData: any[] = [
data: 'false',
},
];
export const partitionKeyTableList = [
{
businessId: '1',
ownershipTableId: '1',
fieldName: 'test_uuid_obs',
fieldType: 'VARCHAR(50)',
annotation: '-',
},
{
businessId: '2',
ownershipTableId: '2',
fieldName: 'test_catalog_id_obs',
annotation: '-',
fieldType: 'BIGINT(19)',
},
{
businessId: '3',
ownershipTableId: '2',
fieldName: '',
annotation: '-',
fieldType: ' ',
},
];
export const partitionRangeTableList = [
{
businessId: '1',
ownershipTableId: '1',
name: 'test_uuid_obs',
value: 'test_uuid_obs>10',
},
{
businessId: '2',
ownershipTableId: '2',
name: 'test_catalog_id_obs',
value: 'test_catalog_id_obs!==100',
},
];
export const otherConfigurationTableList = [
{
businessId: '1',
ownershipTableId: '1',
otherConfigurationType: '表注释',
otherConfigurationContent: '这是个测试用表',
},
{
businessId: '2',
ownershipTableId: '1',
otherConfigurationType: '表别名',
otherConfigurationContent: '测试用表',
},
];
import { FormSchema } from '@/components/Form';
import { BasicColumn } from '@/components/Table';
import {
goalFieldNameMappingRuleTableList,
sourceFieldNameMappingRuleTableList
} from "@/views/dataIntegration/dataLoading/dataEntryLake/mock";
export const isCustomSQLColumns: BasicColumn[] = [
{
......@@ -23,6 +19,98 @@ export const getMetadataColumns: BasicColumn[] = [
},
];
export const configurationColumns: BasicColumn[] = [
{
title: '源端',
dataIndex: 'sourceTableName',
},
{
title: '目标端',
dataIndex: 'targetTableName',
edit: true,
},
{
title: '配置方式',
dataIndex: 'configurationMode',
slots: { customRender: 'configurationMode' },
width: 120,
},
{
title: '分区数据配置',
dataIndex: 'partitionQuantityConfiguration',
slots: { customRender: 'partitionQuantityConfiguration' },
width: 90,
},
{
title: '清理配置',
dataIndex: 'clearConfiguration',
slots: { customRender: 'clearConfiguration' },
width: 90,
},
];
export const partitionKeyColumns: BasicColumn[] = [
{
title: '分区键',
dataIndex: 'fieldName',
editComponent: 'Input',
width: 500,
editRow: true,
},
{
title: '分区类型',
dataIndex: 'fieldType',
editComponent: 'Select',
editRow: true,
editComponentProps: {
options: [
{ label: 'STRING', value: 'STRING' },
{ label: 'INT', value: 'INT' },
{ label: 'DATETIME', value: 'DATETIME' },
{ label: 'CHAR', value: 'CHAR' },
{ label: 'BOOLEAN', value: 'BOOLEAN' },
],
}
},
];
export const partitionRangeColumns: BasicColumn[] = [
{
title: '分区名',
dataIndex: 'name',
editComponent: 'Input',
editRow: true,
},
{
title: '分区值',
dataIndex: 'value',
editComponent: 'Input',
editRow: true,
},
];
export const otherConfigurationColumns: BasicColumn[] = [
{
title: '其他配置类型',
dataIndex: 'otherConfigurationType',
editComponent: 'Select',
editRow: true,
width: 120,
editComponentProps: {
options: [
{ label: '表注释', value: '表注释' },
{ label: '表别名', value: '表别名' },
],
},
},
{
title: '其他配置内容',
editRow: true,
dataIndex: 'otherConfigurationContent',
editComponent: 'Input',
},
];
export const notCustomSQLColumns: BasicColumn[] = [
{
title: '列名',
......
......@@ -164,7 +164,6 @@ export const formSchema: any[] = [
},
{
field: 'requestParameters',
component: 'Slot',
label: ' ',
labelWidth: 20,
slot: 'requestParameters',
......@@ -203,7 +202,6 @@ export const formSchema: any[] = [
field: 'returnParameter',
label: ' ',
labelWidth: 20,
component: 'Slot',
slot: 'returnParameter',
},
{
......@@ -221,7 +219,6 @@ export const formSchema: any[] = [
},
{
field: 'sensitiveRules',
component: 'Slot',
label: ' ',
labelWidth: 16,
slot: 'sensitiveRules',
......
......@@ -569,12 +569,15 @@
target = index;
// 这里就是让数据位置互换,让视图更新 你们可以看record,index的输出,看是什么
console.log(tableData);
// [tableData.value[source], tableData.value[target]] = [tableData.value[target], tableData.value[source]];
const temp = ref();
temp.value = tableData.value[source];
tableData.value[source] = tableData.value[target];
tableData.value[target] = temp.value;
console.log(record, index, 'target', source, target);
[tableData.value[source], tableData.value[target]] = [
tableData.value[target],
tableData.value[source],
];
// const temp = ref();
// temp.value = tableData.value[source];
// tableData.value[source] = tableData.value[target];
// tableData.value[target] = temp.value;
// console.log(record, index, 'target', source, target);
},
};
}
......
......@@ -13,7 +13,9 @@
style="width: 150px; margin-left: 10px"
:options="typeOptions"
/>
<a-button type="link"><PlusOutlined style="color: #9396a4" /></a-button>
<a-button type="link" @click="handleAdd"
><PlusOutlined style="color: #9396a4"
/></a-button>
</div>
</template>
<template #strategicName="{ text, record }">
......@@ -32,13 +34,23 @@
<!-- ><PlusOutlined style="color: #9396a4"-->
<!-- /></a-button>-->
<div class="w-3/4">
<div v-if="titleName !== null" style="display: flex; justify-content: space-between">
<div v-if="titleType !== null" style="display: flex; justify-content: space-between">
<div style="font-size: 16px; font-weight: 650; margin: 0 0 20px 20px">{{
titleName
}}</div>
<div><a-button type="primary" @click="handleSubmit">保存</a-button></div>
<div>
<a-button type="primary" @click="handleDelete">删除</a-button>
<a-button type="primary" @click="handleSubmit">保存</a-button>
</div>
</div>
<BasicForm v-show="titleName === '一致性检查默认策略'" @register="registerCheck">
<div v-if="isAdd">
<div style="text-align: right">
<a-button type="primary" @click="handleSubmit">保存</a-button>
</div>
<BasicForm @register="registerAdd" />
</div>
<BasicForm v-show="titleType === '一致性检查策略“'" @register="registerCheck">
<template #strategicType="{ field, model }">
<Select v-model:value="model[field]" :options="typeOptions" />
<Alert
......@@ -56,13 +68,13 @@
</template>
</BasicForm>
<BasicForm
v-show="titleName !== null && titleName !== '一致性检查默认策略'"
v-show="titleType !== null && titleType !== '一致性检查策略'"
@register="registerForm"
>
<template #strategicType="{ field, model }">
<div
v-if="titleName === 'DB-DB源端DDL处理默认策略'"
v-show="titleName === 'DB-DB源端DDL处理默认策略'"
v-if="titleType === 'DB-DB源端DDL处理策略'"
v-show="titleType === 'DB-DB源端DDL处理策略'"
>
<Select v-model:value="model[field]" :options="typeOptions" />
<Alert
......@@ -73,8 +85,8 @@
/>
</div>
<div
v-if="titleName === 'DB-Kafka源端DDL处理默认策略'"
v-show="titleName === 'DB-Kafka源端DDL处理默认策略'"
v-if="titleType === 'DB-Kafka源端DDL处理策略'"
v-show="titleType === 'DB-Kafka源端DDL处理策略'"
>
<Select v-model:value="model[field]" :options="typeOptions" />
<Alert
......@@ -84,10 +96,7 @@
message="含义:源端表对象进行DDL,任务应对策略配置。"
/>
</div>
<div
v-if="titleName === '系统异常默认策略'"
v-show="titleName === '系统异常默认策略'"
>
<div v-if="titleType === '系统异常策略'" v-show="titleType === '系统异常策略'">
<Select v-model:value="model[field]" :options="typeOptions" />
<Alert
style="margin-top: 20px"
......@@ -97,10 +106,7 @@
/>
<SystemStrategic />
</div>
<div
v-if="titleName === '目标端数据异常默认策略'"
v-show="titleName === '目标端数据异常默认策略'"
>
<div v-if="titleType === '数据异常策略'" v-show="titleType === '数据异常策略'">
<Select v-model:value="model[field]" :options="typeOptions" />
<Alert
style="margin-top: 20px"
......@@ -116,10 +122,7 @@
/>
<ErrorStrategic />
</div>
<div
v-if="titleName === '数据积压默认策略'"
v-show="titleName === '数据积压默认策略'"
>
<div v-if="titleType === '数据积压策略'" v-show="titleType === '数据积压策略'">
<Select v-model:value="model[field]" :options="typeOptions" />
<Alert
style="margin-top: 20px"
......@@ -170,6 +173,7 @@
errorFormSchema,
backlogFormSchema,
checkFormSchema,
addFormSchema,
} from './strategic.data';
import { useForm } from '@/components/Form';
import SystemStrategic from '@/views/realTimeSync/strategicIndicators/systemStrategic.vue';
......@@ -179,6 +183,7 @@
const searchInfo = reactive<Recordable>({});
const tabsKey = ref('1');
const isAdd = ref(false);
const typeOptions = [
{
......@@ -214,6 +219,24 @@
span: 24,
},
});
const [
registerAdd,
{
setFieldsValue: addsetFieldsValue,
updateSchema: addupdateSchema,
resetSchema: addresetSchema,
resetFields: addresetFields,
validate: addvalidate,
},
] = useForm({
labelWidth: 150,
schemas: addFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 24,
},
});
const [registerCheck, { setFieldsValue: checkSetFieldsValue, updateSchema: checkUpdateSchema }] =
useForm({
labelWidth: 150,
......@@ -236,6 +259,7 @@
getRowSelection,
setSelectedRows,
clearSelectedRowKeys,
setSelectedRowKeys,
},
] = useTable({
title: '',
......@@ -262,12 +286,17 @@
autoSubmitOnEnter: true,
showActionButtonGroup: false,
},
rowSelection: {
type: 'radio',
onChange: handleSelect,
},
clickToRowSelect: true,
useSearchForm: false,
striped: false,
showTableSetting: false,
bordered: false,
pagination: false,
rowSelection: { onSelect: handleSelect },
// rowSelection: { onSelect: handleSelect },
handleSearchInfoFn(info) {
return info;
},
......@@ -279,9 +308,14 @@
} as BasicTableProps);
function handleRow(record) {
titleName.value = record.strategicName;
handleab();
const index = TreeSystem.findIndex((item) => item.strategicId === record.strategicId);
if (index !== -1) {
titleName.value = TreeSystem[index].strategicName;
titleType.value = TreeSystem[index].strategicType;
}
console.log('record', record);
setSelectedRows([{ strategicId: record.strategicId }]);
// setSelectedRows({ strategicId: record.strategicId });、
if (record.strategicId === 101) {
console.log('被调用1');
resetSchema([...backlogFormSchema]);
......@@ -304,22 +338,37 @@
}
}
const titleName = ref(null);
const titleType = ref(null);
function handleSelect(record) {
console.log('record', record);
titleName.value = record.strategicName;
nextTick(() => {
setSelectedRows([{ strategicId: record.strategicId }]);
});
// nextTick(() => {
// setSelectedRows({ strategicId: record.strategicId });
// });
handleRow({ strategicId: record[0] });
console.log('getRowSelection', getRowSelection());
}
onMounted(() => {});
function handleAdd() {}
function handleAdd() {
titleType.value = null;
isAdd.value = true;
}
function handleab() {
isAdd.value = false;
}
function handleSubmit() {}
function handleDelete() {}
</script>
<style lang="less" scoped>
.hover1 {
cursor: pointer;
}
.select-class {
background-color: #e0f1ff;
}
::v-deep .ant-table-cell {
padding: 0;
}
</style>
......@@ -573,3 +573,39 @@ export const clearFormSchema: FormSchema[] = [
colProps: { lg: 24, md: 24 },
},
];
export const addFormSchema: FormSchema[] = [
{
field: 'strategicName',
label: '策略名称',
component: 'Input',
colProps: { lg: 13, md: 13 },
required: true,
},
{
field: 'description',
label: '描述',
component: 'InputTextArea',
componentProps: {
rows: 4,
},
colProps: { lg: 13, md: 13 },
},
{
field: 'strategicType',
label: '策略类型',
component: 'Select',
componentProps: {
placeholder: '策略类型',
options: [
{ label: 'DB-DB源端DDL处理策略', value: 'DB-DB源端DDL处理策略' },
{ label: 'DB-Kafka源端DDL处理策略', value: 'DB-Kafka源端DDL处理策略' },
{ label: '系统异常处理策略', value: '系统异常处理策略' },
{ label: '异常数据处理策略', value: '异常数据处理策略' },
{ label: '数据积压策略', value: '数据积压策略' },
{ label: '—致性检查策略', value: '致性检查策略' },
],
},
colProps: { lg: 13, md: 13 },
},
];
......@@ -12,7 +12,7 @@ export const TreeSystem: any[] = [
{
strategicId: 103,
strategicName: 'DB-DB源端DDL处理默认策略',
strategicType: 'DB-DB源DDL处理策略',
strategicType: 'DB-DB源DDL处理策略',
},
{
strategicId: 104,
......@@ -22,7 +22,7 @@ export const TreeSystem: any[] = [
{
strategicId: 105,
strategicName: '一致性检查默认策略',
strategicType: '致性检查策略',
strategicType: '致性检查策略',
},
{
strategicId: 106,
......
<template>
<div class="center">
<div class="center1">
<div class="center1-1">
<div class="center1-1-1">新建补数</div>
</div>
<div>
<a-button type="primary" style="margin-right: 10px" @click="cancelButton">取消</a-button>
<a-button type="primary" style="margin-right: 10px" @click="confirmButton">确认</a-button>
</div>
</div>
<div class="selectCss">
<BasicForm @register="registerForm1"/>
<Alert
show-icon
style="font-size: 14px;margin-bottom: 20px"
:message="message"
type="info"
/>
</div>
<div class="center2">
<div class="center2-1">手动选择任务流</div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-input-search
v-model:value="value"
placeholder="input search text"
style="width: 200px;margin-right: 80%"
@search="onSearch"
/>
<a-button type="primary" @click="addTaskStreamButton">添加任务流</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'icon-park-twotone:setting',
// label: '编辑',
onClick: resetNameButton.bind(null, record),
},
{
icon: 'jam:stop-sign',
// label: '编辑',
onClick: resetNameButton.bind(null, record),
},
{
icon: 'material-symbols:delete-outline',
// label: '编辑',
onClick: resetNameButton.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
</div>
<!-- 重命名 弹窗-->
<ResetNameModal @register="registerResetNameModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup>
import { Card, Col, Row,Alert} from 'ant-design-vue';
import Icon from '@/components/Icon/Icon.vue';
import { reactive,unref,onDeactivated,onMounted,ref,watch,Ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import { useMessage } from '@/hooks/web/useMessage';
import { useModal } from '@/components/Modal';
import { useGo } from '@/hooks/web/usePage';
import { useRoute } from 'vue-router';
import { router } from '@/router';
import {downloadByData} from "@/utils/file/download";
import {addTaskFormSchema1, addTaskFormSchema2, columns, searchFormSchema} from './supplyNumber.data';
import { tableData,TreeData } from './supplyNumberData'
import { BasicForm, useForm } from '@/components/Form';
import { useECharts } from '@/hooks/web/useECharts';
defineOptions({ name: 'AccountManagement' });
const chartRef = ref<HTMLDivElement | null>(null);
const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
const { createMessage, createConfirm } = useMessage();
const route = useRoute();
const go = useGo();
const message = ref('1、默认包含选中任务流在“补数时间范围”内有执行的相关上游和下游,故相关任务流需要处于发布中;\n' +
'2、若执行记录已经存在,则忽略不会产生补数记录;\n' +
'3、补数时会按照当前选中资源的最新版本配置执行。');
const [registerResetNameModal, { openModal: openResetNameModal }] = useModal();
const [registerTable, { reload,getForm,getRowSelection }] = useTable({
title: '',
api: async (params) => {
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: tableData.length,
code:'',
message:'',
data: [],
};
return { ...response,data: tableData };
},
rowKey: 'businessId',
columns,
rowSelection: true,
useSearchForm: false,
showTableSetting: false,
showIndexColumn:false,
bordered: true,
actionColumn: {
width: 150,
title: '操作',
dataIndex: 'action',
},
});
//初始化表单
const [registerForm1, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 80,
schemas: addTaskFormSchema1,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
const [registerForm2] = useForm({
labelWidth: 80,
schemas: addTaskFormSchema2,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
/**修改 按钮*/
function resetNameButton(record){
openResetNameModal(true,{
record
})
}
/**添加任务流 按钮*/
function addTaskStreamButton(record){
openResetNameModal(true,{
record
})
}
/** 转成树 */
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
}
onMounted(() => {
const treeData = handleTree(TreeData, 'businessId',undefined,undefined,undefined)
updateSchema([
{
field: 'tree',
componentProps: {
treeData: treeData
},
},
]);
});
</script>
<style lang="less" scoped>
.selectCss{
::v-deep(.ant-select-selector){
width:200px!important;
}
::v-deep(.ant-select){
width:200px!important;
}
}
.center{
width: 100%;
height: 100%;
background-color: white;
.center1{
width: 100%;
height: 10%;
display: flex;
justify-content: space-between;
align-items: center;
.center1-1{
display:flex;
height: 30px;
margin-left: 20px;
.center1-1-1{
display: flex;
align-items: center;
font-weight: bold;
font-size: 20px;
}
}
}
.center2{
width: 100%;
height:90%;
.center2-1{
margin-bottom: 20px;
margin-left: 10px;
font-weight: bold;
ont-size: 15px
}
}
}
</style>
<template>
<div class="center">
<div class="center1">
<div class="center1-1">
<Icon icon="material-symbols:sync" :size="35" :color="'rgb(121, 74, 235)'"/>
<div class="center1-1-1">补数记录</div>
<div class="selectCss">
<BasicForm @register="registerForm"/>
</div>
</div>
<div>
<a-button type="primary" style="margin-right: 10px" @click="reloadButton">手动刷新</a-button>
<a-button type="primary" style="margin-right: 10px" @click="cancelButton">取消</a-button>
<a-button type="primary" style="margin-right: 10px" @click="deleteButton">删除</a-button>
<a-button type="primary" style="margin-right: 10px" @click="addSupplyNumberButton">新增补数</a-button>
</div>
</div>
<div class="center2">
<div class="center2-1">
<div style="margin-left: 10px">
<BasicForm @register="registerForm2"/>
</div>
</div>
<BasicTable @register="registerTable">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'icon-park-twotone:setting',
// label: '编辑',
onClick: addSupplyNumberButton.bind(null, record),
},
{
icon: 'jam:stop-sign',
// label: '编辑',
onClick: addSupplyNumberButton.bind(null, record),
},
{
icon: 'material-symbols:delete-outline',
// label: '编辑',
onClick: addSupplyNumberButton.bind(null, record),
},
]"
/>
</template>
</template>
<template #latestEventTime="{ text, record }">
<a @click="showDetails(record)"> {{ text }}</a>
</template>
</BasicTable>
</div>
<!-- 重命名 弹窗-->
<ResetNameModal @register="registerResetNameModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup>
import { Card, Col, Row} from 'ant-design-vue';
import Icon from '@/components/Icon/Icon.vue';
import { reactive,unref,onDeactivated,onMounted,ref,watch,Ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import { useMessage } from '@/hooks/web/useMessage';
import { useModal } from '@/components/Modal';
import { useGo } from '@/hooks/web/usePage';
import { useRoute } from 'vue-router';
import { router } from '@/router';
import {downloadByData} from "@/utils/file/download";
import { columns,searchFormSchema,selectFormSchema } from './supplyNumber.data';
import { tableData,TreeData } from './supplyNumberData'
import { BasicForm, useForm } from '@/components/Form';
import { useECharts } from '@/hooks/web/useECharts';
defineOptions({ name: 'AccountManagement' });
const chartRef = ref<HTMLDivElement | null>(null);
const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
const { createMessage, createConfirm } = useMessage();
const route = useRoute();
const go = useGo();
const [registerResetNameModal, { openModal: openResetNameModal }] = useModal();
const [registerTable, { reload,getForm,getRowSelection }] = useTable({
title: '',
api: async (params) => {
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: tableData.length,
code:'',
message:'',
data: [],
};
return { ...response,data: tableData };
},
rowKey: 'businessId',
columns,
rowSelection: true,
useSearchForm: false,
showTableSetting: false,
showIndexColumn:false,
bordered: true,
actionColumn: {
width: 150,
title: '操作',
dataIndex: 'action',
},
});
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelAlign: 'left',
labelWidth: 100,
schemas: selectFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
const [registerForm2] = useForm({
labelWidth: 80,
schemas: searchFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
/**新建补数任务*/
function addSupplyNumberButton(record){
router.push({
path: '/taskScheduling/taskFlowMaintenance/supplyNumber/addTask',
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
}
onMounted(() => {
const treeData = handleTree(TreeData, 'businessId',undefined,undefined,undefined)
updateSchema([
{
field: 'tree',
componentProps: {
treeData: treeData
},
},
]);
});
</script>
<style lang="less" scoped>
.selectCss{
margin-left: 30px;
::v-deep(.ant-select-selector){
width:200px!important;
}
::v-deep(.ant-select){
width:200px!important;
}
}
.center{
width: 100%;
height: 100%;
background-color: white;
.center1{
width: 100%;
height: 10%;
display: flex;
justify-content: space-between;
align-items: center;
.center1-1{
display:flex;
height: 30px;
margin-left: 20px;
.center1-1-1{
display: flex;
align-items: center;
font-weight: bold
}
}
}
.center2{
width: 100%;
height:90%;
.center2-1{
display: flex;
justify-content: space-between
}
}
}
</style>
import {getAllRoleList} from '@/api/system/role/role';
import { BasicColumn, FormSchema } from '@/components/Table';
import {h} from "vue";
import {Input, Select, Tag} from "ant-design-vue";
import { Switch } from 'ant-design-vue';
import {useMessage} from "@/hooks/web/useMessage";
import {changeFlagApi} from "@/api/system/user/user";
import {DescItem} from "@/components/Description";
import {uploadApi} from "@/api/sys/upload"; // 引入开关组件
type CheckedType = boolean | string | number;
/**首页-table列表*/
export const columns: BasicColumn[] = [
{
title: '补数名称',
dataIndex: 'supplyNumberName',
width: 120
},
{
title: '创建者',
dataIndex: 'createBy',
width: 120
},
{
title: '补数状态',
dataIndex: 'supplyNumberState',
width: 120
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 120
},
{
title: '完成时间',
dataIndex: 'completionTime',
width: 120
},
{
title: '补数日期',
dataIndex: 'supplyNumberTime',
width: 120
},
];
/**首页-搜索表单*/
export const searchFormSchema: FormSchema[] = [
{
field: 'supplyNumberName',
label: '',
component: 'Input',
componentProps: {
placeholder: '请输入关键字搜索',
},
},
{
field: 'createTime',
label: '创建时间',
component: 'DatePicker',
componentProps: {
placeholder: '请选择创建时间',
},
},
{
field: 'supplyState',
label: '补数状态',
component: 'Select',
required: true,
componentProps: {
placeholder: '请选择补数状态',
options: [
{
label: '已取消',
value: '已取消',
},
{
label: '已完成',
value: '已完成',
},
],
},
},
];
/**首页-下拉框表单*/
export const selectFormSchema: FormSchema[] = [
{
field: 'tree',
label: '',
component: 'TreeSelect',
colProps: { span: 3 },
componentProps: {
maxTagCount:1,//最大tag数量
showArrow: true,//箭头
treeCheckable: true,
fieldNames: {
label: 'treeName',
value: 'businessId',
},
getPopupContainer: () => document.body,
},
},
];
/**新建任务页-表单1*/
export const addTaskFormSchema1: FormSchema[] = [
{
field: 'supplyNumberName',
label: '补数名称',
component: 'Input',
componentProps: {
placeholder: '请输入补数名称',
},
},
{
field: 'rangeTime',
label: ' 补数时间范围',
labelWidth:120,
component: 'RangePicker',
componentProps: {
placeholder: ['开始时间', '结束时间'],
},
},
];
/**新建任务页-表单2*/
export const addTaskFormSchema2: FormSchema[] = [
{
field: 'taskStreamName',
label: '',
component: 'Input',
componentProps: {
placeholder: '任务流名称搜索',
},
},
];
import {getAllRoleList} from '@/api/system/role/role';
import { BasicColumn, FormSchema } from '@/components/Table';
import {h} from "vue";
import {Tag} from "ant-design-vue";
import { Switch } from 'ant-design-vue';
import {useMessage} from "@/hooks/web/useMessage";
import {changeFlagApi} from "@/api/system/user/user";
import {relatedQualityColumns} from "@/views/dataStandards/basicStandards/basicStandards.data";
import {GrowCardItem} from "@/views/dashboard/analysis/data"; // 引入开关组件
type CheckedType = boolean | string | number;
/**主页面树/列表 数据*/
export const TreeData: any[] = [
{
businessId: 100,
treeName: '全选',
anotherName: '全选',
parentId: 0,
},
{
businessId: 201,
treeName: '共享工作区',
anotherName: '共享工作区',
parentId: 100,
},
{
businessId: 202,
treeName: '商城工作区',
anotherName: '商城工作区',
parentId: 100,
},
{
businessId: 203,
treeName: 'admin个人工作区',
anotherName: 'admin个人工作区',
parentId: 100,
},
];
/**主页面列表 数据*/
export const tableData: any[] =[
{
businessId:'1',
supplyNumberName: 'bxwang-补数测试1',
createBy:'admin',
supplyNumberState: '已取消',
createTime: '2024-01-01 08:00:00',
completionTime: '2024-01-01 09:00:00',
supplyNumberTime: '2024-01-01 09:00:00 - 2024-01-10 09:00:00',
},
{
businessId:'2',
supplyNumberName: '补数-WARP-94793',
createBy:'admin',
supplyNumberState: '已完成',
createTime: '2024-01-01 08:00:00',
completionTime: '2024-01-01 09:00:00',
supplyNumberTime: '2024-01-01 09:00:00 - 2024-01-10 09:00:00',
},
{
businessId:'3',
supplyNumberName: '补数-WARP-94794',
createBy:'admin',
supplyNumberState: '已完成',
createTime: '2024-01-01 08:00:00',
completionTime: '2024-01-01 09:00:00',
supplyNumberTime: '2024-01-01 09:00:00 - 2024-01-10 09:00:00',
},
{
businessId:'4',
supplyNumberName: '补数-0 0 * * * ? *',
createBy:'admin',
supplyNumberState: '已完成',
createTime: '2024-01-01 08:00:00',
completionTime: '2024-01-01 09:00:00',
supplyNumberTime: '2024-01-01 09:00:00 - 2024-01-10 09:00:00',
},
{
businessId:'5',
supplyNumberName: '补数-0 1 * * * ? *',
createBy:'admin',
supplyNumberState: '已取消',
createTime: '2024-01-01 08:00:00',
completionTime: '2024-01-01 09:00:00',
supplyNumberTime: '2024-01-01 09:00:00 - 2024-01-10 09:00:00',
},
{
businessId:'6',
supplyNumberName: 'TEST',
createBy:'admin',
supplyNumberState: '已取消',
createTime: '2024-01-01 08:00:00',
completionTime: '2024-01-01 09:00:00',
supplyNumberTime: '2024-01-01 09:00:00 - 2024-01-10 09:00:00',
},
]
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