import { BasicColumn } from '@/components/Table';
import { FormSchema } from '@/components/Form';

export const formSchemas: FormSchema[] = [
  {
    label: '厂家名称',
    field: 'name',
    component: 'Input',
  },

  {
    label: '联系方式',
    field: 'contactsPhone',
    component: 'Input',
  },
  {
    label: '厂家状态',
    field: 'state',
    component: 'Select',
    componentProps: {
      options: [
        { label: '正常', value: 1 },
        { label: '问题', value: 2 },
      ],
    },
  },
];

export const columns: BasicColumn[] = [
  {
    title: '主键id',
    dataIndex: 'id',
    ifShow: false,
  },
  {
    title: '厂家名称',
    dataIndex: 'name',
  },
  {
    title: '厂家地址',
    dataIndex: 'address',
  },
  {
    title: '联系人',
    dataIndex: 'contacts',
  },
  {
    title: '联系方式',
    dataIndex: 'contactsPhone',
  },
  {
    title: '厂家状态',
    dataIndex: 'state',
    key: 'state',
  },
];

export const modalSchemas: FormSchema[] = [
  {
    label: '主键id',
    field: 'id',
    required: false,
    component: 'Input',
    show: false,
  },
  {
    label: '厂家编码',
    field: 'code',
    required: true,
    component: 'Input',
  },
  {
    label: '厂家名称',
    field: 'name',
    required: true,
    component: 'Input',
  },
  {
    label: '厂家地址',
    field: 'address',
    required: true,
    component: 'Input',
  },
  {
    label: '联系人',
    field: 'contacts',
    required: true,
    component: 'Input',
  },
  {
    label: '联系方式',
    field: 'contactsPhone',
    required: true,
    component: 'Input',
  },
  {
    label: '厂家状态',
    field: 'state',
    required: true,
    component: 'Select',
    componentProps: {
      options: [
        { label: '正常', value: 1 },
        { label: '问题', value: 2 },
      ],
    },
  },
];
