import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '资源链接',
    align: "center",
    slots: { customRender: 'aurl' },
    dataIndex: 'source'
  },
  {
    title: '资源文章标题',
    align: "center",
    dataIndex: 'title',
    width:"300px"
  },
  {
    title: '错敏词列表',
    align: "center",
    dataIndex: 'sensitiveList',
    slots: { customRender: 'customColumnErr' },
    width:"200px"
  },
  {
    title: '错敏词列表详细详细',
    align: "center",
    dataIndex: 'sensitiveErrorList',
    slots: { customRender: 'customColumn' },
    width:"200px"
  },
  {
    title: '错敏信息',
    align: "center",
    dataIndex: 'errorMessage',
    slots: { customRender: 'customColumn' },
    width:"200px"
  },
  {
    title: '校对敏感词个数',
    align: "center",
    dataIndex: 'sensitiveCount'
  },
  {
    title: '成功标记',
    align: "center",
    dataIndex: 'retCode'
  },
  {
    title: '校对错误个数',
    align: "center",
    dataIndex: 'errorCount'
  },
  {
    title: '校对重点关注词个数',
    align: "center",
    dataIndex: 'heavyCount'
  },
  {
    title: '修改状态',
    align: "center",
    dataIndex: 'modifyState_dictText'
  },
  {
    title: '文章发布时间',
    align: "center",
    dataIndex: 'articleReleaseTime'
  },
  {
    title: '扫描次数',
    align: "center",
    dataIndex: 'numberScans'
  },
  {
    title: '是否是失效文章',
    align: "center",
    dataIndex: 'isInvalid_dictText'
  },
  {
    title: '是否忽略',
    align: "center",
    dataIndex: 'isIgnore_dictText'
  },
  {
    title: '复核时间',
    align: "center",
    dataIndex: 'checkTime'
  },
  {
    title: '复核状态',
    align: "center",
    dataIndex: 'checkState_dictText'
  },
  {
    title: '复核校对错误个数',
    align: "center",
    dataIndex: 'checkErrorCount'
  },
];

//查询数据
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: "资源链接",
    field: 'source',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "内容",
    field: 'content',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "父地址类型",
    field: 'typeSource',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "父地址状态",
    field: 'stateSource',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "主站点链接",
    field: 'mainUrl',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "错敏词列表",
    field: 'sensitiveList',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "校对敏感词个数",
    field: 'sensitiveCount',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "错误原因；返回校对结果",
    field: 'retMsg',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "成功标记",
    field: 'retCode',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "校对错误个数",
    field: 'errorCount',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "校对重点关注词个数",
    field: 'heavyCount',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "修改状态",
    field: 'modifyState',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "modify_state"
    },
    colProps: {span: 6},
  },
  {
    label: "文章发布时间",
    field: "articleReleaseTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    colProps: {span: 6},
  },
  {
    label: "扫描次数",
    field: 'numberScans',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "是否是失效文章",
    field: 'isInvalid',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "verify_status"
    },
    colProps: {span: 6},
  },
  {
    label: "是否忽略",
    field: 'isIgnore',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "verify_status"
    },
    colProps: {span: 6},
  },
  {
    label: "复核时间",
    field: 'checkTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
    },
    colProps: {span: 6},
  },
  {
    label: "复核状态",
    field: 'checkState',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "verify_status"
    },
    colProps: {span: 6},
  },
  {
    label: "复核校对错误个数",
    field: 'checkErrorCount',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '资源链接',
    field: 'source',
    component: 'Input',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入资源链接!'},
             ];
    },
  },
  {
    label: '资源文章标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '内容',
    field: 'content',
    component: 'JEditor',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入内容!'},
             ];
    },
  },
  {
    label: '父地址类型',
    field: 'typeSource',
    component: 'Input',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入父地址类型!'},
             ];
    },
  },
  {
    label: '父地址状态',
    field: 'stateSource',
    component: 'Input',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入父地址状态!'},
             ];
    },
  },
  {
    label: '主站点链接',
    field: 'mainUrl',
    component: 'Input',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入主站点链接!'},
             ];
    },
  },
  {
    label: '错敏词列表',
    field: 'sensitiveList',
    component: 'InputTextArea',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入错敏词列表!'},
             ];
    },
  },
  {
    label: '校对敏感词个数',
    field: 'sensitiveCount',
    component: 'InputNumber',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入校对敏感词个数!'},
             ];
    },
  },
  {
    label: '错误原因；返回校对结果',
    field: 'retMsg',
    component: 'JEditor',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入错误原因；返回校对结果!'},
             ];
    },
  },
  {
    label: '成功标记',
    field: 'retCode',
    component: 'InputNumber',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入成功标记!'},
             ];
    },
  },
  {
    label: '校对错误个数',
    field: 'errorCount',
    component: 'InputNumber',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入校对错误个数!'},
             ];
    },
  },
  {
    label: '校对重点关注词个数',
    field: 'heavyCount',
    component: 'InputNumber',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入校对重点关注词个数!'},
             ];
    },
  },
  {
    label: '修改状态',
    field: 'modifyState',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "modify_state"
    },
    dynamicRules: () => {
      return [
              { required: true, message: '请输入修改状态!'},
             ];
    },
  },
  {
    label: '文章发布时间',
    field: 'articleReleaseTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicRules: () => {
      return [
              { required: true, message: '请输入文章发布时间!'},
             ];
    },
  },
  {
    label: '扫描次数',
    field: 'numberScans',
    component: 'InputNumber',
  },
  {
    label: '是否是失效文章',
    field: 'isInvalid',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "verify_status"
    },
    dynamicRules: () => {
      return [
              { required: true, message: '请输入是否是失效文章!'},
             ];
    },
  },
  {
    label: '是否忽略',
    field: 'isIgnore',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "verify_status"
    },
  },
  {
    label: '复核时间',
    field: 'checkTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '复核状态',
    field: 'checkState',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "verify_status"
    },
    dynamicRules: () => {
      return [
              { required: true, message: '请输入复核状态!'},
             ];
    },
  },
  {
    label: '复核校对错误个数',
    field: 'checkErrorCount',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
