import { BasicColumn, FormSchema } from '/@/components/Table';
import { radioBoolean } from '/@/utils/filters';

export const columns: BasicColumn[] = [
  {
    title: '参数名称',
    dataIndex: 'configName',
    width: 150,
    align: 'left',
    resizable: true,
  },
  {
    title: '参数键名',
    dataIndex: 'configKey',
    width: 150,
    align: 'left',
    resizable: true,
  },
  {
    title: '参数键值',
    dataIndex: 'configValue',
    width: 200,
    align: 'left',
    resizable: true,
  },
  {
    title: '系统内置',
    dataIndex: 'sysInner',
  },
  // {
  //   title: '状态',
  //   dataIndex: 'disable',
  //   slots: { customRender: 'disable' },
  // },
  {
    title: '备注',
    dataIndex: 'remark',
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 160,
  },
  {
    title: '更新时间',
    dataIndex: 'updateTime',
    width: 160,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'configName',
    label: '参数名称',
    component: 'Input',
    componentProps: {
      placeholder: '请输入参数名称',
    },
  },
  {
    field: 'configKey',
    label: '参数键名',
    component: 'Input',
    componentProps: {
      placeholder: '请输入参数键名',
    },
  },
];

export const dataFormSchema: FormSchema[] = [
  {
    field: 'configName',
    label: '参数名称',
    component: 'Input',
    required: true,
    componentProps: {
      placeholder: '请输入参数名称',
      // extra: '123123',
    },
  },
  {
    field: 'configKey',
    label: '参数键名',
    component: 'Input',
    required: true,
    componentProps: {
      placeholder: '请输入参数键名',
    },
  },
  {
    field: 'configValue',
    label: '参数键值',
    component: 'Input',
    required: true,
    componentProps: {
      placeholder: '请输入参数键值',
    },
  },
  {
    field: 'sort',
    label: '排序',
    component: 'InputNumber',
    required: true,
    defaultValue: '1',
    componentProps: {
      placeholder: '请输入排序',
      min: 1,
    },
  },
  {
    field: 'sysInner',
    label: '系统内置',
    component: 'RadioGroup',
    componentProps: {
      options: radioBoolean,
      disabled: true,
    },
    defaultValue: '1',
  },
  // {
  //   field: 'disable',
  //   label: '状态',
  //   component: 'RadioGroup',
  //   required: true,
  //   componentProps: {
  //     options: radioSwitch,
  //   },
  //   defaultValue: '0',
  // },
  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
    componentProps: {
      placeholder: '请输入备注',
    },
  },
];

export const searchBasicFormSchema = [
  {
    field: 'name',
    label: '名字',
    component: 'Input',
    componentProps: {
      placeholder: '请输入名称',
    },
  },
  {
    field: 'doctor',
    label: '医生',
    component: 'Select',
    componentProps: {
      placeholder: '请选择医生',
      options: [
        {
          label: '手术医生',
          value: 'surgeon',
        },
        {
          label: '麻醉医生',
          value: 'anesthetists',
        },
        {
          label: '配置、撤泵、评价人员',
          value: 'reviewer',
        },
      ],
    },
  },
];
