列表内高频操作直达-初稿(ID问题未解决)

This commit is contained in:
Cheng Zhou
2025-12-17 23:16:46 +08:00
parent ad4fa6ae7a
commit 7d2ae5658d
2840 changed files with 592 additions and 2020 deletions
+7 -5
View File
@@ -21,8 +21,8 @@ const PERMISSIONS: Record<string, string[]> = {
"faq.edit": ["ADMIN", "PM"],
"dataquery.edit": ["ADMIN", "PM", "CRA"],
"project.members.manage": ["ADMIN", "PM"],
"site.manage": ["ADMIN"],
"site.cra.bind": ["ADMIN"],
"site.manage": ["ADMIN", "PM"],
"site.cra.bind": ["ADMIN", "PM"],
};
const REASONS: Record<string, string> = {
@@ -39,8 +39,8 @@ const REASONS: Record<string, string> = {
"faq.edit": "仅 PM/ADMIN 可维护 FAQ",
"dataquery.edit": "仅 PM/CRA/ADMIN 可编辑数据问题",
"project.members.manage": "仅 ADMIN / PM 可调整项目成员",
"site.manage": "仅 ADMIN 可管理中心",
"site.cra.bind": "仅 ADMIN 可绑定 CRA",
"site.manage": "仅 ADMIN / PM 可管理中心",
"site.cra.bind": "仅 ADMIN / PM 可绑定 CRA",
};
export const usePermission = () => {
@@ -48,7 +48,9 @@ export const usePermission = () => {
const study = useStudyStore();
const userRole = computed(() => auth.user?.role || null);
const projectRole = computed(() => study.currentStudyRole || (study.currentStudy as any)?.role_in_study || null);
const projectRole = computed(
() => study.currentStudyRole || (study.currentStudy as any)?.role_in_study || auth.user?.role || null
);
const can = (action: string): boolean => {
if (userRole.value === "ADMIN") return true;