/*
 *    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";
import {isInvalid, YES_OR_NO2} from "@/const/crud/asset/assets/assetassets";
export const wxstat=[
  {
    label:'正常',
    value:'0'
  },
  {
    label:'维修',
    value:'1'
  },
  {
    label:'维护',
    value:'2'
  }
]
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  editBtn: false,
  delBtn: false,
  addBtn: false,
  dic: [],
  column: [
	  {
      label: '',
      prop: 'id'
    },
	  {
      label: '创建人',
      prop: 'createBy'
    },
	  {
      label: '创建时间',
      prop: 'createTime'
    },
	  {
      label: '更新人',
      prop: 'updateBy'
    },
	  {
      label: '更新时间',
      prop: 'updateTime'
    },
	  {
      label: '删除标志',
      prop: 'delFlag'
    },
	  {
      label: '租户ID',
      prop: 'tenantId'
    },
	  {
      label: '备注',
      prop: 'remark'
    },
	  {
      label: '学院',
      prop: 'deptCode'
    },
	  {
      label: '资产id',
      prop: 'assetId'
    },
	  {
      label: '资产状态0正常 1维修 2保养',
      prop: 'assetState'
    },
	  {
      label: '班级代码',
      prop: 'classCode'
    },
	  {
      label: '任课教师',
      prop: 'teacherNo'
    },
	  {
      label: '所属区域',
      prop: 'buildingId'
    },
  ]
}
export const tableDetailPageOption= {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  editBtn: false,
  delBtn: false,
  addBtn: false,
  dic: [],
  refreshBtn: false,
  height:500,
  showColumnBtn: false,
  searchSize: 'mini',
  selection: true,
  selectable:(row,index)=>{
    return index===1;
  },
  column: [
    {
      label: '资产编码',
      prop: 'code',
      search: true
    },
    {
      label: '资产名称',
      prop: 'goodsName',
      search: true
    },
    {
      label: '规格|型号',
      prop: 'spec'
    },
    {
      label: '单位',
      prop: 'unit'
    },
    {
      label: '数量',
      prop: 'num',
    },
    {
      label: '价格',
      prop: 'price',
    },
    {
      label: '使用部门',
      prop: 'belongDeptName',
    },
    {
      label: '入库时间',
      prop: 'intTimeValue',
    },

    {
      label: '部门名称',
      prop: 'belongDeptCode',
      searchFilterable:true,
      type:'select',
      hide: true,
      addDisplay: false,
      search:true,
      editDisplay: false,
      dicUrl: '/basic/basicdept/getDeptListByLevelTwo',
      props:{
        label:'deptName',
        value:'deptCode'
      },
    },
    {
      label: '资产分类',
      prop: 'codeEnName',
      type:'select',
      filterable:true,
      searchFilterable:true,
      hide: true,
      addDisplay: false,
      search:true,
      editDisplay: false,
      dicUrl: '/asset/assetcode/allList',
      props:{
        label:'codeName',
        value:'codeEnName'
      },
    },
    {
      label: '资产状态',
      prop: 'isInvalid',
      type:'select',
      dicData:isInvalid,
      props:{
        label:'label',
        value:'value'
      },
      search:true
    },
    {
      label: '维修/维护',
      prop: 'isInvalid',
      type:'select',
      dicData:wxstat,
      props:{
        label:'label',
        value:'value'
      },
      search:true
    },
    {
      label: '班级及任课老师',
      prop: '',
    },
    {
      label: '开始编码',
      prop: 'startCode',
      hide: true,
      search:true
    },
    {
      label: '结束编码',
      prop: 'endCode',
      hide: true,
      search:true
    },

    {
      label: '最小面积',
      prop: 'minArea',
      addDisplay: false,
      editDisplay: false,
      search:true,
      hide: true
    },
    {
      label: '最大面积',
      prop: 'maxArea',
      addDisplay: false,
      editDisplay: false,
      search:true,
      hide: true
    },
    {
      label: '主键',
      prop: 'id',
      hide: true,
      addDisplay:false,
      editDisabled:true,
      editDisplay:false,
      visdiplay:false
    },
    {
      label: '最小单价',
      prop: 'minPrice',
      addDisplay: false,
      editDisplay: false,
      search:true,
      hide: true
    },
    {
      label: '最大单价',
      prop: 'maxPrice',
      addDisplay: false,
      editDisplay: false,
      search:true,
      hide: true
    },

    {
      label: '入库开始时间',
      prop: 'startTime',
      type: 'date',
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      search:true,
      hide: true
    },
    {
      label: '入库结束时间',
      prop: 'endTime',
      type: 'date',
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      search:true,
      hide: true
    },
    {
      label: '部门编码',
      prop: 'belongDeptCode',
      hide: true,
    },
    {
      label: '存放地类型',
      prop: 'roomType',
      type:'select',
      dicData:global.all_room_type_id,
      props:{
        label:'label',
        value:'value'
      },
    },
    {
      label: '存放楼栋',
      prop: 'buildName'
    },
    {
      label: '存放楼栋',
      prop: 'buildId',
      type:'select',
      filterable:true,
      searchFilterable:true,
      addDisplay: false,
      search:true,
      hide:true,
      editDisplay: false,
      dicUrl: '/asset/assetsbuilding/list',
      props:{
        label:'buildName',
        value:'id'
      },
    },
    {
      label: '存放房间',
      prop: 'roomName'
    },
    {
      label: '存放房间',
      prop: 'roomId',
      type:'select',
      filterable:true,
      searchFilterable:true,
      addDisplay: false,
      search:true,
      hide:true,
      editDisplay: false,
      dicUrl: '/asset/assetsroom/listBuild',
      props:{
        label:'roomCode',
        value:'id'
      },
    },
    {
      label: '照片',
      prop: 'photo',
      slot: true,
      formslot: true
    },
    {
      label: '调拨日期',
      prop: 'transferTime',
    },{
      label: '备注',
      prop: 'remarks',
      search:true
    },{
      label: '老资产ID',
      prop: 'oldId',
      search: true
    },{
      label: '调拨状态',
      prop: 'transferState',
      search: true,
      hide: true,
      type:'select',
      dicData:global.transferState,
      props:{
        label:'label',
        value:'value'
      },
    },{
      label: '报废状态',
      prop: 'invalidState',
      search: true,
      hide: true,
      type:'select',
      dicData:global.invalidState,
      props:{
        label:'label',
        value:'value'
      },
    }
  ]
}
