feat: 工作台外壳收尾 + 冻结旧导航 + 任务延迟创建与最近任务行菜单

外壳收尾
- 后端:内置「通用智能助手」(specialist.state = system)—— 它是任务的默认归属,
  不是可安装的专员,常规列表一律挡掉,只有显式带 state=system 才查得到
- config/nav.js:一级导航、二级 tab、搜索面板共用一份配置,替代原先散在 layout/ 与
  config/workbench.js 里的两套,旧的那批导航导出随之下架
- NavSearch.vue / SectionTabs.vue 组件化;考试 8 个页面收进 ExamTabsView 统一外壳
- 新增 /apps 专员选择页(SpecialistPickerPage.vue)
- ChatInputBar 重构:输入框的 + 拆为独立组件 PlusMenu.vue,新增 update:mode 事件
- 删除 LibraryTabs.vue(已被 SectionTabs 取代)

冻结旧导航(新增 frontend/src/_frozen/ + FROZEN.md 登记表)
- 工作区胶囊条连通知铃铛一起冻:外壳重构后成了冗余的第二套导航。不删代码,
  抽成自包含的 WorkspaceTabs.frozen.vue 归档,将来能原样放回
- 同源孤儿一并收拢:旧 SideNav / SectionTabs / navigation.js / Notification.vue
- 统一加 .frozen 后缀,登记表逐条写明原位置 / 冻结原因 / 外部依赖 / 解冻条件 / 解冻步骤
- 已验:冻结物不进构建产物(dist 里搜不到 wb-tabs),src/ 下无代码引用,
  只有 MainLayout 里指向 FROZEN.md 的指引注释
- 后端通知四接口与 store/api 层保留(BusinessAppPage 仍在用),解冻是纯前端工作量

我的任务
- 任务记录延迟到发出第一条消息时创建:新建任务只回到开场画布,不落库,
  标题取第一句话,专员取输入框 + 里先选的那个(pendingSpecialistKey 暂存,
  建任务时一并提交)。原实现点一次落一条「新任务」,是「最近任务」堆满空行的根因
- 最近任务行菜单:重命名(就地编辑,回车提交 / Esc 取消)、置顶、删除
  (硬删无回收站,确认框写明无法恢复)。新增 worker_task.pinned 字段、
  DELETE /api/worker/my-tasks/:id,列表排序改为 pinned DESC, updated_at DESC;
  el-dropdown 加 :persistent="false"(默认每行留一份隐藏菜单在 DOM 里)
- 对照 ChatGPT / WorkBuddy 后决定不做:分享任务(纯内网)、打开文件夹(Web 无此能力)、
  保存到工作空间(无 workspace 概念)、归档(没有「已归档」入口可找回)
