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,
  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':''],
      dicUrl: "/api/pl-factory/factory/select",
      props: {
        label: "name",
        value: "id",
      },
    },
    {
      label: "编号",
      prop: "code",
      type: "input",
      search: true,
      rules: [
        {
          required: true,
          message: '请填写编号',
          trigger: 'click',
        },
      ],
    },
    {
      label: "工序",
      prop: "processIds",
      type: 'select',
      multiple: true,
      dataType:"String",
      dicUrl:"/pl-process/process/select",
      typeformat (item, label, value) {
        return `${item.code}-${item.name}`
      },
      props: {
        label: 'code',
        value: 'id'
      },
      rules: [
        {
          required: true,
          message: '请选择工序',
          trigger: 'click',
        },
      ],
      hide: true,
    },
    {
      label: "工序名称s",
      prop: "processNames",
      type: "input",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      search: true,
    },
    {
      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: "input",
      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,
    },
    {
      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,
    },
  ]
}
