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:true,
  delBtn:true,
  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: "所属客户",
        prop: "clientId",
        type: "input",
        search: true,
        type: "tree",
        dicUrl: "/api/pl-client/client/select?factoryId={{factoryId}}",
        props: {
          label: "name",
          value: "id",
        },
      },
    {
      label: "产品名称",
      prop: "goodsName",
      type: "input",
      search: true,
      rules: [{
        required: true,
        message: "请输入产品名称",
        trigger: "blur"
      }],
    },
    {
      label: "产品主条码",
      prop: "goodsCode",
      type: "input",
      search: true,
      rules: [{
        required: true,
        message: "请输入产品条码",
        trigger: "blur"
      }],
    },
    {
      label: "型号",
      prop: "goodsModel",
      type: "input",
      search: true,
      rules: [{
        required: true,
        message: "请输入型号",
        trigger: "blur"
      }],
    },
    {
      label: "重量/Kg",
      prop: "weight",
      type: "number",
      rules: [{
        required: true,
        message: "请输入重量",
        trigger: "blur"
      }],
    },
    {
      label: "规格",
      prop: "specification",
      type: "input",
      rules: [{
        required: true,
        message: "请输入规格",
        trigger: "blur"
      }],
    },
    // {
    //   label: "客户地",
    //   prop: "customerAddress",
    //   type: "input",
    //   rules: [{
    //     required: true,
    //     message: "请输入客户地",
    //     trigger: "blur"
    //   }],
    // },
    {
      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",
      type: "date",
      format: "YYYY-MM-DD HH:mm:ss",
      valueFormat: "YYYY-MM-DD HH:mm:ss",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
    },
    {
      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: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
    {
      label: "是否已删除",
      prop: "isDeleted",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true,
    },
     {
      labelWidth: 0,
      label: '',
      prop: 'details',
      span: 24,
      hide: true
    }
  ]
}
