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: 'sourceDataCode'
  },
  {
    title: '项目编号',
    align: "center",
    dataIndex: 'projectCode'
  },
  {
    title: '项目名称',
    align: "center",
    dataIndex: 'projectName'
  },
  {
    title: '项目所在行政区域代码',
    align: "center",
    dataIndex: 'regionCode_dictText'
  },
  {
    title: '项目类别关联代码',
    align: "center",
    dataIndex: 'relateCode'
  },
  {
    title: '投资项目统一代码',
    align: "center",
    dataIndex: 'investProjectCode'
  },
  {
    title: '项目地址',
    align: "center",
    dataIndex: 'address'
  },
  {
    title: '项目法人',
    align: "center",
    dataIndex: 'legalPerson'
  },
  {
    title: '项目行业分类',
    align: "center",
    dataIndex: 'industriesType'
  },
  {
    title: '资金来源',
    align: "center",
    dataIndex: 'fundSource'
  },
  {
    title: '出资比例',
    align: "center",
    dataIndex: 'contributionScale'
  },
  {
    title: '项目规模',
    align: "center",
    dataIndex: 'projectScale'
  },
  {
    title: '招标人名称',
    align: "center",
    dataIndex: 'tendererName'
  },
  {
    title: '招标人代码',
    align: "center",
    dataIndex: 'tendererCode'
  },
  {
    title: '联系人',
    align: "center",
    dataIndex: 'contactor'
  },
  {
    title: '联系方式',
    align: "center",
    dataIndex: 'contactInformation'
  },
  {
    title: '项目审批文件名称',
    align: "center",
    dataIndex: 'approvalName'
  },
  {
    title: '项目审批文号',
    align: "center",
    dataIndex: 'approvalNumber'
  },
  {
    title: '项目审批单位',
    align: "center",
    dataIndex: 'approvalAuthority'
  },
  {
    title: '是否重点项目',
    align: "center",
    dataIndex: 'isEmphasisProject'
  },
  {
    title: '项目创建时间',
    align: "center",
    dataIndex: 'pcreateTime'
  },
  {
    title: '行业监管部门',
    align: "center",
    dataIndex: 'industryRegulatoryAuthorities'
  },
  {
    title: '是否国有资金占控股或者主导地位',
    align: "center",
    dataIndex: 'isNationalCapitalHolding'
  },
  {
    title: '交易系统标识码',
    align: "center",
    dataIndex: 'platformCode'
  },
  {
    title: '交易服务系统标识码',
    align: "center",
    dataIndex: 'pubServicePlatCode'
  },
  {
    title: '交易平台或发布工具标识码',
    align: "center",
    dataIndex: 'tradePlat'
  },
  {
    title: '公共服务平台标识码',
    align: "center",
    dataIndex: 'pubServicePlat'
  },
  {
    title: '价款形式代码',
    align: "center",
    dataIndex: 'priceFormCode'
  },
  {
    title: '投资总额单位',
    align: "center",
    dataIndex: 'investmentUnit'
  },
  {
    title: '投资总额币种代码',
    align: "center",
    dataIndex: 'investmentCurrency'
  },
  {
    title: '投资总额',
    align: "center",
    dataIndex: 'totleInvestment'
  },
  {
    title: '投资总额比率或其他',
    align: "center",
    dataIndex: 'investmentPercent'
  },
  {
    title: '项目法人统一社会信用代码',
    align: "center",
    dataIndex: 'legalCreditCode'
  },
  {
    title: '项目法人地址',
    align: "center",
    dataIndex: 'legalAddress'
  },
  {
    title: '财政资金',
    align: "center",
    dataIndex: 'financialFund'
  },
  {
    title: '自筹资金',
    align: "center",
    dataIndex: 'selfFund'
  },
  {
    title: '其他资金',
    align: "center",
    dataIndex: 'otherFund'
  },
  {
    title: '是否采用代建制',
    align: "center",
    dataIndex: 'isAgentConstruct'
  },
  {
    title: '法定代表人',
    align: "center",
    dataIndex: 'legalRepresentative'
  },
  {
    title: '交易中心编码',
    align: "center",
    dataIndex: 'dataSourceCode'
  },
  {
    title: '备注',
    align: "center",
    dataIndex: 'remark'
  },
  {
    title: '栏目类型',
    align: "center",
    dataIndex: 'projectType_dictText'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "数据唯一标识",
    field: 'sourceDataKey',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "数据来源系统的编码",
    field: 'sourceDataCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目编号",
    field: 'projectCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目名称",
    field: 'projectName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目所在行政区域代码",
    field: 'regionCode',
    component: 'JSelectUserByDept',
    //colProps: {span: 6},
  },
  {
    label: "项目类别关联代码",
    field: 'relateCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "投资项目统一代码",
    field: 'investProjectCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目地址",
    field: 'address',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目法人",
    field: 'legalPerson',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目行业分类",
    field: 'industriesType',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "资金来源",
    field: 'fundSource',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "出资比例",
    field: 'contributionScale',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目规模",
    field: 'projectScale',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "招标人名称",
    field: 'tendererName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "招标人代码",
    field: 'tendererCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "联系人",
    field: 'contactor',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "联系方式",
    field: 'contactInformation',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目审批文件名称",
    field: 'approvalName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目审批文号",
    field: 'approvalNumber',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目审批单位",
    field: 'approvalAuthority',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "是否重点项目",
    field: 'isEmphasisProject',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目创建时间",
    field: "pcreateTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "行业监管部门",
    field: 'industryRegulatoryAuthorities',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "是否国有资金占控股或者主导地位",
    field: 'isNationalCapitalHolding',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "交易系统标识码",
    field: 'platformCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "交易服务系统标识码",
    field: 'pubServicePlatCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "交易平台或发布工具标识码",
    field: 'tradePlat',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "公共服务平台标识码",
    field: 'pubServicePlat',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "价款形式代码",
    field: 'priceFormCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "投资总额单位",
    field: 'investmentUnit',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "投资总额币种代码",
    field: 'investmentCurrency',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "投资总额",
    field: 'totleInvestment',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "投资总额比率或其他",
    field: 'investmentPercent',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目法人统一社会信用代码",
    field: 'legalCreditCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "项目法人地址",
    field: 'legalAddress',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "财政资金",
    field: 'financialFund',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "自筹资金",
    field: 'selfFund',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "其他资金",
    field: 'otherFund',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "是否采用代建制",
    field: 'isAgentConstruct',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "法定代表人",
    field: 'legalRepresentative',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "交易中心编码",
    field: 'dataSourceCode',
    component: 'Input',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '数据唯一标识',
    field: 'sourceDataKey',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入数据唯一标识!'},
             ];
    },
  },
  {
    label: '数据来源系统的编码',
    field: 'sourceDataCode',
    component: 'Input',
  },
  {
    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: 'regionCode',
    component: 'JSelectUserByDept',
    componentProps:{
      labelKey: 'realname',
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入项目所在行政区域代码!'},
             ];
    },
  },
  {
    label: '项目类别关联代码',
    field: 'relateCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入项目类别关联代码!'},
             ];
    },
  },
  {
    label: '投资项目统一代码',
    field: 'investProjectCode',
    component: 'Input',
  },
  {
    label: '项目地址',
    field: 'address',
    component: 'Input',
  },
  {
    label: '项目法人',
    field: 'legalPerson',
    component: 'Input',
  },
  {
    label: '项目行业分类',
    field: 'industriesType',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入项目行业分类!'},
             ];
    },
  },
  {
    label: '资金来源',
    field: 'fundSource',
    component: 'Input',
  },
  {
    label: '出资比例',
    field: 'contributionScale',
    component: 'Input',
  },
  {
    label: '项目规模',
    field: 'projectScale',
    component: 'Input',
  },
  {
    label: '招标人名称',
    field: 'tendererName',
    component: 'Input',
  },
  {
    label: '招标人代码',
    field: 'tendererCode',
    component: 'Input',
  },
  {
    label: '联系人',
    field: 'contactor',
    component: 'Input',
  },
  {
    label: '联系方式',
    field: 'contactInformation',
    component: 'Input',
  },
  {
    label: '项目审批文件名称',
    field: 'approvalName',
    component: 'Input',
  },
  {
    label: '项目审批文号',
    field: 'approvalNumber',
    component: 'Input',
  },
  {
    label: '项目审批单位',
    field: 'approvalAuthority',
    component: 'Input',
  },
  {
    label: '是否重点项目',
    field: 'isEmphasisProject',
    component: 'Input',
  },
  {
    label: '项目创建时间',
    field: 'pcreateTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '行业监管部门',
    field: 'industryRegulatoryAuthorities',
    component: 'Input',
  },
  {
    label: '是否国有资金占控股或者主导地位',
    field: 'isNationalCapitalHolding',
    component: 'Input',
  },
  {
    label: '交易系统标识码',
    field: 'platformCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入交易系统标识码!'},
             ];
    },
  },
  {
    label: '交易服务系统标识码',
    field: 'pubServicePlatCode',
    component: 'Input',
  },
  {
    label: '交易平台或发布工具标识码',
    field: 'tradePlat',
    component: 'Input',
  },
  {
    label: '公共服务平台标识码',
    field: 'pubServicePlat',
    component: 'Input',
  },
  {
    label: '价款形式代码',
    field: 'priceFormCode',
    component: 'Input',
  },
  {
    label: '投资总额单位',
    field: 'investmentUnit',
    component: 'Input',
  },
  {
    label: '投资总额币种代码',
    field: 'investmentCurrency',
    component: 'Input',
  },
  {
    label: '投资总额',
    field: 'totleInvestment',
    component: 'InputNumber',
  },
  {
    label: '投资总额比率或其他',
    field: 'investmentPercent',
    component: 'Input',
  },
  {
    label: '项目法人统一社会信用代码',
    field: 'legalCreditCode',
    component: 'Input',
  },
  {
    label: '项目法人地址',
    field: 'legalAddress',
    component: 'Input',
  },
  {
    label: '财政资金',
    field: 'financialFund',
    component: 'InputNumber',
  },
  {
    label: '自筹资金',
    field: 'selfFund',
    component: 'InputNumber',
  },
  {
    label: '其他资金',
    field: 'otherFund',
    component: 'InputNumber',
  },
  {
    label: '是否采用代建制',
    field: 'isAgentConstruct',
    component: 'Input',
  },
  {
    label: '法定代表人',
    field: 'legalRepresentative',
    component: 'Input',
  },
  {
    label: '交易中心编码',
    field: 'dataSourceCode',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
  },
  {
    label: '栏目类型',
    field: 'projectType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "project_type"
    },
    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',},
  sourceDataCode: {title: '数据来源系统的编码',order: 1,view: 'text', type: 'string',},
  projectCode: {title: '项目编号',order: 2,view: 'text', type: 'string',},
  projectName: {title: '项目名称',order: 3,view: 'text', type: 'string',},
  regionCode: {title: '项目所在行政区域代码',order: 4,view: 'sel_user', type: 'string',},
  relateCode: {title: '项目类别关联代码',order: 5,view: 'text', type: 'string',},
  investProjectCode: {title: '投资项目统一代码',order: 6,view: 'text', type: 'string',},
  address: {title: '项目地址',order: 7,view: 'text', type: 'string',},
  legalPerson: {title: '项目法人',order: 8,view: 'text', type: 'string',},
  industriesType: {title: '项目行业分类',order: 9,view: 'text', type: 'string',},
  fundSource: {title: '资金来源',order: 10,view: 'text', type: 'string',},
  contributionScale: {title: '出资比例',order: 11,view: 'text', type: 'string',},
  projectScale: {title: '项目规模',order: 12,view: 'text', type: 'string',},
  tendererName: {title: '招标人名称',order: 13,view: 'text', type: 'string',},
  tendererCode: {title: '招标人代码',order: 14,view: 'text', type: 'string',},
  contactor: {title: '联系人',order: 15,view: 'text', type: 'string',},
  contactInformation: {title: '联系方式',order: 16,view: 'text', type: 'string',},
  approvalName: {title: '项目审批文件名称',order: 17,view: 'text', type: 'string',},
  approvalNumber: {title: '项目审批文号',order: 18,view: 'text', type: 'string',},
  approvalAuthority: {title: '项目审批单位',order: 19,view: 'text', type: 'string',},
  isEmphasisProject: {title: '是否重点项目',order: 20,view: 'text', type: 'string',},
  pcreateTime: {title: '项目创建时间',order: 21,view: 'datetime', type: 'string',},
  industryRegulatoryAuthorities: {title: '行业监管部门',order: 22,view: 'text', type: 'string',},
  isNationalCapitalHolding: {title: '是否国有资金占控股或者主导地位',order: 23,view: 'text', type: 'string',},
  platformCode: {title: '交易系统标识码',order: 24,view: 'text', type: 'string',},
  pubServicePlatCode: {title: '交易服务系统标识码',order: 25,view: 'text', type: 'string',},
  tradePlat: {title: '交易平台或发布工具标识码',order: 26,view: 'text', type: 'string',},
  pubServicePlat: {title: '公共服务平台标识码',order: 27,view: 'text', type: 'string',},
  priceFormCode: {title: '价款形式代码',order: 28,view: 'text', type: 'string',},
  investmentUnit: {title: '投资总额单位',order: 29,view: 'text', type: 'string',},
  investmentCurrency: {title: '投资总额币种代码',order: 30,view: 'text', type: 'string',},
  totleInvestment: {title: '投资总额',order: 31,view: 'number', type: 'number',},
  investmentPercent: {title: '投资总额比率或其他',order: 32,view: 'text', type: 'string',},
  legalCreditCode: {title: '项目法人统一社会信用代码',order: 33,view: 'text', type: 'string',},
  legalAddress: {title: '项目法人地址',order: 34,view: 'text', type: 'string',},
  financialFund: {title: '财政资金',order: 35,view: 'number', type: 'number',},
  selfFund: {title: '自筹资金',order: 36,view: 'number', type: 'number',},
  otherFund: {title: '其他资金',order: 37,view: 'number', type: 'number',},
  isAgentConstruct: {title: '是否采用代建制',order: 38,view: 'text', type: 'string',},
  legalRepresentative: {title: '法定代表人',order: 39,view: 'text', type: 'string',},
  dataSourceCode: {title: '交易中心编码',order: 40,view: 'text', type: 'string',},
  remark: {title: '备注',order: 41,view: 'text', type: 'string',},
  projectType: {title: '栏目类型',order: 42,view: 'radio', type: 'string',},
};
