import { setStore, getStore } from '@/utils/store';
export default {
  height:'auto',
  calcHeight: 30,
  tip: false,
  searchShow: true,
  searchMenuSpan: 6,
  searchLabelWidth:100,
  labelWidth:120,
  border: true,
  index: true,
  viewBtn: true,
  selection: true,
  dialogClickModal: false,
  columnBtn:false,
  editBtn:false,
  addBtn:false,
  delBtn:false,
  column: [
    {
      label: "主键",
      prop: "id",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    {
      label: "租户ID",
      prop: "tenantId",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    {
      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"
      }]
    },
    {
      label: "设备id",
      prop: "equipmentId",
      type: "select",
      search: false,
      hide: true,
    },
    {
      label: "设备序列号",
      prop: "eqSn",
      type: "input",
    },
    {
      label: "商品id",
      prop: "goodsId",
      type: "input",
      hide: true,
    },
    {
      label: "商品名称",
      prop: "goodsName",
      type: "input",
      search: true,
    },
    {
      label: "产品主条码",
      prop: "goodsCode",
      type: "input",
      search: true,
    },
    {
      label: "产品图片",
      prop: "goodsImage",
      type: 'upload',
      listType: 'picture-img',
      dataType:"String",
    },
    {
      label: "ocr识别内容",
      prop: "ocrDetails",
      type: "input",
      hide: true,
    },
    {
      label: "ocr已匹配物料",
      prop: "ocrSuccess",
      type: "input",
    },
    {
      label: "ocr未匹配物料",
      prop: "ocrFail",
      type: "input",
    },
    {
      label: "识别结果",
      prop: "ocrResult",
      type: "input",
    },
    {
      label: "创建人",
      prop: "createUser",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    {
      label: "创建部门",
      prop: "createDept",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    {
      label: "创建时间",
      prop: "createTime",
      dataType:'string',
      addDisplay: false,
      editDisplay: false,
    },
    {
      label: "创建时间",
      prop: "createTimeArr",
      searchType: "daterange",
      format: "YYYY-MM-DD",
      valueFormat: "YYYY-MM-DD",
      dataType:'string',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      search: true,
      rules: [{
        required: true,
        message: "请输入创建时间",
        trigger: "blur"
      }],
      hide:true
    },
    {
      label: "修改人",
      prop: "updateUser",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    {
      label: "修改时间",
      prop: "updateTime",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    {
      label: "状态",
      prop: "status",
      type: "select",
      addDisplay: false,
      editDisplay: false,
      dicData: [{
        label: '成功',
        value: 1
      }, {
        label: '失败',
        value: 2
      }, {
        label: '修正成功',
        value: 3
      }],
      search: true,
    },
    {
      label: "是否已删除",
      prop: "isDeleted",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    {
     labelWidth: 0,
     label: '',
     prop: 'details',
     span: 24,
     hide: true
   }
  ]
}
