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

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
+4 -2
View File
@@ -115,8 +115,8 @@ import KpiCard from "../components/KpiCard.vue";
import QuickActions from "../components/QuickActions.vue";
import { List, Warning, Money } from "@element-plus/icons-vue";
import StateEmpty from "../components/StateEmpty.vue";
import { displayEnum } from "../utils/display";
import { getProjectRole, isSystemAdmin } from "../utils/roles";
import { useRoleTemplateMeta } from "../composables/useRoleTemplateMeta";
import { TEXT } from "../locales";
import type { NotificationItem } from "../types/notifications";
import { useRouter } from "vue-router";
@@ -124,6 +124,7 @@ import { useRouter } from "vue-router";
const auth = useAuthStore();
const study = useStudyStore();
const router = useRouter();
const { roleLabel: displayRoleLabel, loadRoleTemplates } = useRoleTemplateMeta();
const progress = ref<any>(null);
const financeSummary = ref<any>(null);
@@ -148,7 +149,7 @@ const projectRole = computed(() => {
if (isSystemAdmin(auth.user)) return "ADMIN";
return getProjectRole(study.currentStudy, study.currentStudyRole);
});
const roleLabel = computed(() => displayEnum(TEXT.enums.userRole, projectRole.value));
const roleLabel = computed(() => displayRoleLabel(projectRole.value));
const formatAmount = (val: number) => {
return new Intl.NumberFormat('zh-CN', { minimumFractionDigits: 2 }).format(val);
@@ -199,6 +200,7 @@ const openDocument = (documentId: string) => {
};
onMounted(() => {
loadRoleTemplates();
loadData();
});