import { setStore, getStore } from '@/utils/store';
export default {
  height:'auto',
  calcHeight: 30,
  tip: false,
  searchShow: true,
  searchMenuSpan: 6,
  border: true,
  index: true,
  viewBtn: true,
  selection: true,
  dialogClickModal: false,
  columnBtn:false,
  editBtn:false,
  delBtn:false,
  column: {
    id:{
      label: "主键",
      prop: "id",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    tenantId:{
      label: "租户ID",
      prop: "tenantId",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    factoryId:{
      label: "所属工厂",
      prop: "factoryId",
      search: getStore({ name: 'userInfo' }).user_category==1,
      hide: getStore({ name: 'userInfo' }).user_category!=1,
      display: getStore({ name: 'userInfo' }).user_category==1,
      type: "tree",
      cascader: [getStore({ name: 'userInfo' }).user_category==1?'clientId':'',getStore({ name: 'userInfo' }).user_category==1?'productModelId':''],
      dicUrl: "/api/pl-factory/factory/select",
      props: {
        label: "name",
        value: "id",
      },
      rules: [{
        required: true,
        message: "请选择所属工厂",
        trigger: "blur"
      }]
    },
    batchNo:{
      label: "批次号",
      prop: "batchNo",
      type: "input",
      search: true,
      addDisplay: false,
      editDisplay: false,
    },
    
    clientId:{
      label: "所属客户",
      prop: "clientId",
      type: "input",
      search: true,
      type: "tree",
      dicUrl: "/api/pl-client/client/select?factoryId={{factoryId}}",
      props: {
        label: "name",
        value: "id",
      },
      rules: [{
        required: true,
        message: "请选择所属客户",
        trigger: "blur"
      }]
    },
    productModelId:{
      label: "产品型号",
      prop: "productModelId",
      type: "input",
      search: true,
      type: "tree",
      dicUrl: "/api/pl-productModel/productModel/select?factoryId={{factoryId}}",
      props: {
        label: "productName",
        value: "id",
      },
      // typeformat (item, label, value) {
      //   return `${item.productName}-${item.productModel}`
      // },
      rules: [{
        required: true,
        message: "请选择产品型号",
        trigger: "blur"
      }]
    },
    productName:{
      label: "产品名称",
      prop: "productName",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      search: true,
    },
    qrCode:{
      label: "产品编号",
      prop: "qrCode",
      type: "input",
      search: true,
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    productModel:{
      label: "产品型号",
      prop: "productModel",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    orderNo:{
      label: "订单号",
      prop: "orderNo",
      type: "input",
      rules: [{
        required: true,
        message: "请填写订单号",
        trigger: "blur"
      }]
    },
    createUser:{
      label: "创建人",
      prop: "createUser",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    createDept:{
      label: "创建部门",
      prop: "createDept",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    createTime:{
      label: "创建时间",
      prop: "createTime",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
    },
    updateUser:{
      label: "修改人",
      prop: "updateUser",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    updateTime:{
      label: "修改时间",
      prop: "updateTime",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    status:{
      label: "状态",
      prop: "status",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    isDeleted:{
      label: "是否已删除",
      prop: "isDeleted",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    }, details:{
      labelWidth: 0,
      label: '',
      prop: 'details',
      span: 24,
      hide: true
    }
  }
}
