This commit is contained in:
bonus 2024-11-20 13:09:06 +08:00
commit cb0e01e961
1 changed files with 11 additions and 2 deletions

View File

@ -127,7 +127,7 @@
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
<template slot-scope="scope" v-if="scope.row.userId !== 1 && scope.row.isBuiltIn !== '0'">
<template slot-scope="scope" v-if="!hasSystemOrAuditrRole(scope.row.roles) && scope.row.userId !== 1 && scope.row.isBuiltIn !== '0'">
<el-button size="mini" type="text" icon="el-icon-edit" @click="confirmPassword(scope.row)"
v-hasPermi="['system:user:edit']"
>修改
@ -788,15 +788,24 @@ export default {
submitFileForm() {
this.$refs.upload.submit()
},
hasSystemOrAuditrRole(roles) {
if (!roles || !Array.isArray(roles)) {
return false; // roles false
}
return roles.some(role => role.roleKey === 'systemAdmin' || role.roleKey === 'audit'); // roleKey admin
},
//
checkSelectable(row) {
return !(row.userId === 1 || row.isBuiltIn === '0');
return !(row.userId === 1 || row.isBuiltIn === '0' || this.hasSystemOrAuditrRole(row.roles));
},
getRowClassName(row) {
return !this.checkSelectable(row) ? 'disabled-row' : '';
},
}
}
</script>