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: 'sourceDataKey'
  },
  {
    title: '项目编号',
    align: "center",
    dataIndex: 'projectCode'
  },
  {
    title: '项目名称',
    align: "center",
    dataIndex: 'projectName'
  },
  {
    title: '政府采购项目编号',
    align: "center",
    dataIndex: 'tenderProjectCode'
  },
  {
    title: '公告标题',
    align: "center",
    dataIndex: 'noticeName'
  },
  {
    title: '公告发布时间',
    align: "center",
    dataIndex: 'noticeSendTime'
  },
  {
    title: '项目所在行政区域名称',
    align: "center",
    dataIndex: 'regionName'
  },
  {
    title: '交易系统标识码区域名称',
    align: "center",
    dataIndex: 'platformName'
  },
  {
    title: '公告类型名称',
    align: "center",
    dataIndex: 'noticeTypeName'
  },
  {
    title: '栏目名称',
    align: "center",
    dataIndex: 'transactionTypeName'
  },
  {
    title: '是否同步',
    align: "center",
    dataIndex: 'isSynchronous_dictText'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "数据唯一标识",
    field: 'sourceDataKey',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目编号",
    field: 'projectCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目名称",
    field: 'projectName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "政府采购项目编号",
    field: 'tenderProjectCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "公告标题",
    field: 'noticeName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "公告内容",
    field: 'noticeContent',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "公告发布时间",
    field: "noticeSendTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "公告性质编号",
    field: 'noticeNature',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "公告性质名称",
    field: 'noticeNatureName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目所在行政区域代码",
    field: 'regionCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目所在行政区域名称",
    field: 'regionName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目行业分类编码",
    field: 'industriesTypeCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目行业分类名称",
    field: 'industriesTypeName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "交易系统标识码",
    field: 'platformCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "交易系统标识码区域名称",
    field: 'platformName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "公告上面类型编码",
    field: 'noticeTypeCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "公告上面类型名称",
    field: 'noticeTypeName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "交易左侧类型编码",
    field: 'transactionTypeCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "交易左侧类型名称",
    field: 'transactionTypeName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "公告类型编码",
    field: 'bulletinTypeCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "公告类型名称",
    field: 'bulletinTypeName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "公告发布责任人",
    field: 'bulletinDuty',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "交易中心编码",
    field: 'dataSourceCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "交易中心名称",
    field: 'dataSourceName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "公告标段包数量",
    field: 'noticeBidNum',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "相关标段包编号",
    field: 'bidSectionCodes',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "招标文件资格预审文件获取时间",
    field: "docGetStartTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "招标文件资格预审文件获取截至时间",
    field: "docGetEndTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "投标文件资格预审申请文件递交截止时间",
    field: "bidDocReferEndTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "开标时间",
    field: "bidOpenTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "投标有效期单位天",
    field: 'validPeriod',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "答疑澄清时间",
    field: "clarifyTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "招标文件生成时间",
    field: "submitTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "开标地点",
    field: 'bidOpeningAddress',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "开标时间",
    field: "bidOpeningTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "开标结束时间",
    field: "bidFinishTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "开标结束时间",
    field: "docstatus",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "开标结束时间",
    field: "docpubtime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '数据唯一标识',
    field: 'sourceDataKey',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入数据唯一标识!'},
      ];
    },
  },
  {
    label: '项目编号',
    field: 'projectCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入项目编号!'},
      ];
    },
  },
  {
    label: '项目名称',
    field: 'projectName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入项目名称!'},
      ];
    },
  },
  {
    label: '政府采购项目编号',
    field: 'tenderProjectCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入政府采购项目编号!'},
      ];
    },
  },
  {
    label: '公告标题',
    field: 'noticeName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入公告标题!'},
      ];
    },
  },
  {
    label: '公告内容',
    field: 'noticeContent',
    component: 'JEditor',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入公告内容!'},
      ];
    },
  },
  {
    label: '公告发布时间',
    field: 'noticeSendTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入公告发布时间!'},
      ];
    },
  },
  {
    label: '公告性质编号',
    field: 'noticeNature',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入公告性质编号!'},
      ];
    },
  },
  {
    label: '公告性质名称',
    field: 'noticeNatureName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入公告性质名称!'},
      ];
    },
  },
  {
    label: '项目所在行政区域代码',
    field: 'regionCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入项目所在行政区域代码!'},
      ];
    },
  },
  {
    label: '项目所在行政区域名称',
    field: 'regionName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入项目所在行政区域名称!'},
      ];
    },
  },
  {
    label: '项目行业分类编码',
    field: 'industriesTypeCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入项目行业分类编码!'},
      ];
    },
  },
  {
    label: '项目行业分类名称',
    field: 'industriesTypeName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入项目行业分类名称!'},
      ];
    },
  },
  {
    label: '交易系统标识码',
    field: 'platformCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入交易系统标识码!'},
      ];
    },
  },
  {
    label: '交易系统标识码区域名称',
    field: 'platformName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入交易系统标识码区域名称!'},
      ];
    },
  },
  {
    label: '公告上面类型编码',
    field: 'noticeTypeCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入公告上面类型编码!'},
      ];
    },
  },
  {
    label: '公告上面类型名称',
    field: 'noticeTypeName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入公告上面类型名称!'},
      ];
    },
  },
  {
    label: '交易左侧类型编码',
    field: 'transactionTypeCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入交易左侧类型编码!'},
      ];
    },
  },
  {
    label: '交易左侧类型名称',
    field: 'transactionTypeName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入交易左侧类型名称!'},
      ];
    },
  },
  {
    label: '公告类型编码',
    field: 'bulletinTypeCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入公告类型编码!'},
      ];
    },
  },
  {
    label: '公告类型名称',
    field: 'bulletinTypeName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入公告类型名称!'},
      ];
    },
  },
  {
    label: '公告发布责任人',
    field: 'bulletinDuty',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入公告发布责任人!'},
      ];
    },
  },
  {
    label: '交易中心编码',
    field: 'dataSourceCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入交易中心编码!'},
      ];
    },
  },
  {
    label: '交易中心名称',
    field: 'dataSourceName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入交易中心名称!'},
      ];
    },
  },
  {
    label: '公告标段包数量',
    field: 'noticeBidNum',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入公告标段包数量!'},
      ];
    },
  },
  {
    label: '相关标段包编号',
    field: 'bidSectionCodes',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入相关标段包编号!'},
      ];
    },
  },
  {
    label: '招标文件资格预审文件获取时间',
    field: 'docGetStartTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入招标文件资格预审文件获取时间!'},
      ];
    },
  },
  {
    label: '招标文件资格预审文件获取截至时间',
    field: 'docGetEndTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入招标文件资格预审文件获取截至时间!'},
      ];
    },
  },
  {
    label: '投标文件资格预审申请文件递交截止时间',
    field: 'bidDocReferEndTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入投标文件资格预审申请文件递交截止时间!'},
      ];
    },
  },
  {
    label: '开标时间',
    field: 'bidOpenTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入开标时间!'},
      ];
    },
  },
  {
    label: '投标有效期单位天',
    field: 'validPeriod',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入投标有效期单位天!'},
      ];
    },
  },
  {
    label: '答疑澄清时间',
    field: 'clarifyTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入答疑澄清时间!'},
      ];
    },
  },
  {
    label: '招标文件生成时间',
    field: 'submitTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入招标文件生成时间!'},
      ];
    },
  },
  {
    label: '开标地点',
    field: 'bidOpeningAddress',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入开标地点!'},
      ];
    },
  },
  {
    label: '开标时间',
    field: 'bidOpeningTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入开标时间!'},
      ];
    },
  },
  {
    label: '开标结束时间',
    field: 'bidFinishTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入开标结束时间!'},
      ];
    },
  },
  {
    label: '附件',
    field: 'file',
    component: 'JUpload',
    componentProps:{
    },
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入附件!'},
      ];
    },
  },
  {
    label: '开标结束时间',
    field: 'docstatus',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入开标结束时间!'},
      ];
    },
  },
  {
    label: '开标结束时间',
    field: 'docpubtime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入开标结束时间!'},
      ];
    },
  },
  {
    label: '是否同步',
    field: 'isSynchronous',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "is_synchronous"
    },
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '请输入是否同步!'},
      ];
    },
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  sourceDataKey: {title: '数据唯一标识',order: 0,view: 'text', type: 'string',},
  projectCode: {title: '项目编号',order: 1,view: 'text', type: 'string',},
  projectName: {title: '项目名称',order: 2,view: 'text', type: 'string',},
  tenderProjectCode: {title: '政府采购项目编号',order: 3,view: 'text', type: 'string',},
  noticeName: {title: '公告标题',order: 4,view: 'text', type: 'string',},
  noticeContent: {title: '公告内容',order: 5,view: 'umeditor', type: 'string',},
  noticeSendTime: {title: '公告发布时间',order: 6,view: 'datetime', type: 'string',},
  noticeNature: {title: '公告性质编号',order: 7,view: 'text', type: 'string',},
  noticeNatureName: {title: '公告性质名称',order: 8,view: 'text', type: 'string',},
  regionCode: {title: '项目所在行政区域代码',order: 9,view: 'text', type: 'string',},
  regionName: {title: '项目所在行政区域名称',order: 10,view: 'text', type: 'string',},
  industriesTypeCode: {title: '项目行业分类编码',order: 11,view: 'text', type: 'string',},
  industriesTypeName: {title: '项目行业分类名称',order: 12,view: 'text', type: 'string',},
  platformCode: {title: '交易系统标识码',order: 13,view: 'text', type: 'string',},
  platformName: {title: '交易系统标识码区域名称',order: 14,view: 'text', type: 'string',},
  noticeTypeCode: {title: '公告上面类型编码',order: 15,view: 'text', type: 'string',},
  noticeTypeName: {title: '公告上面类型名称',order: 16,view: 'text', type: 'string',},
  transactionTypeCode: {title: '交易左侧类型编码',order: 17,view: 'text', type: 'string',},
  transactionTypeName: {title: '交易左侧类型名称',order: 18,view: 'text', type: 'string',},
  bulletinTypeCode: {title: '公告类型编码',order: 19,view: 'text', type: 'string',},
  bulletinTypeName: {title: '公告类型名称',order: 20,view: 'text', type: 'string',},
  bulletinDuty: {title: '公告发布责任人',order: 21,view: 'text', type: 'string',},
  dataSourceCode: {title: '交易中心编码',order: 22,view: 'text', type: 'string',},
  dataSourceName: {title: '交易中心名称',order: 23,view: 'text', type: 'string',},
  noticeBidNum: {title: '公告标段包数量',order: 24,view: 'text', type: 'string',},
  bidSectionCodes: {title: '相关标段包编号',order: 25,view: 'text', type: 'string',},
  docGetStartTime: {title: '招标文件资格预审文件获取时间',order: 26,view: 'datetime', type: 'string',},
  docGetEndTime: {title: '招标文件资格预审文件获取截至时间',order: 27,view: 'datetime', type: 'string',},
  bidDocReferEndTime: {title: '投标文件资格预审申请文件递交截止时间',order: 28,view: 'datetime', type: 'string',},
  bidOpenTime: {title: '开标时间',order: 29,view: 'datetime', type: 'string',},
  validPeriod: {title: '投标有效期单位天',order: 30,view: 'number', type: 'number',},
  clarifyTime: {title: '答疑澄清时间',order: 31,view: 'datetime', type: 'string',},
  submitTime: {title: '招标文件生成时间',order: 32,view: 'datetime', type: 'string',},
  bidOpeningAddress: {title: '开标地点',order: 33,view: 'text', type: 'string',},
  bidOpeningTime: {title: '开标时间',order: 34,view: 'datetime', type: 'string',},
  bidFinishTime: {title: '开标结束时间',order: 35,view: 'datetime', type: 'string',},
  file: {title: '附件',order: 36,view: 'file', type: 'string',},
  docstatus: {title: '开标结束时间',order: 37,view: 'datetime', type: 'string',},
  docpubtime: {title: '开标结束时间',order: 38,view: 'datetime', type: 'string',},
  isSynchronous: {title: '是否同步',order: 39,view: 'radio', type: 'string',},
};
