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: 'schoolCode_dictText'
   },
   {
    title: '专业',
    align:"center",
    dataIndex: 'majorCode_dictText'
   },
   {
    title: '年份',
    align:"center",
    dataIndex: 'year'
   },
   {
    title: '招生人数',
    align:"center",
    dataIndex: 'enrollNum'
   },
   {
    title: '录取方式',
    align:"center",
    dataIndex: 'rulesEnrollProbability'
   },
   {
    title: '文科录取线',
    align:"center",
    dataIndex: 'artsAdmissionLine'
   },
  {
    title: '理科录取线',
    align:"center",
    dataIndex: 'scienceAdmissionLine'
  },
  {
    title: '文科省控线',
    align:"center",
    dataIndex: 'artsControlLine'
  },
  {
    title: '理科省控线',
    align:"center",
    dataIndex: 'scienceControlLine'
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '学校',
    field: 'schoolCode',
    component: 'JSearchSelect',
    colProps: { sm: 24 },
    componentProps: {
      dict: 'yx_school,school_name,school_code',
    },
    dynamicRules: () => {
      return [{ required: true, message: '请选择学校!' }];
    },
  },
  {
    label: '专业',
    field: 'majorCode',
    colProps: { sm: 24 },
    component: 'JSearchSelect',
    componentProps: {
      dict: 'yx_major,major_name,major_code',
    },
    dynamicRules: () => {
      return [{ required: true, message: '请选择专业!' }];
    }
  },
  {
    label: '年份',
    field: 'year',
    component: 'Input',
  },
  {
    label: '招生人数',
    field: 'enrollNum',
    component: 'InputNumber',
  },

  {
    label: '录取方式',
    field: 'rulesEnrollProbability',
    component: 'Input',
  },
  {
    label: '录取概率计算规则运算符',
    field: 'probabilityOperator',
    component: 'Input',
  },
  {
    label: '文科录取线',
    field: 'artsAdmissionLine',
    component: 'InputNumber',
  },
  {
    label: '理科录取线',
    field: 'scienceAdmissionLine',
    component: 'InputNumber',
  },
  {
    label: '文科省控线',
    field: 'artsControlLine',
    component: 'InputNumber',
  },
  {
    label: '理科省控线',
    field: 'scienceControlLine',
    component: 'InputNumber',
  },

  {
    label: '备注',
    field: 'detail',
    component: 'InputTextArea',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



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