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: 'schoolName'
   },
   {
    title: '学校编码',
    align:"center",
    dataIndex: 'schoolCode'
   },
   {
    title: '院校编码',
    align:"center",
    dataIndex: 'institutionCode'
   },
   {
    title: '官方网址',
    align:"center",
    dataIndex: 'schoolWebsiteAddress'
   },
   {
    title: '学校电话',
    align:"center",
    dataIndex: 'schoolPhone'
   },
   {
    title: '电子邮箱',
    align:"center",
    dataIndex: 'schoolEmail'
   },
   {
    title: '学校图标',
    align:"center",
    dataIndex: 'schoolIcon',
    customRender:render.renderImage,
   },
   {
    title: '办学日期',
    align:"center",
    dataIndex: 'schoolOpenDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '省',
    align:"center",
    dataIndex: 'province'
   },
   {
    title: '市',
    align:"center",
    dataIndex: 'city'
   },
   {
    title: '区',
    align:"center",
    dataIndex: 'area'
   },
   {
    title: '详细地址',
    align:"center",
    dataIndex: 'street'
   },
   {
    title: '隶属于',
    align:"center",
    dataIndex: 'affiliation'
   },
   {
    title: '办学性质',
    align:"center",
    dataIndex: 'schoolNature'
   },
   {
    title: '院校类型',
    align:"center",
    dataIndex: 'institutionType'
   },
   {
    title: '博士点',
    align:"center",
    dataIndex: 'doctoralPoint'
   },
   {
    title: '硕士点',
    align:"center",
    dataIndex: 'masterPoint'
   },
   {
    title: '重点学科',
    align:"center",
    dataIndex: 'keyDisciplines'
   },
   {
    title: '重点实验室',
    align:"center",
    dataIndex: 'keyLaboratory'
   },
   {
    title: '学生人数',
    align:"center",
    dataIndex: 'studentNum'
   },
   {
    title: '标签',
    align:"center",
    dataIndex: 'tags'
   },
   {
    title: '学校批次',
    align:"center",
    dataIndex: 'schoolBatch'
   },
   {
    title: '985工程',
    align:"center",
    dataIndex: 'is985'
   },
   {
    title: '211工程',
    align:"center",
    dataIndex: 'is211'
   },
   {
    title: '强基计划',
    align:"center",
    dataIndex: 'isStrengthen'
   },
   {
    title: '占地面积(亩)',
    align:"center",
    dataIndex: 'are'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '学校名称',
    field: 'schoolName',
    component: 'Input',
  },
  {
    label: '学校编码',
    field: 'schoolCode',
    component: 'Input',
  },
  {
    label: '院校编码',
    field: 'institutionCode',
    component: 'Input',
  },
  {
    label: '官方网址',
    field: 'schoolWebsiteAddress',
    component: 'Input',
  },
  {
    label: '学校电话',
    field: 'schoolPhone',
    component: 'Input',
  },
  {
    label: '电子邮箱',
    field: 'schoolEmail',
    component: 'Input',
  },
  {
    label: '学校图标',
    field: 'schoolIcon',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '办学日期',
    field: 'schoolOpenDate',
    component: 'DatePicker',
  },
  {
    label: '省',
    field: 'province',
    component: 'Input',
  },
  {
    label: '市',
    field: 'city',
    component: 'Input',
  },
  {
    label: '区',
    field: 'area',
    component: 'Input',
  },
  {
    label: '详细地址',
    field: 'street',
    component: 'Input',
  },
  {
    label: '隶属于',
    field: 'affiliation',
    component: 'Input',
  },
  {
    label: '办学性质',
    field: 'schoolNature',
    component: 'Input',
  },
  {
    label: '院校类型',
    field: 'institutionType',
    component: 'Input',
  },
  {
    label: '博士点',
    field: 'doctoralPoint',
    component: 'InputNumber',
  },
  {
    label: '硕士点',
    field: 'masterPoint',
    component: 'InputNumber',
  },
  {
    label: '重点学科',
    field: 'keyDisciplines',
    component: 'InputNumber',
  },
  {
    label: '重点实验室',
    field: 'keyLaboratory',
    component: 'InputNumber',
  },
  {
    label: '学生人数',
    field: 'studentNum',
    component: 'Input',
  },
  {
    label: '基本信息',
    field: 'baseInfo',
    component: 'JEditor',
  },
  {
    label: '历史文化',
    field: 'hisotryCulture',
    component: 'JEditor',
  },
  {
    label: '标签',
    field: 'tags',
    component: 'Input',
  },
  {
    label: '学校批次',
    field: 'schoolBatch',
    component: 'Input',
  },
  {
    label: '985工程',
    field: 'is985',
    component: 'InputNumber',
  },
  {
    label: '211工程',
    field: 'is211',
    component: 'InputNumber',
  },
  {
    label: '强基计划',
    field: 'isStrengthen',
    component: 'InputNumber',
  },
  {
    label: '占地面积(亩)',
    field: 'are',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}