吴羡
19 小时以前 a52ac50ffc5f3b369eb689dd734bfb8a4bb988a4
src/views/CNAS/resourceDemand/device/component/deviceOverview.vue
@@ -116,6 +116,7 @@
      entity: {
        deviceStatus: null,
        deviceName: null,
        largeCategory: null,
      },
      options: [],
      list: [],
@@ -125,7 +126,6 @@
      loading: true, // 组件loading的展示,默认为true
      finishLoding: false, // 加载完成,显示已经没有更多了
      keyMap: {},
      laboratoryNameIsNull: false,
      importVisible: false,
      importing: false,
      importFiles: [],
@@ -206,7 +206,6 @@
        this.finishLoding = false;
      }
      selectDeviceParameter({
        laboratoryNameIsNull: this.laboratoryNameIsNull,
        current: this.currentPage,
        size: this.pageSize,
        ...this.entity
@@ -263,6 +262,7 @@
      this.entity = {
        deviceStatus: null,
        deviceName: null,
        largeCategory: null,
      };
      this.refreshTable()
    },
@@ -275,33 +275,14 @@
    },
    // 点击侧边栏刷新
    clickSidebar(clickNodeVal) {
      this.laboratoryNameIsNull = false
      // 是否存在value,存在value代表为三级
      // 存在value代表选中了设备,由设备详情展示处理
      if (!clickNodeVal.value) {
        this.finishLoding = false;
        this.keyMap = {};
        this.currentPage = 1;
        this.list = [];
        this.entity.laboratoryName = null
        this.entity.storagePoint = null
        // 等于1代表为树的一级,label为部门
        if (clickNodeVal.label == '其他') {
          this.laboratoryNameIsNull = true
          this.refreshTable();
          return
        }
        if (clickNodeVal.level == 1) {
          this.entity.laboratoryName = clickNodeVal.label
          // 等于二级。label为存储地点
        } else if (clickNodeVal.level == 2) {
          // 其他表示没有配置实验室,只配置了地点
          if (clickNodeVal.parent.label == '其他') {
            this.laboratoryNameIsNull = true
          } else {
            this.entity.laboratoryName = clickNodeVal.parent.label
          }
          this.entity.storagePoint = clickNodeVal.label
        }
        // 树的一级为分类:全部/设备/计量器具
        this.entity.largeCategory = clickNodeVal.label === '全部' ? null : clickNodeVal.label;
        this.refreshTable();
      }
    }