diff --git a/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts b/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts index 4e229a73f07..1fbf1ecfdac 100644 --- a/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts +++ b/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts @@ -33,7 +33,7 @@ const { I18nMap, I18n } = DataWithBackend; const { FieldList, FieldDecorator } = RenderRow; const { ColumnList, ColumnDecorator } = RenderList; -const format = 'HH:mm'; +export const format = 'HH:mm'; const conventionalTimeFormat = 'YYYY-MM-DD HH:mm'; export class SyncDefaultInfo implements DataWithBackend, RenderRow, RenderList { diff --git a/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/index.tsx b/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/index.tsx index 28784c78263..e6325dcf5dd 100644 --- a/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/index.tsx +++ b/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/index.tsx @@ -28,6 +28,7 @@ import { useFormContent } from './config'; import { CommonInterface } from '../common'; import { State } from '@/core/stores'; import dayjs from 'dayjs'; +import { format } from '@/plugins/sync/common/SyncDefaultInfo'; type Props = CommonInterface; @@ -52,7 +53,11 @@ const Comp = ({ inlongGroupId, inlongStreamId, readonly, isCreate }: Props, ref) form.setFieldValue('scheduleType', 0); form.setFieldValue('scheduleUnit', 'H'); } - }, [form, isCreate]); + if (isUpdate) { + form.setFieldValue('scheduleType', 0); + form.setFieldValue('scheduleUnit', 'H'); + } + }, [form, isCreate, isUpdate]); const isUpdateStream = useMemo(() => { return !!inlongStreamId; @@ -61,15 +66,27 @@ const Comp = ({ inlongGroupId, inlongStreamId, readonly, isCreate }: Props, ref) const { data, run: getData } = useRequest(`/group/get/${inlongGroupId}`, { ready: isUpdate, refreshDeps: [inlongGroupId], - formatResult: data => ({ - ...data, - inCharges: data.inCharges.split(','), - time: [ - dayjs(dayjs(data?.startTime), conventionalTimeFormat), - dayjs(dayjs(data?.endTime), conventionalTimeFormat), - ], - delayTime: convertMinutesToDelayTime(data.delayTime), - }), + formatResult: data => { + if (data.inlongGroupMode === 1) { + return { + ...data, + scheduleType: 0, + scheduleUnit: 'H', + scheduleInterval: 0, + delayTime: dayjs('00:00', format), + selfDepend: 0, + }; + } + return { + ...data, + inCharges: data.inCharges.split(','), + time: [ + dayjs(dayjs(data?.startTime), conventionalTimeFormat), + dayjs(dayjs(data?.endTime), conventionalTimeFormat), + ], + delayTime: convertMinutesToDelayTime(data.delayTime), + }; + }, onSuccess: data => { setMqType(data.mqType); form.setFieldsValue(data); @@ -214,6 +231,7 @@ const Comp = ({ inlongGroupId, inlongStreamId, readonly, isCreate }: Props, ref) onValuesChange={(c, values) => setMqType(values.mqType)} useMaxWidth={1400} col={14} + labelWrap /> {!isCreate && !readonly && (