import { BasicColumn, FormSchema } from '/@/components/Table';
import { list } from '../jdgldw/api'

export const columns: BasicColumn[] = [
  {
    title: '姓名',
    dataIndex: 'yhxm',
  },
  {
    title: '手机号',
    dataIndex: 'phone',
  },
  {
    title: '职务',
    dataIndex: 'zw',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    label: '姓名',
    field: 'yhxm',
    component: 'Input',
  },
  {
    label: '手机号',
    field: 'phone',
    component: 'Input',
  },
];

export const formSchema: formSchema[] = [
  {
    label: '主键',
    field: 'id',
    component: 'Input',
    ifShow: false,
  },
  {
    label: '姓名',
    field: 'yhxm',
    component: 'Input',
    required: true,
  },
  {
    label: '监督管理机构',
    field: 'jdgldwId',
    required: true,
    component: 'ApiSelect',
    componentProps: {
      api: list,
      labelField: 'dwmc',
      valueField: 'id',
      resultField:'records'
    },
  },
  {
    label: '手机号',
    required: true,
    field: 'phone',
    component: 'Input',
    rules: [{ required: false, message: '请输入正确的手机号', pattern: /^1[3456789]\d{9}$/ }],
  },
  {
    label: '职务',
    required: true,
    field: 'zw',
    component: 'Input',
  },
]
