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

export const columns: BasicColumn[] = [
  {
    title: t('spare.equip.nameCode'),
    dataIndex: 'code',
  },
  {
    title: t('spare.equip.nameText'),
    dataIndex: 'name',
  },
  {
    title: t('spare.equip.specifications'),
    dataIndex: 'name',
  },
  {
    title: t('spare.equip.typeText'),
    dataIndex: 'type',
    slots: { customRender: 'type' },
  },
  {
    title: t('spare.equip.unitText'),
    dataIndex: 'unit',
    slots: { customRender: 'unit' },
  },
  {
    title: t('spare.equip.factoryText'),
    dataIndex: 'factory',
  },
  {
    title: t('spare.equip.operatorText'),
    dataIndex: 'operator',
  },
  {
    title: t('spare.equip.operaDate'),
    dataIndex: 'operaDate',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'name',
    label: t('spare.equip.nameText'),
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'code',
    label: t('spare.equip.nameCode'),
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'type',
    label: t('spare.equip.typeText'),
    component: 'Select',
    colProps: { span: 6 },
  },
  {
    field: 'specifications',
    label: t('spare.equip.specifications'),
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'factory',
    label: t('spare.equip.factoryText'),
    component: 'Input',
    colProps: { span: 6 },
  }
];