/*
 *    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 isHaveAir = [{label: '未安装', value: '0'}, {label: '已安装', value: '1'}]

export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  editBtn: false,
  delBtn: false,
  addBtn: false,
  selection:true,
  dic: [],
  column: [
    {
      label: '学院',
      prop: 'deptCode',
      labelWidth: 120,
      search:true,
      type:"select",
      dicUrl: '/basic/basicdept/getDeptList?secondFlag=1',
      props: {
        label: 'deptName',
        value: 'deptCode'
      }
    },
    {
      label: '楼号',
      prop: 'buildingNo',
      labelWidth: 120,
      editDisabled: true,
      search: true,
      type: "select",
      dicUrl: '/stuwork/dormbuilding/list',
      props: {
        label: 'buildingNo',
        value: 'buildingNo'
      },
      rules: [{
        required: true,
        message: '请选择楼号',
        trigger: 'blur'
      }]
    },
    {
      label: '房间号',
      prop: 'roomNo',
      // editDisabled:true,
      labelWidth: 120,

      search: true,
      rules: [{
        required: true,
        message: '请填写房间号',
        trigger: 'blur'
      }]
    },
    // {
    //   label: '房间类型',
    //   prop: 'roomType',
    //   search:true,
    //   type:'select',
    //   labelWidth:120,
    //   dicUrl: '/admin/dict/item/type/room_type',
    //   props:{
    //     label:'label',
    //     value:'value'
    //   },
    //   rules: [{
    //     required: true,
    //     message: '请选择房间类型',
    //     trigger: 'blur'
    //   }]
    // },
    {
      label: '几人间',
      labelWidth: 120,

      prop: 'bedNum',
      search: true,
      type: "select",
      dicUrl: '/admin/dict/item/type/room_stu_num',
      props: {
        label: 'label',
        value: 'value'
      },
      rules: [{
        required: true,
        message: '请选择几人间',
        trigger: 'blur'
      }]
    },
    // {
    //   label: '装空调',
    //   labelWidth: 120,
    //   prop: 'isHaveAir',
    //   search: true,
    //   type: 'select',
    //   dicData: isHaveAir,
    //   props: {
    //     label: 'label',
    //     value: 'value'
    //   }
    // },
    {
      label: '已住人数',
      labelWidth: 120,
      prop: 'livedNum',
      search: true,
      addDisplay:false,
      editDisplay:false,
      editDisabled:true,
    },
    {
      label: '备注',
      labelWidth: 120,
      prop: 'remarks',
      type: 'textarea',
      span: 24
    },
  ]
}
