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: '应急事件',
    align: "center",
    dataIndex: 'eventId'
  },
  {
    title: '处置步骤ID',
    align: "center",
    dataIndex: 'methodId'
  },
  {
    title: '执行情况说明',
    align: "center",
    dataIndex: 'handleDes'
  },
  {
    title: '处置时间',
    align: "center",
    dataIndex: 'handleTime',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
  },
  {
    title: '处置人',
    align: "center",
    dataIndex: 'handleBy'
  },
  {
    title: '执行情况1正常2异常',
    align: "center",
    dataIndex: 'handleSta'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "应急事件",
    field: 'eventId',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '应急事件',
    field: 'eventId',
    component: 'InputNumber',
  },
  {
    label: '处置步骤ID',
    field: 'methodId',
    component: 'InputNumber',
  },
  {
    label: '执行情况说明',
    field: 'handleDes',
    component: 'Input',
  },
  {
    label: '处置时间',
    field: 'handleTime',
    component: 'DatePicker',
  },
  {
    label: '处置人',
    field: 'handleBy',
    component: 'Input',
  },
  {
    label: '执行情况1正常2异常',
    field: 'handleSta',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
