/*
 *    Copyright (c) 2018-2025, cyweb All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 */

import global from "@/components/tools/commondict"
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  editBtn: false,
  delBtn: false,
  addBtn: false,
  labelWidth:120,
  dic: [],
  column: [
	  {
      label: '主键',
      prop: 'id',
      hide: true,
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false
    },
	  {
      label: '创建人',
      prop: 'createBy',
      hide: true,
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false
    },
	  {
      label: '创建时间',
      prop: 'createTime',
      hide: true,
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false
    },
	  {
      label: '更新人',
      prop: 'updateBy',
      hide: true,
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false
    },
	  {
      label: '更新时间',
      prop: 'updateTime',
      hide: true,
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false
    },
	  {
      label: '删除标记',
      prop: 'delFlag',
      hide: true,
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false
    },
    {
      label: '学年',
      prop: 'schoolYear',
      span: 12,
      width:120,
      type:'select',
      search:true,
      dicUrl:'/basic/basicyear/queryAllSchoolYear',
      props:{
        label:'year',
        value:'year'
      },
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false

    },
    {
      label: '学期',
      prop: 'schoolTerm',
      type:'select',
      search:true,
      dicData:global.LEARN_TERM,
      props:{
        label:'label',
        value:'value'
      },
      rules: [
        {
          required: true,
          trigger: 'blur',
          message:"选择学期"
        }
      ]
    },
	  // {
    //   label: '学期',
    //   prop: 'schoolTerm',
    //   span: 12,
    //   search:true,
    //   width:60,
    //   addDisplay:false,
    //   editDisabled:true,
    //   editDisplay:false,
    //   visdiplay:false
    // },
    {
      label: '专业',
      prop: 'majorCode',
      span: 12,
      search:true,
      searchPlaceholder:' 专业编码/名称',
      formslot:true,
      hide:true,
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false

    },
    {
      label: '专业编码',
      prop: 'majorCodeN',
      span: 12,

      width:100,
      slot:true,
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false

    },
    {
      label: '专业名称',
      prop: 'majorName',
      span: 12,
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false

    },
    {
      label: '年级',
      prop: 'majorGrade',
      span: 12,
      formslot:true,
      search:true,
      type:'select',
      dicUrl:'admin/dict/item/type/basic_class_info_grade',
      props:{
        label:'label',
        value:'value'
      },
      width:80,
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false
    },
    {
      label: '课程',
      prop: 'courseCode',
      span: 12,
      search:true,
      searchPlaceholder:' 课程编码/名称',
      formslot:true,
      hide:true,
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false
    },
    {
      label: '课程编码',
      prop: 'courseCodeN',
      span: 12,

      slot:true,
      width:80,
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false
    },
    {
      label: '课程名称',
      prop: 'courseName',
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false
    },
    {
      label: '课程性质',
      prop: 'courseProperties',
      type:'select',
      dicUrl:'/ems/courseproperties/list',
      props:{
        label:'propertiesName',
        value:'id'
      },
      rules: [{
        required: true,
        message: "请选择课程性质",
        trigger: "blur"
      }],
      width:120,
    },
    {
      label: '考核方式',
      prop: 'courseEvaluationMode',
      type:'select',
      dicUrl: '/ems/courseevaluationmode/list',
      props: {
        label: 'courseEvaluationModeName',
        value: 'id'
      },
      rules: [{
        required: true,
        message: "请选择课程考核方式",
        trigger: "blur"
      }],
      // formslot:true,
      width:100,
    },
    {
      label: '学分',
      prop: 'courseScore',
      span: 12,
      formslot:true,
      width:80,
      rules: [
        {required: true, message: "请填写课程学分", trigger: "blur"},
        {type: 'number', message: '课程学分必须为数字值', transform: (value) => Number(value)}
      ],
    },
    {
      label: '起止周',
      prop: 'teachWeekRange',
      span: 12,

      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false
    },
    {
      label: '开课部门',
      prop: 'openDeptcode',
      span: 12,
      type:"select",
      search:true,
      dicUrl: '/basic/basicdept/getDeptList?teachFlag=1',
      props: {
        label: 'deptName',
        value: 'deptCode'
      },
      width:120,
      rules: [{
        required: true,
        message: "请选择开课部门",
        trigger: "blur"
      }]
    },

    {
      label: '课时',
      prop: 'courseTeachUnit',
      span: 12,
      formslot:true,
      rules: [{
        required: true,
        message: "请填写课时",
        trigger: "blur"
      }]
    },
    {
      label: '周课时',
      prop: 'weekUnit',
      span: 12,
      type:'number',
      rules: [{
        required: true,
        message: "请填写周课时",
        trigger: "blur"
      }]
    },


    // {
    //   label: '流程实例ID',
    //   prop: 'procInsId',
    //   span: 12,
    //   labelWidth: 120,
    //   rules: [{
    //     required: true,
    //     message: "请填写流程实例ID",
    //     trigger: "blur"
    //   }]
    // },
    {
      label: '锁定状态',
      prop: 'procInsStatus',
      span: 12,
      labelWidth: 120,
      type:'select',
      search:true,
      dicData:global.TEACH_PLAN_ASSIGN_CHECK_STATUS,
      props:{
        label:'label',
        value:'value'
      },
      addDisplay:false,
      editDisplay:false
    },
    // {
    //   label: '备注',
    //   prop: 'remarks',
    //   type:"textarea",
    //   span: 24
    // },
  ]
}

export const dialogOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  editBtn: false,
  delBtn: false,
  addBtn: false,
  menu:false,
  selection:true,
  labelWidth:120,
  dic: [],
  column: [
    {
      label: '学年',
      prop: 'schoolYear',
      span: 12,
      type:'select',
      dicUrl:'/basic/basicyear/queryAllSchoolYear',
      props:{
        label:'year',
        value:'year'
      },

    },
    {
      label: '学期',
      prop: 'schoolTerm',
      span: 12,
      type:'select',
      dicData:global.LEARN_TERM,
      props:{
        label:'label',
        value:'value'
      },
      editDisabled:true,
    },
    {
      label: '专业名称',
      prop: 'majorName',
      span: 12
    },
    {
      label: '年级',
      prop: 'majorGrade',
      span: 12,
      type:'select',
      dicUrl:'admin/dict/item/type/basic_class_info_grade',
      props:{
        label:'label',
        value:'value'
      }
    },
    // {
    //   label: '课程编码',
    //   prop: 'courseCodeN',
    //   span: 12,
    //   addDisplay:false,
    //   editDisplay:false,
    //   slot:true
    // },
    // {
    //   label: '课程名称',
    //   prop: 'courseName',
    //   addDisplay:false,
    //   editDisplay:false
    // }
  ]
}
