用户,角色超级管理员不可编辑

This commit is contained in:
sjl
2025-05-29 10:49:26 +08:00
parent 81a944062a
commit 15f2c1ee41
2 changed files with 7 additions and 6 deletions

View File

@@ -16,9 +16,9 @@
</template> </template>
<!-- 表格操作 --> <!-- 表格操作 -->
<template #operation='scope'> <template #operation='scope'>
<el-button v-auth.role="'edit'" type='primary' link :icon='EditPen' @click="openDrawer('edit', scope.row)">编辑</el-button> <el-button v-auth.role="'edit'" type='primary' link :icon='EditPen' @click="openDrawer('edit', scope.row)" :disabled="scope.row.code == 'root'">编辑</el-button>
<el-button v-auth.role="'delete'" v-if="scope.row.type !== 0 && scope.row.type !== 1" type='primary' link :icon='Delete' @click='deleteAccount(scope.row)'>删除</el-button> <el-button v-auth.role="'delete'" type='primary' link :icon='Delete' @click='deleteAccount(scope.row)' :disabled="scope.row.code == 'root'">删除</el-button>
<el-button v-auth.role="'SetPermissions'" type='primary' link :icon='Share' @click="openDrawer('设置权限', scope.row)">设置权限</el-button> <el-button v-auth.role="'SetPermissions'" type='primary' link :icon='Share' @click="openDrawer('设置权限', scope.row)" :disabled="scope.row.code == 'root'">设置权限</el-button>
</template> </template>
</ProTable> </ProTable>

View File

@@ -16,9 +16,9 @@
</template> </template>
<!-- 表格操作 --> <!-- 表格操作 -->
<template #operation='scope'> <template #operation='scope'>
<el-button v-auth.user="'edit'" type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button> <el-button v-auth.user="'edit'" type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)" :disabled="scope.row.loginName == 'root'">编辑</el-button>
<el-button v-auth.user="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button> <el-button v-auth.user="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)' :disabled="scope.row.loginName == 'root'">删除</el-button>
<el-button v-auth.user="'editPassWord'" type='primary' link :icon='Delete' @click='EditPassWord(scope.row)'>修改密码</el-button> <el-button v-auth.user="'editPassWord'" type='primary' link :icon='Delete' @click='EditPassWord(scope.row)' :disabled="scope.row.loginName == 'root'">修改密码</el-button>
</template> </template>
</ProTable> </ProTable>
@@ -91,6 +91,7 @@
render: (scope) => { render: (scope) => {
const roleNames = scope.row.roleNames; const roleNames = scope.row.roleNames;
const roleArray = Array.isArray(roleNames) ? roleNames : [roleNames]; const roleArray = Array.isArray(roleNames) ? roleNames : [roleNames];
if (roleArray.length > 1) { if (roleArray.length > 1) {
return roleArray.join(', '); return roleArray.join(', ');
} }