import { BasicColumn, FormSchema } from '/@/components/Table';
import { listDictModel } from '@/api/common';

export const wardInfoColumns: BasicColumn[] = [
  {
    title: '病区名',
    dataIndex: 'name',
  },
  {
    title: '传染病',
    dataIndex: 'infectiousDiseases',
    width: 560,
  },
  {
    title: '状态',
    dataIndex: 'disable',
    width: 150,
  },
  {
    title: '排序',
    dataIndex: 'sort',
    width: 120,
  },
];

// 表单属性新增编辑
export const wardTypeDataFormSchema: FormSchema[] = [
  {
    label: '病区类型',
    field: 'positive',
    component: 'RadioGroup',
    required: true,
    componentProps: {
      options: [
        { label: '阴性区', value: 0 },
        { label: '阳性区', value: 1 },
      ],
      disabled: false,
    },
    defaultValue: 0,
  },
  {
    label: '属性名称',
    field: 'name',
    required: true,
    component: 'Input',
    componentProps: {
      placeholder: '请输入属性名称',
    },
  },
];

// 表单信息新增编辑
export const wardInfoDataFormSchema: FormSchema[] = [
  {
    label: '传染病',
    field: 'infectiousDiseases',
    component: 'ApiSelect',
    required: true,
    componentProps: {
      api: listDictModel,
      mode: 'multiple',
      params: {
        dictCode: 'pb_epidemic',
      },
      placeholder: '请选择病区属性',
    },
  },
  {
    label: '病区名',
    field: 'name',
    required: true,
    component: 'Input',
    componentProps: {
      placeholder: '请输入病区名',
    },
  },
  {
    label: '排序',
    field: 'sort',
    required: true,
    component: 'InputNumber',
    componentProps: {
      placeholder: '请输入排序',
      min: 0,
    },
  },
  {
    label: '状态',
    field: 'disable',
    component: 'Input',
    defaultValue: '0',
    show: false,
  },
  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
    componentProps: {
      placeholder: '请输入备注',
    },
  },
];

export const workDayDataFormSchema: FormSchema[] = [
  {
    label: '工作日',
    field: 'works',
    required: true,
    component: 'CheckboxGroup',
    componentProps: {
      options: [
        { label: '周一', value: 'monday' },
        { label: '周二', value: 'tuesday' },
        { label: '周三', value: 'wednesday' },
        { label: '周四', value: 'thursday' },
        { label: '周五', value: 'friday' },
        { label: '周六', value: 'saturday' },
        { label: '周日', value: 'sunday' },
      ],
    },
  },
];
// 班次列表信息
export const sailingsColumns: BasicColumn[] = [
  {
    title: '班次名称',
    width: 150,
    dataIndex: 'name',
  },
  {
    title: '开始时间',
    width: 100,
    dataIndex: 'startTime',
  },
  {
    title: '结束时间',
    width: 150,
    dataIndex: 'endTime',
  },
];

// 班次编辑列表信息
export const sailingsEditColumns: BasicColumn[] = [
  {
    title: '班次名称',
    width: 150,
    dataIndex: 'name',
    edit: true,
    editable: true,
    editComponent: 'Input',
    editComponentProps: {
      placeholder: '请输入班次名称',
    },
  },
  {
    title: '开始时间',
    width: 100,
    dataIndex: 'startTime',
    edit: true,
    editable: true,
    editComponent: 'TimePicker',
    editComponentProps: {
      placeholder: '请选择时间',
      format: 'HH:mm',
      valueFormat: 'HH:mm',
      getPopupContainer: () => document.body,
    },
  },
  {
    title: '结束时间',
    width: 150,
    dataIndex: 'endTime',
    edit: true,
    editable: true,
    editComponent: 'TimePicker',
    editComponentProps: {
      placeholder: '请选择时间',
      format: 'HH:mm',
      valueFormat: 'HH:mm',
      getPopupContainer: () => document.body,
    },
  },
];
