Commit cf586fd1 authored by 曹泽华's avatar 曹泽华

数仓开发 策略指标

parent b98fa22d
<template> <template>
<PageWrapper title="生成原子标签" dense contentFullHeight fixedHeight> <PageWrapper contentFullHeight fixedHeight>
<template #extra> <template #headerContent>
<a-button type="primary">保存</a-button> <div class="flex" style="justify-content: space-between">
<div style="font-size: 18px; font-weight: 650">
<LeftOutlined @click="handleGo" /><DeploymentUnitOutlined
style="color: #3b8cf7; font-size: 24px"
/>生成原子标签</div
>
<a-button type="primary" @click="handleSave">保存</a-button>
</div>
</template> </template>
<template #footer> <template #footer>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
...@@ -25,6 +32,7 @@ ...@@ -25,6 +32,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { Input, Select } from 'ant-design-vue'; import { Input, Select } from 'ant-design-vue';
import { LeftOutlined, DeploymentUnitOutlined } from '@ant-design/icons-vue';
import PageWrapper from '../../../../../components/Page/src/PageWrapper.vue'; import PageWrapper from '../../../../../components/Page/src/PageWrapper.vue';
import BasicTable from '@/components/Table/src/BasicTable.vue'; import BasicTable from '@/components/Table/src/BasicTable.vue';
import { BasicTableProps, useTable } from '@/components/Table'; import { BasicTableProps, useTable } from '@/components/Table';
...@@ -33,6 +41,8 @@ ...@@ -33,6 +41,8 @@
atomTableColumn, atomTableColumn,
} from '@/views/mallResourceDevelopment/label/labelDevelop/atomLabel/atom.data'; } from '@/views/mallResourceDevelopment/label/labelDevelop/atomLabel/atom.data';
import { atomTableData } from '@/views/mallResourceDevelopment/label/labelDevelop/atomLabel/atomData'; import { atomTableData } from '@/views/mallResourceDevelopment/label/labelDevelop/atomLabel/atomData';
import { useMessage } from '@/hooks/web/useMessage';
import { router } from '@/router';
function hasSelect(record) { function hasSelect(record) {
return getAtomSelectKeys().includes(record.businessId); return getAtomSelectKeys().includes(record.businessId);
...@@ -62,6 +72,7 @@ ...@@ -62,6 +72,7 @@
}, },
rowKey: 'businessId', rowKey: 'businessId',
rowSelection: true, rowSelection: true,
striped: false,
columns: atomTableColumn, columns: atomTableColumn,
showIndexColumn: false, showIndexColumn: false,
showTableSetting: false, showTableSetting: false,
...@@ -72,6 +83,16 @@ ...@@ -72,6 +83,16 @@
autoSubmitOnEnter: true, autoSubmitOnEnter: true,
}, },
} as BasicTableProps); } as BasicTableProps);
const { createMessage } = useMessage();
function handleSave() {
createMessage.success('保存成功!');
router.go(-1);
}
function handleGo() {
router.go(-1);
}
</script> </script>
<style scoped></style> <style scoped></style>
<template> <template>
<PageWrapper title="创建商城标签" dense content-full-height fixed-height> <PageWrapper title="创建商城标签" dense content-full-height fixed-height>
<template #extra> <template #extra>
<a-button type="link"> <a-button type="link" @click="handleCancel">
<div><RollbackOutlined /></div>取消 <div><RollbackOutlined /></div>取消
</a-button> </a-button>
<a-button type="link"> <a-button type="link" @click="handleCreate">
<div><CheckOutlined /></div>创建 <div><CheckOutlined /></div>创建
</a-button> </a-button>
</template> </template>
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
import BasicTable from '@/components/Table/src/BasicTable.vue'; import BasicTable from '@/components/Table/src/BasicTable.vue';
import { BasicTableProps, useTable } from '@/components/Table'; import { BasicTableProps, useTable } from '@/components/Table';
import { rangeTableData, gatherData, gatherDataTableHeader } from './upShopData'; import { rangeTableData, gatherData, gatherDataTableHeader } from './upShopData';
import {useRouter} from "vue-router";
const visibleRangeOptions = [ const visibleRangeOptions = [
{ {
...@@ -185,11 +186,16 @@ ...@@ -185,11 +186,16 @@
// 动态头listColumn获取 // 动态头listColumn获取
const headerFieldList = []; const headerFieldList = [];
const router = useRouter();
onMounted(() => { onMounted(() => {
gatherDataTableHeader.forEach((item) => { gatherDataTableHeader.forEach((item) => {
headerFieldList.push(item.field); headerFieldList.push(item.field);
}); });
}); });
function handleCancel() {
router.go(-1);
}
</script> </script>
<style scoped> <style scoped>
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
import BasicHelp from '@/components/Basic/src/BasicHelp.vue'; import BasicHelp from '@/components/Basic/src/BasicHelp.vue';
const { createMessage, createConfirm } = useMessage(); const { createMessage, createConfirm } = useMessage();
const useTime = ref(); const useTime = ref('1');
const optionList = [ const optionList = [
{ {
value: '1', value: '1',
......
...@@ -19,17 +19,24 @@ ...@@ -19,17 +19,24 @@
<template #retainTime="{ field, model }"> <template #retainTime="{ field, model }">
<RadioGroup v-model:value="model[field]"> <RadioGroup v-model:value="model[field]">
<Radio :style="radioStyle" :value="1" <Radio :style="radioStyle" :value="1"
><span>保留从</span><DatePicker style="width: 200px" /><span ><span>保留从</span
>开始的所有执行或监控数据</span ><DatePicker
></Radio value-format="YYYY-MM-DD"
v-model:value="model.retainDate"
style="width: 200px"
/><span>开始的所有执行或监控数据</span></Radio
> >
<Radio :style="radioStyle" :value="2" <Radio :style="radioStyle" :value="2"
><span>保留时间为</span><InputNumber style="width: 200px" /><span ><span>保留时间为</span
><InputNumber v-model:value="model.retainDay" style="width: 200px" /><span
>天的执行或监控数据</span >天的执行或监控数据</span
></Radio ></Radio
> >
</RadioGroup> </RadioGroup>
</template> </template>
<template #clearTime="{ field, model }">
<TimePicker value-format="HH:mm:ss" v-model:value="model[field]" style="width: 200px" />
</template>
<template #formFooter> <template #formFooter>
<a-button style="margin-left: 30%" type="primary" @click="handleSave"> 保存 </a-button> <a-button style="margin-left: 30%" type="primary" @click="handleSave"> 保存 </a-button>
</template> </template>
...@@ -40,12 +47,13 @@ ...@@ -40,12 +47,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import PageWrapper from '@/components/Page/src/PageWrapper.vue'; import PageWrapper from '@/components/Page/src/PageWrapper.vue';
import { Alert, RadioGroup, DatePicker, InputNumber, Radio } from 'ant-design-vue'; import { Alert, RadioGroup, DatePicker, InputNumber, Radio, TimePicker } from 'ant-design-vue';
import BasicForm from '@/components/Form/src/BasicForm.vue'; import BasicForm from '@/components/Form/src/BasicForm.vue';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { useForm } from '@/components/Form'; import { useForm } from '@/components/Form';
import { checkFormSchema, clearFormSchema } from './strategic.data'; import { checkFormSchema, clearFormSchema } from './strategic.data';
import { reactive } from 'vue'; import { onMounted, reactive, ref } from 'vue';
import { Data } from '@/views/kinship/kinshipOperations/kinshipOperationsData';
const { createMessage } = useMessage(); const { createMessage } = useMessage();
...@@ -57,7 +65,7 @@ ...@@ -57,7 +65,7 @@
}); });
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({ const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 300, labelWidth: 460,
schemas: clearFormSchema, schemas: clearFormSchema,
showActionButtonGroup: false, showActionButtonGroup: false,
actionColOptions: { actionColOptions: {
...@@ -65,6 +73,16 @@ ...@@ -65,6 +73,16 @@
}, },
}); });
onMounted(() => {
setFieldsValue({
clearTime: '00:00:00',
retainDate: '1970-01-01',
retainDay: 7,
retainTime: 1,
errorData: '2',
});
});
function handleSave() { function handleSave() {
createMessage.success('保存成功!'); createMessage.success('保存成功!');
} }
......
<template> <template>
<PageWrapper> <PageWrapper dense>
<Tabs v-model:activeKey="tabsKey"> <template #footer>
<Tabs.TabPane key="1" tab="任务策略配置"> <Tabs v-model:activeKey="tabsKey">
<div style="display: flex"> <Tabs.TabPane key="1" tab="任务策略配置">
<div class="w-1/4"> <div style="display: flex">
<BasicTable @register="registerTable" :searchInfo="searchInfo"> <div class="w-1/3 tree-height">
<template #toolbar> <BasicTable @register="registerTable" :searchInfo="searchInfo">
<div style="flex: 1"> <template #toolbar>
<InputSearch placeholder="输入关键字搜索" style="width: 170px" /> <div style="flex: 1">
<Select <InputSearch placeholder="输入关键字搜索" style="width: 170px" />
placeholder="策略类型" <Select
style="width: 150px; margin-left: 10px" placeholder="策略类型"
:options="typeOptions" style="width: 150px; margin-left: 10px"
/> :options="typeOptions"
<a-button type="link" @click="handleAdd" />
><PlusOutlined style="color: #9396a4" <a-button type="link" @click="handleAdd"
/></a-button> ><PlusOutlined style="color: #9396a4"
</div> /></a-button>
</template> </div>
<template #strategicName="{ text, record }"> </template>
<div @click="handleRow(record)" class="hover1"> <template #strategicName="{ text, record }">
{{ text }} <div @click="handleRow(record)" class="hover1">
</div>
</template>
<template #strategicType="{ text, record }">
<div class="flex justify-between gap-10px">
<div class="hover1 flex-1" @click="handleRow(record)">
{{ text }} {{ text }}
</div> </div>
<DeleteOutlined </template>
v-if="record.strategicId > 106" <template #strategicType="{ text, record }">
class="hover1" <div class="flex justify-between gap-10px">
<div class="hover1 flex-1" @click="handleRow(record)">
{{ text }}
</div>
<DeleteOutlined
v-if="record.strategicId > 106"
class="hover1"
@click="handleDelete"
/>
</div>
</template>
</BasicTable>
</div>
<div class="w-2/3">
<div
v-if="titleType !== null || isAdd"
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
v-if="!isAdd && titleId > 106"
type="primary"
@click="handleDelete" @click="handleDelete"
/> style="margin-right: 10px"
>删除</a-button
>
<a-button type="primary" @click="handleSubmit">保存</a-button>
</div> </div>
</template>
</BasicTable>
</div>
<div class="w-3/4">
<div
v-if="titleType !== null || isAdd"
style="display: flex; justify-content: space-between"
>
<div style="font-size: 16px; font-weight: 650; margin: 0 0 20px 20px">
{{ titleName }}
</div> </div>
<div> <div v-if="isAdd">
<a-button <BasicForm @register="registerAdd" />
v-if="!isAdd && titleId > 106"
type="primary"
@click="handleDelete"
style="margin-right: 10px"
>删除</a-button
>
<a-button type="primary" @click="handleSubmit">保存</a-button>
</div> </div>
</div> <BasicForm v-show="titleType !== null" @register="registerForm">
<div v-if="isAdd"> <template #strategicType="{ field, model }">
<BasicForm @register="registerAdd" /> <div v-if="model.strategicType === 'DB-DB源端DDL处理策略'">
</div> <Select v-model:value="model[field]" :options="typeOptions" />
<BasicForm v-show="titleType !== null" @register="registerForm"> <Alert
<template #strategicType="{ field, model }"> style="margin-top: 20px"
<div v-if="model.strategicType === 'DB-DB源端DDL处理策略'"> type="info"
<Select v-model:value="model[field]" :options="typeOptions" /> showIcon
<Alert message="当前DDL自动变更仅支持源端和目标端数据源类型相同,且未配置库/表/字段映射的场景。并且自动变更不经过审批流程,对于目标端数据结构、数据传输等方面存在影响,请谨慎选择。"
style="margin-top: 20px" />
type="info"
showIcon
message="当前DDL自动变更仅支持源端和目标端数据源类型相同,且未配置库/表/字段映射的场景。并且自动变更不经过审批流程,对于目标端数据结构、数据传输等方面存在影响,请谨慎选择。"
/>
</div>
<div v-if="model.strategicType === 'DB-Kafka源端DDL处理策略'">
<Select v-model:value="model[field]" :options="typeOptions" />
<Alert
style="margin-top: 20px"
type="info"
showIcon
message="含义:源端表对象进行DDL,任务应对策略配置。"
/>
</div>
<div
v-if="model.strategicType === '系统异常策略'"
v-show="model.strategicType === '系统异常策略'"
>
<Select v-model:value="model[field]" :options="typeOptions" />
<Alert
style="margin: 20px 0"
type="info"
showIcon
message="含义:服务级别的系统异常的应对措施预览,部分异常支持自定义配置。"
/>
<SystemStrategic />
</div>
<div
v-if="model.strategicType === '数据异常策略'"
v-show="model.strategicType === '数据异常策略'"
>
<Select v-model:value="model[field]" :options="typeOptions" />
<Alert
style="margin-top: 20px"
type="info"
showIcon
message="含义:实时任务目标端进行数据写入、数据转换等出现数据异常是的任务处理策略。"
/>
<Alert
style="margin: 20px 0"
type="info"
showIcon
message="所有捕获的异常数据均会记录在任务运维的异常数据详情中"
/>
<ErrorStrategic />
</div>
<div
v-if="model.strategicType === '一致性检查策略'"
v-show="model.strategicType === '一致性检查策略'"
>
<Select v-model:value="model[field]" :options="typeOptions" />
<Alert
style="margin-top: 20px"
type="info"
showIcon
message="含义:实时任务数据一致性功能的采集时间间隔设定。"
/>
</div>
<div
v-if="model.strategicType === '数据积压策略'"
v-show="model.strategicType === '数据积压策略'"
>
<Select v-model:value="model[field]" :options="typeOptions" />
<Alert
style="margin-top: 20px"
type="info"
showIcon
message="含义:有效数据进入任务对应的Topic后,任务中任意Topic的数据积压情况的策略定义"
/>
<div style="margin-top: 20px">
<span>当数据偏差超过</span
><Input style="width: 200px" v-model.value="model.strategicWarn" /><span
>条时,进行告警处理</span
>
</div> </div>
<div style="margin-top: 20px"> <div v-if="model.strategicType === 'DB-Kafka源端DDL处理策略'">
<span>当数据偏差超过</span <Select v-model:value="model[field]" :options="typeOptions" />
><Input style="width: 200px" v-model.value="model.strategicStop" /><span <Alert
>条时,暂停源端读取任务</span style="margin-top: 20px"
> type="info"
showIcon
message="含义:源端表对象进行DDL,任务应对策略配置。"
/>
</div>
<div
v-if="model.strategicType === '系统异常策略'"
v-show="model.strategicType === '系统异常策略'"
>
<Select v-model:value="model[field]" :options="typeOptions" />
<Alert
style="margin: 20px 0"
type="info"
showIcon
message="含义:服务级别的系统异常的应对措施预览,部分异常支持自定义配置。"
/>
<SystemStrategic />
</div>
<div
v-if="model.strategicType === '数据异常策略'"
v-show="model.strategicType === '数据异常策略'"
>
<Select v-model:value="model[field]" :options="typeOptions" />
<Alert
style="margin-top: 20px"
type="info"
showIcon
message="含义:实时任务目标端进行数据写入、数据转换等出现数据异常是的任务处理策略。"
/>
<Alert
style="margin: 20px 0"
type="info"
showIcon
message="所有捕获的异常数据均会记录在任务运维的异常数据详情中"
/>
<ErrorStrategic />
</div>
<div
v-if="model.strategicType === '一致性检查策略'"
v-show="model.strategicType === '一致性检查策略'"
>
<Select v-model:value="model[field]" :options="typeOptions" />
<Alert
style="margin-top: 20px"
type="info"
showIcon
message="含义:实时任务数据一致性功能的采集时间间隔设定。"
/>
</div> </div>
</div>
<div
v-if="model.strategicType === null || model.strategicType === undefined"
v-show="model.strategicType === null || model.strategicType === undefined"
>
<Select v-model:value="model[field]" :options="typeOptions" />
</div>
</template>
<template #checkSpan="{ field, model }">
<div style="display: flex">
<div <div
style="width: 150px; text-align: right; padding-right: 6px; line-height: 30px" v-if="model.strategicType === '数据积压策略'"
>检查间隔</div v-show="model.strategicType === '数据积压策略'"
> >
<div> <Select v-model:value="model[field]" :options="typeOptions" />
<div style="display: flex"> <Alert
<InputNumber style="margin-top: 20px"
style="width: 180px" type="info"
v-model:value="model[field]" showIcon
:min="1" message="含义:有效数据进入任务对应的Topic后,任务中任意Topic的数据积压情况的策略定义"
:step="1" />
/> <div style="margin-top: 20px">
<span style="line-height: 30px; margin-left: 5px">分钟</span> <span>当数据偏差超过</span
><Input style="width: 200px" v-model:value="strategicWarn" /><span
>条时,进行告警处理</span
>
</div> </div>
<div style="color: #b1b7cc"> <div style="margin-top: 20px">
检查间隔不建议过小,推荐5分钟、10分钟等可被整除的检查间隔,不可以超过60分钟。 <span>当数据偏差超过</span
><Input style="width: 200px" v-model:value="strategicStop" /><span
>条时,暂停源端读取任务</span
>
</div> </div>
</div> </div>
</div>
</template> <div
</BasicForm> v-if="model.strategicType === null || model.strategicType === undefined"
v-show="model.strategicType === null || model.strategicType === undefined"
>
<Select v-model:value="model[field]" :options="typeOptions" />
</div>
</template>
<template #checkSpan="{ field, model }">
<div style="display: flex">
<div
style="width: 150px; text-align: right; padding-right: 6px; line-height: 30px"
>检查间隔</div
>
<div>
<div style="display: flex">
<InputNumber
style="width: 180px"
v-model:value="model[field]"
:min="1"
:step="1"
/>
<span style="line-height: 30px; margin-left: 5px">分钟</span>
</div>
<div style="color: #b1b7cc">
检查间隔不建议过小,推荐5分钟、10分钟等可被整除的检查间隔,不可以超过60分钟。
</div>
</div>
</div>
</template>
</BasicForm>
</div>
</div> </div>
</div> </Tabs.TabPane>
</Tabs.TabPane> <Tabs.TabPane key="2" tab="清理策略">
<Tabs.TabPane key="2" tab="清理策略"> <ClearStrategic />
<ClearStrategic /> </Tabs.TabPane>
</Tabs.TabPane> </Tabs>
</Tabs> </template>
<SaveModal @register="registerModal" :title-type="titleType" /> <SaveModal @register="registerModal" :title-type="titleType" />
</PageWrapper> </PageWrapper>
...@@ -227,6 +229,8 @@ ...@@ -227,6 +229,8 @@
const tabsKey = ref('1'); const tabsKey = ref('1');
const isAdd = ref(false); const isAdd = ref(false);
const strategicWarn = ref(100000);
const strategicStop = ref(500000);
const typeOptions = [ const typeOptions = [
{ {
...@@ -300,7 +304,6 @@ ...@@ -300,7 +304,6 @@
}, },
] = useTable({ ] = useTable({
title: '', title: '',
scroll: { y: 500 },
api: async (params) => { api: async (params) => {
console.log('params:', params); console.log('params:', params);
const response = { const response = {
...@@ -430,4 +433,7 @@ ...@@ -430,4 +433,7 @@
::v-deep .ant-table-cell { ::v-deep .ant-table-cell {
padding: 0; padding: 0;
} }
.tree-height {
height: calc(100vh - 161px);
}
</style> </style>
...@@ -79,7 +79,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -79,7 +79,7 @@ export const dbFormSchema: FormSchema[] = [
field: 'strategicName', field: 'strategicName',
label: '策略名称', label: '策略名称',
component: 'Input', component: 'Input',
colProps: { lg: 13, md: 13 }, colProps: { lg: 24, md: 24 },
required: true, required: true,
}, },
{ {
...@@ -89,13 +89,13 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -89,13 +89,13 @@ export const dbFormSchema: FormSchema[] = [
componentProps: { componentProps: {
rows: 4, rows: 4,
}, },
colProps: { lg: 13, md: 13 }, colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'strategicType', field: 'strategicType',
label: '策略类型', label: '策略类型',
slot: 'strategicType', slot: 'strategicType',
colProps: { lg: 13, md: 13 }, colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'checkSpan', field: 'checkSpan',
...@@ -103,6 +103,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -103,6 +103,7 @@ export const dbFormSchema: FormSchema[] = [
return model.strategicType === '一致性检查策略'; return model.strategicType === '一致性检查策略';
}, },
slot: 'checkSpan', slot: 'checkSpan',
defaultValue: 5,
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
}, },
{ {
...@@ -140,7 +141,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -140,7 +141,7 @@ export const dbFormSchema: FormSchema[] = [
}, },
], ],
}, },
colProps: { lg: 13, md: 13 }, colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'deleteTable', field: 'deleteTable',
...@@ -149,6 +150,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -149,6 +150,7 @@ export const dbFormSchema: FormSchema[] = [
return model.strategicType === 'DB-DB源端DDL处理策略'; return model.strategicType === 'DB-DB源端DDL处理策略';
}, },
component: 'RadioGroup', component: 'RadioGroup',
defaultValue: '1',
componentProps: { componentProps: {
options: [ options: [
{ {
...@@ -166,6 +168,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -166,6 +168,7 @@ export const dbFormSchema: FormSchema[] = [
{ {
field: 'deleteField', field: 'deleteField',
label: '字段删除', label: '字段删除',
defaultValue: '1',
show: ({ model }) => { show: ({ model }) => {
return model.strategicType === 'DB-DB源端DDL处理策略'; return model.strategicType === 'DB-DB源端DDL处理策略';
}, },
...@@ -191,6 +194,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -191,6 +194,7 @@ export const dbFormSchema: FormSchema[] = [
{ {
field: 'addField', field: 'addField',
label: '新增字段', label: '新增字段',
defaultValue: '1',
show: ({ model }) => { show: ({ model }) => {
return model.strategicType === 'DB-DB源端DDL处理策略'; return model.strategicType === 'DB-DB源端DDL处理策略';
}, },
...@@ -212,6 +216,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -212,6 +216,7 @@ export const dbFormSchema: FormSchema[] = [
{ {
field: 'fieldUpdate', field: 'fieldUpdate',
label: '字段类型或精度变更', label: '字段类型或精度变更',
defaultValue: '3',
show: ({ model }) => { show: ({ model }) => {
return model.strategicType === 'DB-DB源端DDL处理策略'; return model.strategicType === 'DB-DB源端DDL处理策略';
}, },
...@@ -237,6 +242,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -237,6 +242,7 @@ export const dbFormSchema: FormSchema[] = [
{ {
field: 'addTable', field: 'addTable',
label: '新增数据表', label: '新增数据表',
defaultValue: '1',
show: ({ model }) => { show: ({ model }) => {
return model.strategicType === 'DB-DB源端DDL处理策略'; return model.strategicType === 'DB-DB源端DDL处理策略';
}, },
...@@ -262,6 +268,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -262,6 +268,7 @@ export const dbFormSchema: FormSchema[] = [
{ {
field: 'clearTable', field: 'clearTable',
label: '清空表', label: '清空表',
defaultValue: '1',
show: ({ model }) => { show: ({ model }) => {
return model.strategicType === 'DB-DB源端DDL处理策略'; return model.strategicType === 'DB-DB源端DDL处理策略';
}, },
...@@ -287,6 +294,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -287,6 +294,7 @@ export const dbFormSchema: FormSchema[] = [
{ {
field: 'fieldRename', field: 'fieldRename',
label: '字段重命名', label: '字段重命名',
defaultValue: '1',
show: ({ model }) => { show: ({ model }) => {
return model.strategicType === 'DB-DB源端DDL处理策略'; return model.strategicType === 'DB-DB源端DDL处理策略';
}, },
...@@ -308,6 +316,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -308,6 +316,7 @@ export const dbFormSchema: FormSchema[] = [
{ {
field: 'renameTable', field: 'renameTable',
label: '表重命名', label: '表重命名',
defaultValue: '1',
show: ({ model }) => { show: ({ model }) => {
return model.strategicType === 'DB-DB源端DDL处理策略'; return model.strategicType === 'DB-DB源端DDL处理策略';
}, },
...@@ -329,6 +338,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -329,6 +338,7 @@ export const dbFormSchema: FormSchema[] = [
{ {
field: 'deleteTable', field: 'deleteTable',
label: '数据表删除', label: '数据表删除',
defaultValue: '1',
show: ({ model }) => { show: ({ model }) => {
return model.strategicType === 'DB-Kafka源端DDL处理策略'; return model.strategicType === 'DB-Kafka源端DDL处理策略';
}, },
...@@ -346,6 +356,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -346,6 +356,7 @@ export const dbFormSchema: FormSchema[] = [
{ {
field: 'deleteField', field: 'deleteField',
label: '字段删除', label: '字段删除',
defaultValue: '1',
show: ({ model }) => { show: ({ model }) => {
return model.strategicType === 'DB-Kafka源端DDL处理策略'; return model.strategicType === 'DB-Kafka源端DDL处理策略';
}, },
...@@ -363,6 +374,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -363,6 +374,7 @@ export const dbFormSchema: FormSchema[] = [
{ {
field: 'addField', field: 'addField',
label: '新增字段', label: '新增字段',
defaultValue: '1',
show: ({ model }) => { show: ({ model }) => {
return model.strategicType === 'DB-Kafka源端DDL处理策略'; return model.strategicType === 'DB-Kafka源端DDL处理策略';
}, },
...@@ -378,8 +390,9 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -378,8 +390,9 @@ export const dbFormSchema: FormSchema[] = [
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'fieldUpdate', field: 'kafafieldUpdate',
label: '字段类型或精度变更', label: '字段类型或精度变更',
defaultValue: '1',
show: ({ model }) => { show: ({ model }) => {
return model.strategicType === 'DB-Kafka源端DDL处理策略'; return model.strategicType === 'DB-Kafka源端DDL处理策略';
}, },
...@@ -397,6 +410,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -397,6 +410,7 @@ export const dbFormSchema: FormSchema[] = [
{ {
field: 'addTable', field: 'addTable',
label: '新增数据表', label: '新增数据表',
defaultValue: '1',
show: ({ model }) => { show: ({ model }) => {
return model.strategicType === 'DB-Kafka源端DDL处理策略'; return model.strategicType === 'DB-Kafka源端DDL处理策略';
}, },
...@@ -414,6 +428,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -414,6 +428,7 @@ export const dbFormSchema: FormSchema[] = [
{ {
field: 'clearTable', field: 'clearTable',
label: '清空表', label: '清空表',
defaultValue: '1',
show: ({ model }) => { show: ({ model }) => {
return model.strategicType === 'DB-Kafka源端DDL处理策略'; return model.strategicType === 'DB-Kafka源端DDL处理策略';
}, },
...@@ -431,6 +446,7 @@ export const dbFormSchema: FormSchema[] = [ ...@@ -431,6 +446,7 @@ export const dbFormSchema: FormSchema[] = [
{ {
field: 'fieldRename', field: 'fieldRename',
label: '字段重命名', label: '字段重命名',
defaultValue: '1',
show: ({ model }) => { show: ({ model }) => {
return model.strategicType === 'DB-Kafka源端DDL处理策略'; return model.strategicType === 'DB-Kafka源端DDL处理策略';
}, },
...@@ -452,7 +468,7 @@ export const kafkaFormSchema: FormSchema[] = [ ...@@ -452,7 +468,7 @@ export const kafkaFormSchema: FormSchema[] = [
field: 'strategicName', field: 'strategicName',
label: '策略名称', label: '策略名称',
component: 'Input', component: 'Input',
colProps: { lg: 13, md: 13 }, colProps: { lg: 24, md: 24 },
required: true, required: true,
}, },
{ {
...@@ -462,13 +478,13 @@ export const kafkaFormSchema: FormSchema[] = [ ...@@ -462,13 +478,13 @@ export const kafkaFormSchema: FormSchema[] = [
componentProps: { componentProps: {
rows: 4, rows: 4,
}, },
colProps: { lg: 13, md: 13 }, colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'strategicType', field: 'strategicType',
label: '策略类型', label: '策略类型',
slot: 'strategicType', slot: 'strategicType',
colProps: { lg: 13, md: 13 }, colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'deleteTable', field: 'deleteTable',
...@@ -671,7 +687,7 @@ export const backlogFormSchema: FormSchema[] = [ ...@@ -671,7 +687,7 @@ export const backlogFormSchema: FormSchema[] = [
field: 'strategicName', field: 'strategicName',
label: '策略名称', label: '策略名称',
component: 'Input', component: 'Input',
colProps: { lg: 13, md: 13 }, colProps: { lg: 24, md: 24 },
required: true, required: true,
}, },
{ {
...@@ -681,7 +697,7 @@ export const backlogFormSchema: FormSchema[] = [ ...@@ -681,7 +697,7 @@ export const backlogFormSchema: FormSchema[] = [
componentProps: { componentProps: {
rows: 4, rows: 4,
}, },
colProps: { lg: 13, md: 13 }, colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'strategicType', field: 'strategicType',
...@@ -694,16 +710,15 @@ export const backlogFormSchema: FormSchema[] = [ ...@@ -694,16 +710,15 @@ export const backlogFormSchema: FormSchema[] = [
export const clearFormSchema: FormSchema[] = [ export const clearFormSchema: FormSchema[] = [
{ {
field: 'retainTime', field: 'retainTime',
label: '执行记录保留时间*', label: '执行记录保留时间',
slot: 'retainTime', slot: 'retainTime',
colProps: { lg: 13, md: 13 }, colProps: { lg: 24, md: 24 },
required: true, required: true,
}, },
{ {
field: 'clearTime', field: 'clearTime',
label: '清理时间配置', label: '清理时间配置',
component: 'TimePicker', slot: 'clearTime',
colProps: { lg: 13, md: 13 },
}, },
{ {
field: 'errorData', field: 'errorData',
...@@ -723,6 +738,14 @@ export const clearFormSchema: FormSchema[] = [ ...@@ -723,6 +738,14 @@ export const clearFormSchema: FormSchema[] = [
}, },
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
}, },
{
field: 'retainDate',
show: false,
},
{
field: 'retainDay',
show: false,
},
]; ];
export const addFormSchema: FormSchema[] = [ export const addFormSchema: FormSchema[] = [
...@@ -730,7 +753,7 @@ export const addFormSchema: FormSchema[] = [ ...@@ -730,7 +753,7 @@ export const addFormSchema: FormSchema[] = [
field: 'strategicName', field: 'strategicName',
label: '策略名称', label: '策略名称',
component: 'Input', component: 'Input',
colProps: { lg: 13, md: 13 }, colProps: { lg: 24, md: 24 },
required: true, required: true,
}, },
{ {
...@@ -740,7 +763,7 @@ export const addFormSchema: FormSchema[] = [ ...@@ -740,7 +763,7 @@ export const addFormSchema: FormSchema[] = [
componentProps: { componentProps: {
rows: 4, rows: 4,
}, },
colProps: { lg: 13, md: 13 }, colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'strategicType', field: 'strategicType',
...@@ -757,6 +780,6 @@ export const addFormSchema: FormSchema[] = [ ...@@ -757,6 +780,6 @@ export const addFormSchema: FormSchema[] = [
{ label: '—致性检查策略', value: '一致性检查策略' }, { label: '—致性检查策略', value: '一致性检查策略' },
], ],
}, },
colProps: { lg: 13, md: 13 }, colProps: { lg: 24, md: 24 },
}, },
]; ];
...@@ -37,29 +37,29 @@ export const systemData: any[] = [ ...@@ -37,29 +37,29 @@ export const systemData: any[] = [
{ {
eventDetail: '源端解析异常', eventDetail: '源端解析异常',
eventHandle: '任务暂停', eventHandle: '任务暂停',
isStop: false, isStop: 3,
}, },
{ {
eventDetail: 'Kafka异常', eventDetail: 'Kafka异常',
eventHandle: '', eventHandle: '120',
isStop: true, isStop: 1,
}, },
{ {
eventDetail: '内部异常', eventDetail: '内部异常',
eventHandle: '任务暂停', eventHandle: '任务暂停',
isStop: false, isStop: 3,
}, },
{ {
eventDetail: '数据源连接异常', eventDetail: '数据源连接异常',
eventHandle: '', eventHandle: '3',
isStop: true, isStop: 2,
}, },
]; ];
export const errorData: any[] = [ export const errorData: any[] = [
{ {
eventDetail: '数据异常', eventDetail: '数据异常',
eventHandle: '', eventHandle: '1',
}, },
]; ];
......
<template> <template>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #eventHandle="{ text, record }"> <template #eventHandle="{ text, record }">
<div v-if="record.isStop"> <div v-if="record.isStop === 1">
<span>若连接超时,自动重试</span><Input v-model:value="record.eventHandle" /><span <span>若连接超时,自动重试</span><Input style="width: 200px" v-model:value="kafka" /><span
>分钟,其它场景均任务暂停</span >分钟,其它场景均任务暂停</span
> >
</div> </div>
<div v-else>任务暂停</div> <div v-if="record.isStop === 2">
<span>若连接超时,自动重试</span><Input style="width: 200px" v-model:value="dataError" /><span
>分钟,其它场景均任务暂停</span
>
</div>
<div v-if="record.isStop === 3">任务暂停</div>
</template> </template>
</BasicTable> </BasicTable>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import BasicTable from '@/components/Table/src/BasicTable.vue'; import BasicTable from '@/components/Table/src/BasicTable.vue';
import { Input } from 'ant-design-vue';
import { BasicTableProps, useTable } from '@/components/Table'; import { BasicTableProps, useTable } from '@/components/Table';
import { systemData } from './strategicData'; import { systemData } from './strategicData';
import { systemColumns } from './strategic.data'; import { systemColumns } from './strategic.data';
import { ref } from 'vue';
const kafka = ref(120);
const dataError = ref(3);
const [ const [
registerTable, registerTable,
...@@ -31,7 +41,6 @@ ...@@ -31,7 +41,6 @@
clearSelectedRowKeys, clearSelectedRowKeys,
}, },
] = useTable({ ] = useTable({
scroll: { y: 200 },
api: async (params) => { api: async (params) => {
console.log('params:', params); console.log('params:', params);
const response = { const response = {
......
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