fix: sync G01 role shortcuts

This commit is contained in:
rain
2026-07-21 13:06:36 +08:00
parent 8468cc0f89
commit 668b4ef55f
4 changed files with 212 additions and 2 deletions
+13 -2
View File
@@ -82,14 +82,14 @@
src="/static/assets/foundation/transparent/meta-admin.png"
mode="aspectFit"
/>
<text class="current-meta-item-text">管理员</text>
<text class="current-meta-item-text">{{ currentRoleLabel }}</text>
</view>
</view>
</view>
<view class="shortcut-grid">
<view
v-for="item in shortcuts"
v-for="item in visibleShortcuts"
:key="item.key"
class="shortcut-item"
@click="openShortcut(item.key)"
@@ -420,6 +420,12 @@ const currentGenealogy = computed(
(item) => item.id === selectedGenealogyId.value,
) || availableGenealogies.value[0],
);
const isCurrentGenealogyOwner = computed(
() => currentGenealogy.value?.membership === "created",
);
const currentRoleLabel = computed(() =>
isCurrentGenealogyOwner.value ? "管理员" : "成员",
);
// 仅用于页面样式阶段覆盖加入申请的关键状态,不作为接口数据。
const applicationRecords = [
@@ -468,6 +474,11 @@ const shortcuts = [
icon: "/static/assets/modules/genealogy/transparent/shortcut-application.png",
},
];
const visibleShortcuts = computed(() =>
isCurrentGenealogyOwner.value
? shortcuts
: shortcuts.filter((item) => item.key !== "applications"),
);
const openGenealogy = (genealogy) => {
genealogyContext.setCurrentGenealogyId(genealogy.id);