qinxianzhangyao
2023-12-14 a7c90f4a5ed7619a6682f22665338acfed22564e
src/views/system/user/index.vue
@@ -9,7 +9,7 @@
        </div>
        <div class="head-container">
          <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false"
            :filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all highlight-current
            :filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all  :default-expanded-keys="treeId" highlight-current
            @node-click="handleNodeClick" />
        </div>
      </el-col>
@@ -739,6 +739,7 @@
      userInfoList: [],
      hospList: [],
      activeNames: ["1"],
      treeId: [],
      // 遮罩层
      loading: true,
      // 选中数组
@@ -893,6 +894,15 @@
    deptName(val) {
      this.$refs.tree.filter(val);
    },
    treeId(newVal, oldVal) {
      if (newVal) {
        this.$nextTick(() => {
          document
            .querySelector('.el-tree-node__children .el-tree-node__content')
            .click();
        });
      }
    }
  },
  computed: {
    type() {
@@ -903,8 +913,9 @@
    }
  },
  created() {
    this.getList();
    this.getDeptTree();
    this.getList();
    // this.getRoleList();
    // this.getConfigKey("sys.user.initPassword").then((response) => {
    //   this.initPassword = response.msg;
@@ -960,6 +971,8 @@
    getDeptTree() {
      deptTreeSelect().then((response) => {
        this.deptOptions = response.data;
        this.treeId.push(this.deptOptions[0].id)
        this.queryParams.deptId = this.deptOptions[0].id
      });
    },
    // 筛选节点