fix: 管理配方tab所有人可见,未登录时显示登录引导
All checks were successful
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 22s
Test / e2e-test (push) Successful in 51s
All checks were successful
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 22s
Test / e2e-test (push) Successful in 51s
撤回之前的editor-only限制,改为tab可见但页面内容需登录。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -78,7 +78,7 @@ const navTabsRef = ref(null)
|
||||
// hide: 完全隐藏(只有满足条件才显示)
|
||||
const allTabs = [
|
||||
{ key: 'search', icon: '🔍', label: '配方查询' },
|
||||
{ key: 'manage', icon: '📋', label: '管理配方', hide: 'editor' },
|
||||
{ key: 'manage', icon: '📋', label: '管理配方', require: 'login' },
|
||||
{ key: 'inventory', icon: '📦', label: '个人库存', require: 'login' },
|
||||
{ key: 'oils', icon: '💧', label: '精油价目' },
|
||||
{ key: 'projects', icon: '💼', label: '商业核算', require: 'login' },
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<template>
|
||||
<div class="recipe-manager">
|
||||
<!-- Login prompt for non-logged-in users -->
|
||||
<div v-if="!auth.isLoggedIn" class="login-prompt">
|
||||
<p>登录后可管理配方、创建个人配方集</p>
|
||||
<button class="btn-primary" @click="ui.openLogin()">登录 / 注册</button>
|
||||
</div>
|
||||
<template v-else>
|
||||
<!-- Review Bar (admin + senior_editor with assigned reviews) -->
|
||||
<div v-if="(auth.isAdmin || auth.canManage) && pendingCount > 0" class="review-bar" @click="showPending = !showPending" >
|
||||
📝 待审核配方: {{ pendingCount }} 条
|
||||
@@ -388,6 +394,7 @@
|
||||
@save="onTagPickerSave"
|
||||
@close="showTagPicker = false"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1672,6 +1679,11 @@ watch(() => recipeStore.recipes, () => {
|
||||
padding: 0 12px 24px;
|
||||
}
|
||||
|
||||
.login-prompt {
|
||||
text-align: center; padding: 60px 20px; color: #6b6375;
|
||||
}
|
||||
.login-prompt p { margin-bottom: 16px; font-size: 15px; }
|
||||
|
||||
.review-bar {
|
||||
background: linear-gradient(135deg, #fff3e0, #ffe0b2);
|
||||
padding: 12px 16px;
|
||||
|
||||
Reference in New Issue
Block a user