From 00e0dbbf98347b1e47a7e0aedd41baa61f7567ed Mon Sep 17 00:00:00 2001
From: fuyongxin <110568259@qq.com>
Date: Wed, 03 Jun 2026 08:47:03 +0800
Subject: [PATCH] 修改配置nacos,后端gateway端口

---
 ruoyi-ui/src/views/system/user/authRole.vue |   72 +++++++++++++++++++----------------
 1 files changed, 39 insertions(+), 33 deletions(-)

diff --git a/ruoyi-ui/src/views/system/user/authRole.vue b/ruoyi-ui/src/views/system/user/authRole.vue
index e0cd7bc..de0807d 100644
--- a/ruoyi-ui/src/views/system/user/authRole.vue
+++ b/ruoyi-ui/src/views/system/user/authRole.vue
@@ -9,8 +9,8 @@
           </el-form-item>
         </el-col>
         <el-col :span="8" :offset="2">
-          <el-form-item label="登录账号" prop="phonenumber">
-            <el-input  v-model="form.userName" disabled />
+          <el-form-item label="登录账号" prop="userName">
+            <el-input v-model="form.userName" disabled />
           </el-form-item>
         </el-col>
       </el-row>
@@ -20,10 +20,10 @@
     <el-table v-loading="loading" :row-key="getRowKey" @row-click="clickRow" ref="table" @selection-change="handleSelectionChange" :data="roles.slice((pageNum-1)*pageSize,pageNum*pageSize)">
       <el-table-column label="序号" type="index" align="center">
         <template slot-scope="scope">
-          <span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span>
+          <span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span>
         </template>
       </el-table-column>
-      <el-table-column type="selection" :reserve-selection="true" width="55"></el-table-column>
+      <el-table-column type="selection" :reserve-selection="true" :selectable="checkSelectable" width="55" />
       <el-table-column label="角色编号" align="center" prop="roleId" />
       <el-table-column label="角色名称" align="center" prop="roleName" />
       <el-table-column label="权限字符" align="center" prop="roleKey" />
@@ -33,7 +33,7 @@
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" />
 
     <el-form label-width="100px">
@@ -46,72 +46,78 @@
 </template>
 
 <script>
-import { getAuthRole, updateAuthRole } from "@/api/system/user";
+import { getAuthRole, updateAuthRole } from "@/api/system/user"
 
 export default {
   name: "AuthRole",
   data() {
     return {
-       // 遮罩层
+      // 遮罩层
       loading: true,
       // 分页信息
       total: 0,
       pageNum: 1,
       pageSize: 10,
       // 选中角色编号
-      roleIds:[],
+      roleIds: [],
       // 角色信息
       roles: [],
       // 用户信息
       form: {}
-    };
+    }
   },
   created() {
-    const userId = this.$route.params && this.$route.params.userId;
+    const userId = this.$route.params && this.$route.params.userId
     if (userId) {
-      this.loading = true;
+      this.loading = true
       getAuthRole(userId).then((response) => {
-        this.form = response.user;
-        this.roles = response.roles;
-        this.total = this.roles.length;
+        this.form = response.user
+        this.roles = response.roles
+        this.total = this.roles.length
         this.$nextTick(() => {
           this.roles.forEach((row) => {
             if (row.flag) {
-              this.$refs.table.toggleRowSelection(row);
+              this.$refs.table.toggleRowSelection(row)
             }
-          });
-        });
-        this.loading = false;
-      });
+          })
+        })
+        this.loading = false
+      })
     }
   },
   methods: {
     /** 单击选中行数据 */
     clickRow(row) {
-      this.$refs.table.toggleRowSelection(row);
+      if (this.checkSelectable(row)) {
+        this.$refs.table.toggleRowSelection(row)
+      }
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.roleIds = selection.map((item) => item.roleId);
+      this.roleIds = selection.map((item) => item.roleId)
     },
     // 保存选中的数据编号
     getRowKey(row) {
-      return row.roleId;
+      return row.roleId
+    },
+    // 检查角色状态
+    checkSelectable(row) {
+      return row.status === "0" ? true : false
     },
     /** 提交按钮 */
     submitForm() {
-      const userId = this.form.userId;
-      const roleIds = this.roleIds.join(",");
-      updateAuthRole({ userId: userId, roleIds: roleIds }).then((response) => {
-        this.msgSuccess("授权成功");
-        this.close();
-      });
+      const userId = this.form.userId
+      const roleIds = this.roleIds.join(",")
+      updateAuthRole({ userId: userId, roleIds: roleIds }).then(() => {
+        this.$modal.msgSuccess("授权成功")
+        this.close()
+      })
     },
     /** 关闭按钮 */
     close() {
-      this.$store.dispatch("tagsView/delView", this.$route);
-      this.$router.push({ path: "/system/user" });
-    },
-  },
-};
+      const obj = { path: "/system/user" }
+      this.$tab.closeOpenPage(obj)
+    }
+  }
+}
 </script>
\ No newline at end of file

--
Gitblit v1.9.3