diff --git a/src/App.vue b/src/App.vue index 6975327..956cbab 100644 --- a/src/App.vue +++ b/src/App.vue @@ -99,8 +99,8 @@ const { preference, theme, overrides } = useTheme() const projectId = computed(() => String(route.params.projectId || '')) const projectAccess = shallowRef(null) provide(projectAccessKey, projectAccess) -const workflowsUnlocked = computed( - () => projectAccess.value?.projectId === projectId.value && projectAccess.value.completed +const currentProjectAccess = computed(() => + projectAccess.value?.projectId === projectId.value ? projectAccess.value : null ) const apiBase = import.meta.env.VITE_API_BASE_URL || '/api' const workflowItems = [ @@ -135,7 +135,8 @@ const menuOptions = computed(() => { ? [ { type: 'divider' as const, key: 'divider' }, ...workflowItems.map(([path, label, icon]) => { - const disabled = path !== 'create-drama' && !workflowsUnlocked.value + const sectionAccess = currentProjectAccess.value?.sections[path] + const disabled = sectionAccess ? !sectionAccess.enabled : path !== 'create-drama' const target = '/projects/' + projectId.value + '/' + path return { key: target, @@ -144,7 +145,7 @@ const menuOptions = computed(() => { disabled ? h( 'span', - { class: 'admin-menu-label', title: '剧本完成后可用', 'aria-disabled': 'true' }, + { class: 'admin-menu-label', title: sectionAccess?.reason || '请先完成前面的制作步骤', 'aria-disabled': 'true' }, label ) : h(RouterLink, { to: target }, () => @@ -229,11 +230,11 @@ const menuOptions = computed(() => { block class="admin-settings-button" :class="{ 'is-collapsed': collapsed }" - aria-label="后端连接" + aria-label="连接设置" @click="openSettings" > - 后端连接 + 连接设置 @@ -261,7 +262,7 @@ const menuOptions = computed(() => {
- +
API 地址