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: 'tuition'
   },

  {
    title: '批次',
    align:"center",
    dataIndex: 'batch'
  },
  {
    title: '(文科)专业代码',
    align:"center",
    dataIndex: 'artsMajorCode'
  },
  {
    title: '(理科)专业代码',
    align:"center",
    dataIndex: 'scienceMajorCode'
  },
   {
    title: '备注',
    align:"center",
    dataIndex: 'detail'
   },
];
//查询数据
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: 'tuition',
    component: 'InputNumber',
  },
  {
    label: '文科-省控线',
    field: 'artsControlLine',
    component: 'InputNumber',
  },
  {
    label: '理科-省控线',
    field: 'scienceControlLine',
    component: 'InputNumber',
  },
  {
    label:'专项分数线',
    field:'specialControlLine',
    component: 'InputNumber',
  },
  {
    label: '录取方式',
    field: 'rulesEnrollProbability',
    component: 'Input',
  },
  {
    label: '录取概率计算规则运算符',
    field: 'probabilityOperator',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'detail',
    component: 'Input',
  },
  {
    label: '批次',
    field: 'batch',
    component: 'Input',
  },
  {
    label: '(文科)专业代码',
    field: 'artsMajorCode',
    component: 'Input',
  },
  {
    label: '(理科)专业代码',
    field: 'scienceMajorCode',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false
  },
];

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