import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { ref} from 'vue';
import { JVxeColumn, JVxeTypes } from "@/components/jeecg/JVxeTable/src/types";
//列表数据

export const columns = ref<JVxeColumn[]>([
  /*{ key: 'num', title: '序号', width: 80, type: JVxeTypes.normal },*/
  {
    title: '操作',
    key: 'action',
    type: JVxeTypes.slot,
    fixed: 'right',
    minWidth: 60,
    align: 'center',
    slotName: 'myAction',
    showSub: false,
  },
  {
    title: '操作',
    key: 'action2',
    type: JVxeTypes.slot,
    fixed: 'right',
    minWidth: 60,
    align: 'center',
    slotName: 'myAction2',
    showSub: true,
  },

  {
    title: '学校名称',
    align: "center",
    key: 'schoolName',
    // 列的宽度
    width: 200,
    // 如果加上了该属性，就代表当前单元格是可编辑的，type就是表单的类型，input就是简单的输入框
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '旧院校名称',
    align: "center",
    key: 'oldSchoolName',
    width: 200,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '官方网址',
    align: "center",
    key: 'schoolWebsiteAddress',
    width: 200,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '学校电话',
    align: "center",
    key: 'schoolPhone',
    width: 200,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '电子邮箱',
    align: "center",
    key: 'schoolEmail',
    width: 200,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '学校图标',
    align: "center",
    key: 'schoolIcon',
    // customRender: render.renderImage,
    showSub: false,
    type: JVxeTypes.image,
    width: 180,
    maxCount: 1,
  },
  {
    title: '办学日期',
    align: "center",
    key: 'schoolOpenDate',
    width:100,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '省份',
    align: "center",
    key: 'province',
    width:100,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '城市',
    align: "center",
    key: 'city',
    width:100,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '区域',
    align: "center",
    key: 'area',
    width:100,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '详细地址',
    align: "center",
    key: 'street',
    width: 300,
    type: JVxeTypes.textarea,
    showSub: false,
  },
  {
    title: '隶属于',
    align: "center",
    key: 'affiliation',
    width:100,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '办学性质',
    align: "center",
    key: 'schoolNature',
    type: JVxeTypes.select,
    showSub: false,
    width: 180,
    // 下拉选项
    options: [
      { title: '公办', value: '公办' },
      { title: '民办', value: '民办' },
      { title: '中外合作办学', value: '中外合作办学' },
      { title: '内地与港澳台地区合作办学', value: '内地与港澳台地区合作办学' },
    ],
    allowSearch: true,
    placeholder: '请选择',
  },
  {
    title: '院校类型',
    align: "center",
    key: 'institutionType',
    width:100,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '办学类型',
    align: "center",
    key: 'schoolType',
    width:100,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '学生人数',
    align: "center",
    key: 'studentNum',
    width:100,
    type: JVxeTypes.input,
    showSub: false,
  },
  // {
  //   title: '学校批次',
  //   align: "center",
  //   key: 'schoolBatch',
  //   width:100,
  //   type: JVxeTypes.input,
  // showSub: false,
  // },
  {
    title: '985工程',
    align: "center",
    key: 'is985',
    type: JVxeTypes.checkbox,
    width: 100,
    customValue: ['1', '0'], // true ,false
    defaultChecked: false,
    showSub: false,
  },
  {
    title: '211工程',
    align: "center",
    key: 'is211',
    type: JVxeTypes.checkbox,
    width: 100,
    customValue: ['1', '0'], // true ,false
    defaultChecked: false,
    showSub: false,
  },
  {
    title: '强基计划',
    align: "center",
    key: 'isStrengthen',
    type: JVxeTypes.checkbox,
    width: 100,
    customValue: ['1', '0'], // true ,false
    defaultChecked: false,
    showSub: false,
  },
  {
    title: '一流大学',
    align: "center",
    key: 'yldx',
    width:150,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '国重/省重',
    align: "center",
    key: 'gzsz',
    width:150,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '保研率',
    align: "center",
    key: 'byl',
    width:120,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '国家特色专业',
    align: "center",
    key: 'gjtszy',
    width:150,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '省特色专业',
    align: "center",
    key: 'stszy',
    width:150,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '是否国重点',
    align: "center",
    key: 'gzd',
    type: JVxeTypes.checkbox,
    width: 100,
    customValue: ['1', '0'], // true ,false
    defaultChecked: false,
    showSub: false,
  },
  {
    title: '世界一流',
    align: "center",
    key: 'sjyl',
    width:120,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '是否双一流',
    align: "center",
    key: 'sfsyl',
    type: JVxeTypes.checkbox,
    width: 100,
    customValue: ['1', '0'], // true ,false
    defaultChecked: false,
    showSub: false,
  },
  {
    title: '占地面积(亩)',
    align: "center",
    key: 'are',
    width:120,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '男生占比',
    align: "center",
    key: 'maleRatio',
    width:120,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '女生占比',
    align: "center",
    key: 'femaleRatio',
    width:120,
    type: JVxeTypes.input,
    showSub: false,
  },
  {
    title: '艺术院校',
    align: "center",
    key: 'isYs',
    type: JVxeTypes.checkbox,
    width: 100,
    customValue: ['1', '0'], // true ,false
    defaultChecked: false,
    showSub: false,
  },
]);

