月球大数据地理空间分析展示平台-【中台】
Surpriseplus
2023-08-16 87572c2af4c6b927b55cd9efda438087d36d0f3d
src/views/AuthorizationManagement/roleResAuthorization.vue
@@ -206,9 +206,7 @@
import {
  queryDepTree,
  select_Role_ByPageAndCount,
  roleResInserts,
  roleLayer_selectResByRole,
  roleLayer_inserts,
  roleLayer_deletes
@@ -310,9 +308,7 @@
      if (std.length == 0) {
        return
      }
      const data = await roleLayer_inserts(std);
      if (data.code != 200) {
        this.$message.error('授权失败');
      } else {
@@ -441,6 +437,11 @@
      return cloneData.filter((father) => {
        // 循环所有项
        let branchArr = cloneData.filter((child) => father.layerid == child.pid); // 对比ID,分别上下级菜单,并返回数据
        branchArr.sort(function (a, b) {
          return a.orderNum - b.orderNum
        })
        branchArr.length > 0 ? (father.children = branchArr) : ""; // 给父级添加一个children属性,并赋值
        // 属于同一对象问题,例如:令 a=b、c=1 ,然后再令 b.c=c , 那么 a.c=b.c=c=1 ;同理,后续令 c.d=2 ,那么 a.c.d 也是=2;
        // 由此循环多次后,就能形成相应的树形数据结构
@@ -512,7 +513,6 @@
    async getuserList() {
      this.Layertree = [];
      this.layeroption = [];
      const data = await roleLayer_selectResByRole({ roleid: this.userlistData.roleid });
      if (data.code !== 200) {
        return this.$message.error('根据ID查询资源失败');
@@ -525,8 +525,9 @@
        }
      }
      var val = this.setTreeData(data.result);
      val.sort(function (a, b) {
        return a.orderNum - b.orderNum
      })
      this.Layertree = val
      this.$refs.layerFrom.setCheckedKeys(std);
    },