- 当前任务高亮改用 WorkBuddy 绿;空列表给出「发送第一条消息后出现在这里」提示
- PROJECT_STATE.md 补记 D21(冻结机制)/ D22(延迟建任务)/ D23(行菜单)

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
eaiadmin
2026-09-14 16:19:18 +08:00
co-authored by Claude Code
parent 5c3d5987d9
commit f197dbd206
46 changed files with 3884 additions and 1377 deletions
File diff suppressed because it is too large Load Diff
@@ -1,119 +0,0 @@
<template>
<div v-if="section" class="section-tabs">
<div class="section-tabs-inner">
<el-tabs
:model-value="activeTabPath"
class="tabs-nav"
@tab-change="handleTabChange"
>
<el-tab-pane
v-for="tab in section.tabs"
:key="tab.path"
:name="tab.path"
>
<template #label>
<span class="tab-label">
<span>{{ tab.label }}</span>
<el-badge
v-if="tab.path === '/notifications' && unread > 0"
:value="unread"
:max="99"
class="tab-badge"
/>
</span>
</template>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script setup>
import { computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useAuthStore } from '@/store/auth'
import { useNotificationStore } from '@/store/notification'
import { resolveSection, resolveTab } from '@/config/navigation'
const route = useRoute()
const router = useRouter()
const auth = useAuthStore()
const notif = useNotificationStore()
const section = computed(() => resolveSection(route.path, auth.isAdmin))
const activeTabPath = computed(() => resolveTab(route.path, auth.isAdmin)?.path || '')
const unread = computed(() => notif.unread)
function handleTabChange(path) {
if (typeof path === 'string' && path && path !== route.path) {
router.push(path)
}
}
</script>
<style scoped>
.section-tabs {
padding: 0 24px;
background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
border-bottom: 1px solid var(--surface-border);
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}
.section-tabs-inner {
min-height: var(--top-rail-height);
display: flex;
align-items: flex-end;
}
.tabs-nav :deep(.el-tabs__header) {
margin: 0;
}
.tabs-nav {
min-width: 0;
}
.tabs-nav :deep(.el-tabs__nav) {
gap: 6px;
}
.tabs-nav :deep(.el-tabs__nav-wrap) {
padding-top: 0;
}
.tabs-nav :deep(.el-tabs__nav-wrap::after) {
background-color: var(--surface-border);
}
.tabs-nav :deep(.el-tabs__item) {
height: 44px;
line-height: 44px;
color: #606266;
font-size: 14px;
padding: 0 18px;
border-radius: 10px 10px 0 0;
transition: color 0.2s ease, background-color 0.2s ease;
}
.tabs-nav :deep(.el-tabs__item:hover) {
color: var(--surface-text);
background: rgba(64, 158, 255, 0.08);
}
.tabs-nav :deep(.el-tabs__item.is-active) {
color: var(--el-color-primary);
font-weight: 600;
background: linear-gradient(180deg, rgba(64, 158, 255, 0.12) 0%, rgba(64, 158, 255, 0.06) 100%);
}
.tabs-nav :deep(.el-tabs__active-bar) {
height: 3px;
border-radius: 999px;
}
.tab-label {
display: inline-flex;
align-items: center;
gap: 6px;
}
</style>
@@ -1,228 +0,0 @@
<template>
<div class="side-nav">
<!-- 品牌区(左上角) -->
<div class="brand">
<div class="brand-content">
<el-icon class="brand-logo" :size="24"><School /></el-icon>
<div class="brand-text">
<div class="brand-name">EAI 数字员工平台</div>
<div class="brand-sub">AI Agent Platform</div>
<div class="brand-en">eai_agentplatform</div>
</div>
</div>
</div>
<!-- 菜单区 -->
<el-menu
:default-active="activeSectionKey"
:collapse="false"
class="nav-menu"
@select="handleSectionSelect"
>
<el-menu-item v-for="section in commonSections" :key="section.key" :index="section.key">
<el-icon><component :is="iconMap[section.icon]" /></el-icon>
<span>{{ section.label }}</span>
</el-menu-item>
<el-divider v-if="adminSections.length > 0" class="nav-divider" />
<template v-if="adminSections.length > 0">
<el-menu-item v-for="section in adminSections" :key="section.key" :index="section.key">
<el-icon><component :is="iconMap[section.icon]" /></el-icon>
<span>{{ section.label }}</span>
</el-menu-item>
</template>
</el-menu>
<!-- 底部用户信息(左下角) -->
<div class="user-footer">
<el-divider class="footer-divider" />
<div class="user-info">
<el-avatar :size="36" class="user-avatar">{{ avatarText }}</el-avatar>
<div class="user-meta">
<span class="user-name">{{ username }}</span>
<el-tag :type="isAdmin ? 'danger' : 'info'" size="small" effect="plain" round>
{{ isAdmin ? '管理员' : '普通员工' }}
</el-tag>
</div>
</div>
<el-button text type="info" size="small" class="logout-btn" @click="handleLogout">
退出登录
</el-button>
</div>
</div>
</template>
<script setup>
import { computed, onMounted, onBeforeUnmount } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import {
Collection,
EditPen,
HomeFilled,
Reading,
Setting,
UserFilled,
} from '@element-plus/icons-vue'
import { useAuthStore } from '@/store/auth'
import { useNotificationStore } from '@/store/notification'
import { getVisibleSections, resolveSection } from '@/config/navigation'
const route = useRoute()
const router = useRouter()
const auth = useAuthStore()
const notif = useNotificationStore()
const isAdmin = computed(() => auth.isAdmin)
const username = computed(() => auth.username)
const avatarText = computed(() => (username.value || '用').charAt(0))
const unread = computed(() => notif.unread)
const sections = computed(() => getVisibleSections(isAdmin.value))
const commonSections = computed(() => sections.value.filter((section) => !section.adminOnly))
const adminSections = computed(() => sections.value.filter((section) => section.adminOnly))
const activeSectionKey = computed(() => resolveSection(route.path, isAdmin.value)?.key || 'workbench')
const iconMap = {
HomeFilled,
Reading,
EditPen,
UserFilled,
Collection,
Setting,
}
let timer = null
onMounted(() => {
notif.refresh()
timer = setInterval(() => notif.refresh(), 60000)
})
onBeforeUnmount(() => {
if (timer) clearInterval(timer)
})
function handleLogout() {
auth.logout()
router.push('/login')
}
function handleSectionSelect(sectionKey) {
const section = sections.value.find((item) => item.key === sectionKey)
if (section?.defaultPath && section.defaultPath !== route.path) {
router.push(section.defaultPath)
}
}
</script>
<style scoped>
.side-nav {
width: var(--nav-width, 220px);
height: 100vh;
background: var(--surface-bg);
border-right: 1px solid var(--surface-border);
display: flex;
flex-direction: column;
flex-shrink: 0;
}
.brand {
height: var(--top-rail-height);
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
box-sizing: border-box;
padding: 0 12px;
background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
border-bottom: 1px solid var(--surface-border);
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}
.brand-content {
display: flex;
align-items: center;
gap: 10px;
transform: translateX(-6px);
}
.brand-logo {
color: var(--el-color-primary);
flex-shrink: 0;
}
.brand-text {
display: flex;
flex-direction: column;
line-height: 1.2;
}
.brand-name {
font-size: 16px;
font-weight: 600;
color: var(--surface-text);
}
.brand-sub {
font-size: 13px;
font-weight: 500;
color: var(--surface-muted);
}
.brand-en {
font-size: 11px;
letter-spacing: 0.4px;
text-transform: uppercase;
color: #b1b3b8;
}
.nav-menu {
flex: 1;
overflow: hidden;
border-right: none;
}
.nav-divider {
margin: 8px 16px;
}
.user-footer {
padding: 12px 16px;
border-top: 1px solid var(--surface-border);
}
.footer-divider {
margin: 0 0 8px 0;
}
.user-info {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 10px;
}
.user-avatar {
background: var(--el-color-primary);
color: #fff;
font-weight: 600;
flex-shrink: 0;
}
.user-meta {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
}
.user-name {
font-size: 14px;
color: var(--surface-text);
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.logout-btn {
width: 100%;
}
</style>