import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '主站点名称',
    align: "center",
    dataIndex: 'mainSiteName'
  },
  {
    title: '主站点URL',
    align: "center",
    slots: { customRender: 'aurl' },
    dataIndex: 'mainSiteUrl'
  },
  {
    title: '校验类型（扫描/复核）',
    align: "center",
    dataIndex: 'testType_dictText',
  },
  {
    title: '扫描时间',
    align: "center",
    dataIndex: 'scanTime'
  },
  {
    title: '错链数量',
    align: "center",
    dataIndex: 'errorLinkNumber'
  },
];

//查询数据
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: 'mainSiteId',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "主站点名称",
    field: 'mainSiteName',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "主站点URL",
    field: 'mainSiteUrl',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "校验类型（扫描/复核）",
    field: 'testType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "scan_test_type"
    },
    colProps: {span: 6},
  },
  {
    label: "扫描时间",
    field: 'scanTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
    },
    colProps: {span: 6},
  },
  {
    label: "外链数量",
    field: 'errorLinkNumber',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '主站点id',
    field: 'mainSiteId',
    component: 'Input',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入主站点id!'},
             ];
    },
  },
  {
    label: '主站点名称',
    field: 'mainSiteName',
    component: 'Input',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入主站点名称!'},
             ];
    },
  },
  {
    label: '主站点URL',
    field: 'mainSiteUrl',
    component: 'Input',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入主站点URL!'},
             ];
    },
  },
  {
    label: '校验类型（扫描/复核）',
    field: 'testType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "scan_test_type"
    },
    dynamicRules: () => {
      return [
              { required: true, message: '请输入校验类型（扫描/复核）!'},
             ];
    },
  },
  {
    label: '扫描时间',
    field: 'scanTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicRules: () => {
      return [
              { required: true, message: '请输入扫描时间!'},
             ];
    },
  },
  {
    label: '外链数量',
    field: 'errorLinkNumber',
    component: 'InputNumber',
    dynamicRules: () => {
      return [
              { required: true, message: '请输入外链数量!'},
             ];
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
