Surpriseplus
2022-10-25 6e0ef2d1f836680e6a55b7fc2d813b759038c144
src/views/AuthorizationManagement/roleMenuAuthorization.vue
@@ -20,7 +20,7 @@
            style="width: 300px"
            v-model="selFrom.name"
            placeholder="请选择单位名称..."
            @change="chooseCustom"
            @change="chooseCustom('multiSelect')"
          >
            <el-option
              :value="selectTree"
@@ -36,6 +36,7 @@
                node-key="id"
                ref="treeForm"
                @node-click="addAdminHandleNodeClick"
                :default-expanded-keys="[1]"
              >
              </el-tree>
            </el-option>
@@ -125,6 +126,7 @@
          node-key="id"
          @check="menuTreeCheck"
          ref="treeForm"
          :default-expanded-keys="[1]"
        >
        </el-tree>
      </div>
@@ -344,6 +346,7 @@
      this.depid = e.id;
      this.selFrom.name = e.name;
      this.selectTree = e.name;
      this.chooseCustom('multiSelect');
      this.getRoleDep();
      this.getMenuTree();
    },
@@ -353,6 +356,10 @@
        this.menuid = node.id;
        this.rolMenuListData.roleid = this.roleid;
        this.getRoleMenu();
        if (list.checkedKeys.length == 2) {
          //单选实现
          this.$refs.treeForm.setCheckedKeys([node.id]);
        }
      } else {
        this.menuid = null;
      }
@@ -392,10 +399,20 @@
      );
    },
    //下拉框选中后自动关闭
    chooseCustom() {
      setTimeout(() => {
        this.$refs.multiSelect.blur();
    chooseCustom(refName) {
      // this.$refs[refName] && this.$refs[refName].blur();
      this.createTimer(this.autoCloseSelect, refName);
    },
    createTimer(callback, refName) {
      const timer = setTimeout(() => {
        callback(refName);
      }, 50);
      this.$once('hook:beforeDestroy', () => {
        clearInterval(timer);
      });
    },
    autoCloseSelect(refName) {
      this.$refs[refName] && this.$refs[refName].blur();
    },
    dephandleSizeChange() {
      this.roleDepListData.pageSize = val;