统一项目角色展示与预设文案

This commit is contained in:
Cheng Zhou
2026-05-26 14:46:01 +08:00
parent 3c168565ce
commit 41bd423be0
25 changed files with 384 additions and 122 deletions
@@ -55,7 +55,7 @@
<el-table-column
v-for="role in roles"
:key="role"
:label="role"
:label="roleLabel(role)"
:width="90"
align="center"
>
@@ -81,6 +81,7 @@ import { fetchApiOperations } from "@/api/projectPermissions";
import { isApiPermissionAllowed } from "@/utils/apiPermissionValue";
import { useAuthStore } from "@/store/auth";
import { isSystemAdmin } from "@/utils/roles";
import { useRoleTemplateMeta } from "@/composables/useRoleTemplateMeta";
interface Operation {
operation_key: string;
@@ -103,6 +104,7 @@ const props = defineProps<Props>();
const emit = defineEmits<Emits>();
const auth = useAuthStore();
const { roleLabel, loadRoleTemplates } = useRoleTemplateMeta();
const isAdmin = computed(() => isSystemAdmin(auth.user));
const isRoleEditable = (role: string) => {
if (role === "ADMIN") return false;
@@ -267,6 +269,7 @@ const onPermissionChange = (operation_key: string, role: string, allowed: boolea
onMounted(() => {
loadOperations();
loadRoleTemplates();
});
defineExpose({ searchText });