Merge branch 'main' into safetywarning-ui

This commit is contained in:
bonus 2024-11-20 13:21:29 +08:00
commit d83d8af18e
2 changed files with 11 additions and 2 deletions

BIN
dist.zip Normal file

Binary file not shown.

View File

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