deason 4 سال پیش
والد
کامیت
83741f53a0
1فایلهای تغییر یافته به همراه19 افزوده شده و 2 حذف شده
  1. 19 2
      src/modules/basic/view/user.vue

+ 19 - 2
src/modules/basic/view/user.vue

@@ -453,7 +453,7 @@
                 <el-dropdown-menu slot="dropdown">
                   <el-dropdown-item>
                     <el-button
-                      v-if="rolePrivileges.user_data_rule_setting"
+                      v-if="showUserDataRuleSetting(scope.row)"
                       size="mini"
                       type="primary"
                       plain
@@ -796,7 +796,7 @@ export default {
       this.$httpWithMsg
         .get(url)
         .then(response => {
-          console.log(response);
+          // console.log(response);
           this.tableData = response.data.list;
           this.total = response.data.total;
           this.loading = false;
@@ -1080,6 +1080,23 @@ export default {
       this.$httpWithMsg.post(url).then(response => {
         this.rolePrivileges = response.data;
       });
+    },
+    showUserDataRuleSetting(row) {
+      if (!this.rolePrivileges.user_data_rule_setting) {
+        return false;
+      }
+
+      let roleCodes = row.roleCodes;
+      // console.log(JSON.stringify(roleCodes));
+
+      for (let n = 0; n < roleCodes.length; n++) {
+        let roleCode = roleCodes[n];
+        if (roleCode == "SUPER_ADMIN" || roleCode == "DATA_ADMIN") {
+          return false;
+        }
+      }
+
+      return true;
     }
   },
   //初始化查询