import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [

  {
    title: '错误原因',
    align: "center",
    dataIndex: 'errorMessage',
    slots: { customRender: 'customColumn' }
  },
  {
    title: '错词',
    align: "center",
    dataIndex: 'errerWord'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "页面抓取id",
    field: 'linkPageId',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "错敏词信息id",
    field: 'linkCaptureErrorLogId',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "错误原因",
    field: 'errorMessage',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "错词",
    field: 'errerWord',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '页面抓取id',
    field: 'linkPageId',
    component: 'Input',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入页面抓取id!'},
             ];
    },
  },
  {
    label: '错敏词信息id',
    field: 'linkCaptureErrorLogId',
    component: 'Input',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入错敏词信息id!'},
             ];
    },
  },
  {
    label: '错误原因',
    field: 'errorMessage',
    component: 'Input',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入错误原因!'},
             ];
    },
  },
  {
    label: '错词',
    field: 'errerWord',
    component: 'Input',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入错词!'},
             ];
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
