管道基础大数据平台系统开发-【前端】-新系統界面
1
Surpriseplus
2023-02-01 dda0e6f581e8c2b116f2eae53756d80215d6e5e0
src/views/userManage/orgManage.vue
@@ -30,35 +30,35 @@
          </el-breadcrumb>
          <div>
            <el-button
            <el-button   v-if="menuStatus.update"
              :disabled="itemdetail.pid == null ? true : false"
              @click="setEditNode(1)"
              type="info"
              icon="el-icon-top"
              size="small"
            >向上移动</el-button>
            <el-button
            <el-button   v-if="menuStatus.update"
              :disabled="itemdetail.pid == null ? true : false"
              @click="setEditNode(2)"
              type="info"
              icon="el-icon-bottom"
              size="small"
            >向下移动</el-button>
            <el-button
            <el-button   v-if="menuStatus.insert"
              :disabled="itemdetail.pid == null ? true : false"
              @click="setNewNode(1)"
              type="success"
              icon="el-icon-plus"
              size="small"
            >新增同级</el-button>
            <el-button
            <el-button   v-if="menuStatus.insert"
              :disabled="itemdetail.pid == null ? true : false"
              @click="setNewNode(2)"
              type="success"
              icon="el-icon-plus"
              size="small"
            >新增子级</el-button>
            <el-button
            <el-button  v-if="menuStatus.delete"
              @click="setDelNode()"
              :disabled="itemdetail.pid == null ? true : false"
              type="danger"
@@ -339,6 +339,7 @@
  queryMaxId,
  insertDep,
  deleteDep,
  getPerms
} from '../../api/api';
export default {
  //import引入的组件需要注入到对象中才能使用
@@ -794,18 +795,37 @@
          break;
      }
    },
      getPerms() {
      var val = this.$store.state.currentPerms;
      var permsEntity = this.$store.state.permsEntity;
      if (permsEntity.length == 0) {
        getPerms().then((res) => {
          if (res.code == 200) {
            permsEntity = res.result;
          }
        });
      }
      for (var i = 0; i < permsEntity.length; i++) {
        if (permsEntity[i].perms == val) {
          console.log(permsEntity[i])
          this.showPermsMenu(permsEntity[i]);
        }
      }
    },
  },
  mounted() {
    this.getMenuTree();
        this.getPerms();
  },
  created() {
    var val = this.$store.state.currentPerms;
    var permsEntity = this.$store.state.permsEntity;
    for (var i = 0; i < permsEntity.length; i++) {
      if (permsEntity[i].perms == val) {
        this.showPermsMenu(permsEntity[i]);
      }
    }
    // var val = this.$store.state.currentPerms;
    // var permsEntity = this.$store.state.permsEntity;
    // for (var i = 0; i < permsEntity.length; i++) {
    //   if (permsEntity[i].perms == val) {
    //     this.showPermsMenu(permsEntity[i]);
    //   }
    // }
  },
};
</script>