index.ts 1.8 KB
import { FormSchema } from '/@/components/Form';
import { useI18n } from '/@/hooks/web/useI18n';
import { BasicColumn } from '/@/components/Table';
const { t } = useI18n();

export const searchFormSchema: FormSchema[] = [
  {
    field: 'preserveName',
    label: t('inspection.servicePlan.preserveNameText'),
    component: 'Input',
    colProps: { span: 8 },
  },
];

export const columns: BasicColumn[] = [
  {
    title: t('inspection.servicePlan.preserveCodeText'),
    dataIndex: 'preserveCode',
  },
  {
    title: t('inspection.servicePlan.preserveNameText'),
    dataIndex: 'preserveName',
  },
  {
    title: t('inspection.servicePlan.statusText'),
    dataIndex: 'status',
    slots: { customRender: 'status' },
  },
  {
    title: t('inspection.servicePlan.frequencyText'),
    dataIndex: 'frequency',
  },
  {
    title: t('inspection.servicePlan.timesText'),
    dataIndex: 'times',
  },
];


export const schemas: FormSchema[] = [
  {
    field: 'code',
    label: t('equipment.checkPlan.nameCode'),
    component: 'Input',
    colProps: { span: 21 },
    required: true,
    componentProps: {
      maxLength: 20,
    },
  },
  {
    field: 'name',
    label: t('equipment.checkPlan.nameText'),
    component: 'Input',
    colProps: { span: 21 },
    required: true,
    componentProps: {
      maxLength: 20,
    },
  },
  {
    field: 'type',
    label: t('equipment.checkPlan.typeText'),
    component: 'RadioButtonGroup',
    defaultValue: 'INSPECTION',

  },
  {
    field: 'status',
    label: t('equipment.checkPlan.statusText'),
    component: 'RadioButtonGroup',
    defaultValue: 'ENABLE',

  },
  {
    field: 'planDetails',
    label: t('equipment.checkPlan.nameDetail'),
    component: 'InputTextArea',
    colProps: { span: 21 },
    required: true,
    componentProps: {
      maxLength: 200,
    },
  },
];