Просмотр исходного кода

系统管理里的积分权限

caojunjie 2 лет назад
Родитель
Сommit
de78f7cef1
2 измененных файлов с 47 добавлено и 17 удалено
  1. 20 11
      src/views/system/dept.vue
  2. 27 6
      src/views/system/user.vue

+ 20 - 11
src/views/system/dept.vue

@@ -202,17 +202,26 @@
           let arr = localStorage.getItem('roleName').split(',')
           // 根据 租户好判断是否要显示 积分余额
           const content = JSON.parse(localStorage.getItem('saber-tenantId')).content
-          if (content == 171757) {
-              this.$nextTick(()=>{
-                  if (arr.indexOf('admin') != -1) {
-                      this.findObject(this.option.column, "pointsBalance").disabled = false
-                  }
-                  this.findObject(this.option.column, "pointsBalance").hide = false
-                  this.findObject(this.option.column, "pointsBalance").addDisplay = true
-                  this.findObject(this.option.column, "pointsBalance").editDisplay = true
-                  this.findObject(this.option.column, "pointsBalance").viewDisplay = true
-              })
-          }
+          this.$nextTick(()=>{
+              if (arr.indexOf('admin') != -1) {
+                  this.findObject(this.option.column, "pointsBalance").disabled = false
+              }
+              this.findObject(this.option.column, "pointsBalance").hide = false
+              this.findObject(this.option.column, "pointsBalance").addDisplay = true
+              this.findObject(this.option.column, "pointsBalance").editDisplay = true
+              this.findObject(this.option.column, "pointsBalance").viewDisplay = true
+          })
+          // if (content == 171757) {
+          //     this.$nextTick(()=>{
+          //         if (arr.indexOf('admin') != -1) {
+          //             this.findObject(this.option.column, "pointsBalance").disabled = false
+          //         }
+          //         this.findObject(this.option.column, "pointsBalance").hide = false
+          //         this.findObject(this.option.column, "pointsBalance").addDisplay = true
+          //         this.findObject(this.option.column, "pointsBalance").editDisplay = true
+          //         this.findObject(this.option.column, "pointsBalance").viewDisplay = true
+          //     })
+          // }
       },
       computed: {
       ...mapGetters(["userInfo", "permission"]),

+ 27 - 6
src/views/system/user.vue

@@ -755,12 +755,33 @@
     },
       created() {
         // 根据 租户好判断是否要显示 积分余额
-          const content = JSON.parse(localStorage.getItem('saber-tenantId')).content
-          if (content == 171757) {
-              this.$nextTick(()=>{
-                  this.refsDisplay()
-              })
-          }
+        //   const content = JSON.parse(localStorage.getItem('saber-tenantId')).content
+        //   if (content == 171757) {
+        //       this.$nextTick(()=>{
+        //           this.refsDisplay()
+        //       })
+        //   }
+          let arr = localStorage.getItem('roleName').split(',')
+          this.$nextTick(()=>{
+              // 循环这个 实例
+              for(let item of this.$refs.crud.option.group) {
+                  // 判断是不是详细详细里的
+                  if (item.prop == "detailInfo") {
+                      for (let ite of item.column) {
+                          // 判断是不是积分余额
+                          if (ite.prop == "pointsBalance") {
+                              // 判断是否是admin 权限
+                              if (arr.indexOf('admin') != -1) {
+                                  ite.disabled = false
+                              }
+                              ite.addDisplay = true
+                              ite.editDisplay = true
+                              ite.viewDisplay = true
+                          }
+                      }
+                  }
+              }
+          })
       },
       mounted() {
       // 非租户模式默认加载管理组数据