create.config.ts 1.7 KB
import {
  DelayDeprecatedFieldsEnum,
  DelayDeprecatedFieldsNameEnum,
} from '../../../enum/formField/action';
import { FormSchema } from '/@/components/Form';

export const formSchemas: FormSchema[] = [
  {
    field: DelayDeprecatedFieldsEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS,
    label: DelayDeprecatedFieldsNameEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS,
    component: 'Checkbox',
    renderComponentContent: () => ({
      default: () =>
        'If selected, rule node use period in seconds interval pattern from message metadata or data assuming that intervals are in the seconds.',
    }),
  },
  {
    field: DelayDeprecatedFieldsEnum.PERIOD_IN_SECONDS_PATTERN,
    component: 'Input',
    label: DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS_PATTERN,
    required: true,
    ifShow: ({ model }) => model[DelayDeprecatedFieldsEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS],
    componentProps: {
      min: 0,
      placeholder: `请输入${DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS_PATTERN}`,
    },
  },
  {
    field: DelayDeprecatedFieldsEnum.PERIOD_IN_SECONDS,
    component: 'InputNumber',
    label: DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS,
    required: true,
    ifShow: ({ model }) =>
      !model[DelayDeprecatedFieldsEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS],
    componentProps: {
      min: 0,
      placeholder: `请输入${DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS}`,
    },
  },
  {
    field: DelayDeprecatedFieldsEnum.MAX_PENDING_MSGS,
    component: 'InputNumber',
    label: DelayDeprecatedFieldsNameEnum.MAX_PENDING_MSGS,
    required: true,
    componentProps: {
      min: 0,
      placeholder: `请输入${DelayDeprecatedFieldsNameEnum.MAX_PENDING_MSGS}`,
    },
  },
];