create.config.ts 1.29 KB
import {
  AssignToCustomerFieldsEnum,
  AssignToCustomerFieldsNameEnum,
} from '../../../enum/formField/action';
import { FormSchema } from '/@/components/Form';

export const formSchemas: FormSchema[] = [
  {
    field: AssignToCustomerFieldsEnum.CUSTOMER_NAME_PATTERN,
    component: 'Input',
    label: AssignToCustomerFieldsNameEnum.CUSTOMER_NAME_PATTERN,
    helpMessage:
      'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
    componentProps: {
      placeholder: `请输入${AssignToCustomerFieldsNameEnum.CUSTOMER_NAME_PATTERN}`,
    },
  },
  {
    field: AssignToCustomerFieldsEnum.CREATE_CUSTOMER_IF_NOT_EXISTS,
    component: 'Checkbox',
    label: '',
    renderComponentContent: () => ({
      default: () => AssignToCustomerFieldsNameEnum.CREATE_CUSTOMER_IF_NOT_EXISTS,
    }),
  },
  {
    field: AssignToCustomerFieldsEnum.CUSTOMER_CACHE_EXPIRATION,
    component: 'InputNumber',
    label: AssignToCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION,
    required: true,
    helpMessage:
      'Specifies maximum time interval allowed to store found customer records. 0 value means that records will never expire.',
    componentProps: {
      placeholder: `请输入${AssignToCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION}`,
      min: 0,
    },
  },
];