import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '患者id',
    align: "center",
    dataIndex: 'patientId'
  },
  {
    title: '患者姓名',
    align: "center",
    dataIndex: 'patientName'
  },
  {
    title: '患者手机号',
    align: "center",
    dataIndex: 'patientPhone'
  },
  {
    title: '金额',
    align: "center",
    dataIndex: 'money'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "创建日期",
    field: "createTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    colProps: {span: 6},
  },
  {
    label: "更新日期",
    field: "updateTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    colProps: {span: 6},
  },
  {
    label: "患者id",
    field: 'patientId',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "患者手机号",
    field: 'patientPhone',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "金额",
    field: 'money',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '患者id',
    field: 'patientId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入患者id!'},
             ];
    },
  },
  {
    label: '患者手机号',
    field: 'patientPhone',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入患者手机号!'},
             ];
    },
  },
  {
    label: '金额',
    field: 'money',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入金额!'},
             ];
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
