From e9c73ecd7927710de86416144875f2415cab36f2 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Tue, 27 Oct 2026 00:20:15 +0800 Subject: [PATCH] feat(nav): collapse top menu into a local-only "More" menu and fix navbar icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - top menu: compute available width via flex layout (fixed logo / right-menu), collapse the overflow into a "更多" sub menu with one item per line and right-side flyout for nested menus - align menu item heights (remove el-sub-menu 2px border causing 3px offset), rotate the "更多" caret when opened - add local svg icons: fullscreen / exit-fullscreen / time / message / email (were referenced but never added, so the toolbar icons rendered empty) - navbar icons follow the light text color instead of inheriting dark gray - replace the empty chat button image with the ChatDotRound icon - drop the external IM redirect in AiChat: the panel now stays in-app - localize the avatar fallback (was wpimg.wallstcn.com) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/assets/images/avatar-default.svg | 5 + src/icons/svg/email.svg | 4 + src/icons/svg/exit-fullscreen.svg | 6 + src/icons/svg/fullscreen.svg | 6 + src/icons/svg/message.svg | 3 + src/icons/svg/time.svg | 4 + src/lang/en-US.ts | 1 + src/lang/zh-CN.ts | 1 + src/layout/component/AiChat/index.vue | 26 --- src/layout/component/Navbar.vue | 42 ++++- src/layout/component/TopMenu.vue | 237 +++++++++++++++++++++++--- 11 files changed, 279 insertions(+), 56 deletions(-) create mode 100644 src/assets/images/avatar-default.svg create mode 100644 src/icons/svg/email.svg create mode 100644 src/icons/svg/exit-fullscreen.svg create mode 100644 src/icons/svg/fullscreen.svg create mode 100644 src/icons/svg/message.svg create mode 100644 src/icons/svg/time.svg diff --git a/src/assets/images/avatar-default.svg b/src/assets/images/avatar-default.svg new file mode 100644 index 00000000..69abecf0 --- /dev/null +++ b/src/assets/images/avatar-default.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/icons/svg/email.svg b/src/icons/svg/email.svg new file mode 100644 index 00000000..e3176268 --- /dev/null +++ b/src/icons/svg/email.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/icons/svg/exit-fullscreen.svg b/src/icons/svg/exit-fullscreen.svg new file mode 100644 index 00000000..4f291313 --- /dev/null +++ b/src/icons/svg/exit-fullscreen.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/icons/svg/fullscreen.svg b/src/icons/svg/fullscreen.svg new file mode 100644 index 00000000..435f9b08 --- /dev/null +++ b/src/icons/svg/fullscreen.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/icons/svg/message.svg b/src/icons/svg/message.svg new file mode 100644 index 00000000..e0d7328b --- /dev/null +++ b/src/icons/svg/message.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/icons/svg/time.svg b/src/icons/svg/time.svg new file mode 100644 index 00000000..f20bb67a --- /dev/null +++ b/src/icons/svg/time.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/lang/en-US.ts b/src/lang/en-US.ts index 812b8b07..1c5f9f93 100644 --- a/src/lang/en-US.ts +++ b/src/lang/en-US.ts @@ -9,6 +9,7 @@ export default { "validity": "Validity", "days": "Days", "refresh": "Refresh", + "More": "More", "Close": "Close", "Close Other": "Close Other", "Close All": "Close All" diff --git a/src/lang/zh-CN.ts b/src/lang/zh-CN.ts index 7c395f96..ed7af04d 100644 --- a/src/lang/zh-CN.ts +++ b/src/lang/zh-CN.ts @@ -9,6 +9,7 @@ export default { "validity": "有效期", "days": "天", "refresh": "刷新", + "More": "更多", "Close": "关闭", "Close Other": "关闭其他", "Close All": "全部关闭" diff --git a/src/layout/component/AiChat/index.vue b/src/layout/component/AiChat/index.vue index d27c9cfc..f1a2fba5 100644 --- a/src/layout/component/AiChat/index.vue +++ b/src/layout/component/AiChat/index.vue @@ -109,14 +109,12 @@ import { ref, nextTick, onMounted, watch } from 'vue' import { useAiStore, AI_IDENTITIES } from '@/stores/modules/ai' import { Plus, Clock, Close, UserFilled, Service, Position, ChatDotRound, Delete, ArrowDown } from '@element-plus/icons-vue' import type { ElScrollbar } from 'element-plus' -import { loginToIm } from '@/api/index' import dayjs from 'dayjs' const aiStore = useAiStore() const inputMessage = ref('') const scrollbarRef = ref>() const showHistory = ref(false) -const IM_LOGIN_URL = 'https://192.168.11.56:9096/' const getIconComponent = (iconName: string) => { const icons: Record = { Service } @@ -185,18 +183,6 @@ const sendMessage = () => { }, 1000) } -const openImPage = async () => { - try { - const res = await loginToIm() - const imCode = res?.data?.code - if (!imCode) return - const openUrl = `${IM_LOGIN_URL}?token=${encodeURIComponent(imCode)}` - window.open(openUrl, '_blank') - } catch (error) { - console.error('Failed to login to IM:', error) - } -} - watch(() => aiStore.messages.length, () => { if (!showHistory.value) { scrollToBottom() @@ -205,19 +191,7 @@ watch(() => aiStore.messages.length, () => { onMounted(() => { scrollToBottom() - if (aiStore.isVisible) { - openImPage() - } }) - -watch( - () => aiStore.isVisible, - isVisible => { - if (isVisible) { - openImPage() - } - } -) diff --git a/src/layout/component/TopMenu.vue b/src/layout/component/TopMenu.vue index e3b98cf7..d540b01b 100644 --- a/src/layout/component/TopMenu.vue +++ b/src/layout/component/TopMenu.vue @@ -1,5 +1,5 @@ + \ No newline at end of file