diff --git a/admin/src/views/config/center/index.vue b/admin/src/views/config/center/index.vue index a673e56..600665b 100644 --- a/admin/src/views/config/center/index.vue +++ b/admin/src/views/config/center/index.vue @@ -1,7 +1,7 @@ - - {{ item.label }} - 已实装 + + + + @@ -514,30 +532,54 @@ const AVATAR_MAX_BYTES = 2 * 1024 * 1024 const AVATAR_EXTS = ['png', 'jpg', 'jpeg', 'webp'] - // ---- 左侧组导航(Task 7a 品牌 / 7b 提示词+词表 / 7c 凭据 / 7d 版本实装) ---------------- + // ---- 左侧组导航(常用/高级两层 + 版本历史救援入口——spec §3) ------------------------- - const GROUP_NAV = [ - { key: 'brand', label: '品牌' }, - { key: 'prompts', label: '提示词' }, - { key: 'wall', label: '安全词表' }, - { key: 'contact', label: '联系方式' }, - { key: 'creds', label: '凭据' }, - { key: 'engine', label: '引擎' }, - { key: 'misc', label: '杂项' }, - { key: 'versions', label: '版本' } - ] as const + type GroupKey = + | 'brand' | 'wall' | 'prompts' | 'contact' | 'creds' + | 'engine' | 'misc' | 'versions' - /** 已实装组(导航徽标) */ - const IMPLEMENTED_GROUPS = new Set([ - 'brand', - 'prompts', - 'wall', - 'contact', - 'creds', - 'engine', - 'misc', - 'versions' - ]) + /** 导航项:任务名 + 副标题(导航与卡头共用文案源) */ + interface NavItem { + key: GroupKey + label: string + sub: string + } + + /** 分层双模式(spec §3):常用 = 日常自助;高级 = 引擎级参数 */ + const NAV_SECTIONS: Array<{ title: string; icon: string; items: NavItem[] }> = [ + { + title: '常用配置', + icon: 'solar:star-line-duotone', + items: [ + { key: 'brand', label: '品牌与外观', sub: '聊天窗标题/颜色/头像/欢迎语' }, + { key: 'wall', label: 'AI 话术', sub: '问价格/要联系方式时 AI 怎么回' }, + { key: 'prompts', label: '公司资料', sub: 'AI 介绍你公司时依据的内容' }, + { key: 'contact', label: '联系方式', sub: '要 WhatsApp/邮箱的行为开关' }, + { key: 'creds', label: '凭据与通知', sub: '邮件/推送/AI 密钥 + 连通测试' } + ] + }, + { + title: '高级配置', + icon: 'solar:settings-minimalistic-line-duotone', + items: [ + { key: 'engine', label: '聊天限流', sub: '每 IP 发言/连接上限' }, + { key: 'misc', label: '国家区号映射', sub: '国名 → 区号补全规则' } + ] + } + ] + + /** 版本历史:独立于两层之外的救援入口(spec §3) */ + const VERSIONS_NAV: NavItem = { + key: 'versions', + label: '版本历史', + sub: '改坏了?这里一键回滚' + } + + /** 全部导航项扁平表(activeGroupLabel / 查找用) */ + const ALL_NAV_ITEMS: NavItem[] = [ + ...NAV_SECTIONS.flatMap((s) => s.items), + VERSIONS_NAV + ] /** 通用 JSON 组(终审 I-1:contact/engine/misc 走 JsonGroupPane 一份实现) */ const JSON_GROUPS = new Set(['contact', 'engine', 'misc']) @@ -549,8 +591,6 @@ : 'contact' ) - type GroupKey = (typeof GROUP_NAV)[number]['key'] - const activeGroup = ref('brand') function onGroupSelect(index: string): void { @@ -558,7 +598,7 @@ } const activeGroupLabel = computed( - () => GROUP_NAV.find((g) => g.key === activeGroup.value)?.label ?? '' + () => ALL_NAV_ITEMS.find((i) => i.key === activeGroup.value)?.label ?? '' ) // ---- 租户上下文(超管可切换;租户管理员固定自己——useTenantOptions 收拢) ---------------- @@ -951,17 +991,42 @@ .group-nav { border-right: none; - .nav-label { - font-size: 14px; + .nav-section-title { + display: flex; + align-items: center; + gap: 6px; + padding: 10px 12px 4px; + font-size: 12px; + font-weight: 600; + letter-spacing: 0.05em; + color: var(--art-gray-500); + + .nav-section-icon { + font-size: 14px; + } } - .nav-badge { - margin-left: 6px; - padding: 0 6px; - font-size: 11px; - color: var(--el-color-success); - background: var(--el-color-success-light-9); - border-radius: 8px; + .nav-versions-title { + margin-top: 8px; + padding-top: 12px; + border-top: 1px dashed var(--el-border-color-lighter); + } + + .nav-item-text { + display: flex; + flex-direction: column; + line-height: 1.4; + + .nav-sub { + font-size: 11px; + color: var(--art-gray-400); + // el-menu-item 自带 white-space:nowrap——放行副标题换行,防溢出菜单项内容框 + white-space: normal; + } + } + + .nav-label { + font-size: 14px; } }