import dayjs from 'dayjs';
import { DescItem } from '/@/components/Description';
import { BasicColumn, FormSchema } from '/@/components/Table';

export const BasicTab = [
  {
    key: '0',
    label: '全部',
    value: 128,
    hasValue: true,
    hasBracket: true,
  },
  {
    key: '1',
    label: '透中患者',
    value: 12,
    hasValue: true,
    prefixColor: '#1BC1B3',
    hasBracket: true,
  },
  {
    key: '2',
    label: '非透中患者',
    value: 18,
    hasValue: true,
    prefixColor: '#D3D8DD',
    hasBracket: true,
  },
  {
    key: '3',
    label: '新患者',
    value: 18,
    hasValue: true,
    prefixColor: '#F7B500',
    hasBracket: true,
  },
  {
    key: '4',
    label: '关注',
    value: 18,
    hasValue: true,
    prefixColor: '#33CCFF',
    hasBracket: true,
  },
];
export const BasicTabActive = BasicTab[0].key;

export const checkColumns: BasicColumn[] = [
  {
    title: '姓名',
    dataIndex: 'name',
  },
  {
    title: '信息',
    dataIndex: 'gender',
  },
  {
    title: '查房时间',
    dataIndex: 'patrolTime',
  },
  {
    title: '最新查房内容',
    dataIndex: 'content',
  },
  {
    title: '记录人',
    dataIndex: 'recorder',
  },
];
export const columns: BasicColumn[] = [
  {
    title: '查房时间',
    dataIndex: 'patrolTime',
  },
  {
    title: '查房内容',
    dataIndex: 'content',
  },
];

// 表单新增编辑
export const dataFormSchema: FormSchema[] = [
  {
    label: '查房时间',
    field: 'patrolTime',
    required: true,
    component: 'DatePicker',
    componentProps: ({ formModel }) => {
      return {
        placeholder: '请输入查房时间',
        getPopupContainer: () => document.body,
        valueFormat: 'YYYY-MM-DD HH:mm:ss',
        showTime: true,
        disabledDate: current => {
          return current < dayjs(formModel.accessSetUpTime).subtract(1, 'day').endOf('day');
        },
      };
    },
  },

  {
    label: '记录',
    field: 'content',
    required: true,
    component: 'InputTextArea',
    componentProps: {
      placeholder: '请输入查房内容',
    },
  },
];

// 表单详情查看
export const viewSchema: DescItem[] = [
  {
    label: '查房时间',
    field: 'patrolTime',
  },
  {
    label: '查房内容',
    field: 'content',
  },
];
// 历史记录查看
export const data: DescItem[] = [
  {
    label: '查房时间',
    field: 'patrolTime',
  },
  {
    label: '查房内容',
    field: 'content',
  },
];
