From 7f493b801497d707b4177212dc7b18956410021b Mon Sep 17 00:00:00 2001 From: rd <1344903914@qq.com> Date: Fri, 29 Aug 2025 16:44:27 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E8=B5=B0=E6=9F=A5=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=8C=E4=BF=AE=E6=94=B9sidebar=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/xt-chat/chat-view/index.vue | 2 +- .../xt-chat/chat-view/useChatHandler.tsx | 32 +++++--- src/components/xt-chat/xt-bubble/style.scss | 11 +++ src/layouts/Basic.vue | 27 +------ src/layouts/components/siderBar/index.vue | 81 ++++++++++++------- src/router/routes/modules/agent.ts | 11 ++- src/stores/modules/side-bar/index.ts | 16 ++-- src/utils/user.ts | 1 - src/views/agent/chat/index.vue | 2 +- src/views/agent/index/index.vue | 4 +- .../history-conversation-drawer/index.vue | 2 +- 11 files changed, 109 insertions(+), 80 deletions(-) diff --git a/src/components/xt-chat/chat-view/index.vue b/src/components/xt-chat/chat-view/index.vue index 3d3b113..440f4a8 100644 --- a/src/components/xt-chat/chat-view/index.vue +++ b/src/components/xt-chat/chat-view/index.vue @@ -171,7 +171,7 @@ export default { onSubmit={handleSubmit} onCancel={handleCancel} /> -

内容由AI生成,仅供参考

+

内容由AI生成,仅供参考

diff --git a/src/components/xt-chat/chat-view/useChatHandler.tsx b/src/components/xt-chat/chat-view/useChatHandler.tsx index 71f50e7..cbeec27 100644 --- a/src/components/xt-chat/chat-view/useChatHandler.tsx +++ b/src/components/xt-chat/chat-view/useChatHandler.tsx @@ -113,12 +113,16 @@ export default function useChatHandler(options: UseChatHandlerOptions): UseChatH const isShow = conversationList.value[conversationList.value.length - 1].run_id === item.run_id; return (
- onCopy(content)}> - + onCopy(content)} align={{ offset: [0, 4] }} > +
+ +
{isShow && ( - handleRemoteRefresh(item)}> - + handleRemoteRefresh(item)} align={{ offset: [0, 4] }}> +
+ +
)}
@@ -353,17 +357,23 @@ export default function useChatHandler(options: UseChatHandlerOptions): UseChatH
{!extra_data && ( // ? ( - // - // - // + // + //
+ // + //
+ //
// ) : - onCopy(_targetTask.content.output)}> - + onCopy(_targetTask.content.output)} align={{ offset: [0, 4] }}> +
+ +
)} {isShow && ( - onRefresh(teamRunTaskId)}> - + onRefresh(teamRunTaskId)} align={{ offset: [0, 4] }}> +
+ +
)}
diff --git a/src/components/xt-chat/xt-bubble/style.scss b/src/components/xt-chat/xt-bubble/style.scss index af644f2..63cda5a 100644 --- a/src/components/xt-chat/xt-bubble/style.scss +++ b/src/components/xt-chat/xt-bubble/style.scss @@ -127,6 +127,17 @@ } } } + + .action-box { + cursor: pointer; + padding: 2px; + border-radius: 2px; + transition: all 0.2s; + line-height: normal; + &:hover { + background-color: #f2f3f5; + } + } } .xt-bubble-header { diff --git a/src/layouts/Basic.vue b/src/layouts/Basic.vue index 6b8d78f..1ef395e 100644 --- a/src/layouts/Basic.vue +++ b/src/layouts/Basic.vue @@ -23,9 +23,6 @@ const route = useRoute(); useResponsive(true); -const showSider = computed(() => { - return !route.meta?.hideSidebar; -}); const isHomeRoute = computed(() => { return route.name === 'Home'; }); @@ -43,20 +40,10 @@ const layoutPageClass = computed(() => { return result; }); -const siderWidth = computed(() => { - return showSider.value ? sidebarStore.sidebarWidth : 0; -}); - -const collapsed = computed(() => { - return sidebarStore.menuCollapse; -}); onMounted(() => { checkHasInviteCode(); }); -const setCollapsed = (val) => { - appStore.updateSettings({ menuCollapse: val }); -}; const checkHasInviteCode = () => { const inviteCode = getQueryParam('invite_code'); @@ -74,21 +61,11 @@ const checkHasInviteCode = () => { - - - + diff --git a/src/layouts/components/siderBar/index.vue b/src/layouts/components/siderBar/index.vue index 3d1555f..45d9668 100644 --- a/src/layouts/components/siderBar/index.vue +++ b/src/layouts/components/siderBar/index.vue @@ -1,5 +1,5 @@