export const columns2: BasicColumn[] = [
  {
    title: '学校名称',
    align: "center",
    dataIndex: 'schoolName'
  },
  {
    title: '旧院校名称',
    align: "center",
    dataIndex: 'oldSchoolName'
  },
  {
    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'
  },
  {
    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: 'schoolType'
  },
  {
    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: 'yldx'
  },
  {
    title: '国重/省重',
    align: "center",
    dataIndex: 'gzsz'
  },
  {
    title: '保研率',
    align: "center",
    dataIndex: 'byl'
  },
  {
    title: '国家特色专业',
    align: "center",
    dataIndex: 'gjtszy'
  },
  {
    title: '省特色专业',
    align: "center",
    dataIndex: 'stszy'
  },
  {
    title: '是否国重点',
    align: "center",
    dataIndex: 'gzd'
  },
  {
    title: '世界一流',
    align: "center",
    dataIndex: 'sjyl'
  },
  {
    title: '是否双一流',
    align: "center",
    dataIndex: 'sfsyl'
  },
  {
    title: '占地面积(亩)',
    align: "center",
    dataIndex: 'are'
  },
  {
    title: '男生占比',
    align: "center",
    dataIndex: 'maleRatio'
  },
  {
    title: '女生占比',
    align: "center",
    dataIndex: 'femaleRatio'
  },
  {
    title: '是否是艺术',
    align: "center",
    dataIndex: 'isYs'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '学校名称',
    field: 'schoolName',
    component: 'Input',
  },
  {
    label: '旧院校名称',
    field: 'oldSchoolName',
    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: 'Input',
  },
  {
    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: 'schoolType',
    component: 'Input',
  },
  {
    label: '学生人数',
    field: 'studentNum',
    component: 'Input',
  },
  {
    label: '基本信息',
    field: 'baseInfo',
    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: 'yldx',
    component: 'Input',
  },
  {
    label: '国重/省重',
    field: 'gzsz',
    component: 'Input',
  },
  {
    label: '保研率',
    field: 'byl',
    component: 'Input',
  },
  {
    label: '国家特色专业',
    field: 'gjtszy',
    component: 'Input',
  },
  {
    label: '省特色专业',
    field: 'stszy',
    component: 'Input',
  },
  {
    label: '是否国重点',
    field: 'gzd',
    component: 'Input',
  },
  {
    label: '世界一流',
    field: 'sjyl',
    component: 'Input',
  },
  {
    label: '是否双一流',
    field: 'sfsyl',
    component: 'Input',
  },
  {
    label: '占地面积(亩)',
    field: 'are',
    component: 'InputNumber',
  },
  {
    label: '男生占比',
    field: 'maleRatio',
    component: 'InputNumber',
  },
  {
    label: '女生占比',
    field: 'femaleRatio',
    component: 'InputNumber',
  },
  {
    label: '是否是艺术',
    field: 'isYs',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
