From 0c53e31b2ad06afd531c39a1a92e1666745af5e2 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Fri, 12 Sep 2025 16:52:55 +0800 Subject: [PATCH] feat: Add a back to bottom button to the chat page(#2957) --- .../component/chat-input-operate/index.vue | 6 +- ui/src/components/ai-chat/index.scss | 7 +- ui/src/components/ai-chat/index.vue | 66 +++++++------- ui/src/components/app-table/index.vue | 2 +- ui/src/styles/element-plus.scss | 5 ++ ui/src/views/problem/index.vue | 1 + .../tool/component/ToolListContainer.vue | 2 +- ui/src/views/tool/toolStore/ToolCard.vue | 35 ++++++-- .../views/tool/toolStore/ToolStoreDialog.vue | 87 ++++++++++++++----- 9 files changed, 145 insertions(+), 66 deletions(-) diff --git a/ui/src/components/ai-chat/component/chat-input-operate/index.vue b/ui/src/components/ai-chat/component/chat-input-operate/index.vue index cb4d7c983..7fb790998 100644 --- a/ui/src/components/ai-chat/component/chat-input-operate/index.vue +++ b/ui/src/components/ai-chat/component/chat-input-operate/index.vue @@ -3,8 +3,10 @@
- {{ $t('chat.operation.stopChat') }} + {{ $t('chat.operation.stopChat') }}
+
() const chatId_context = computed({ get: () => { diff --git a/ui/src/components/ai-chat/index.scss b/ui/src/components/ai-chat/index.scss index ca8415386..48ffbf66a 100644 --- a/ui/src/components/ai-chat/index.scss +++ b/ui/src/components/ai-chat/index.scss @@ -7,6 +7,12 @@ position: relative; color: var(--app-text-color); box-sizing: border-box; + + .back-bottom-button { + position: absolute; + right: 14px; + top: -30px; + } &__content { padding-top: 0; box-sizing: border-box; @@ -16,7 +22,6 @@ } .content { - :deep(ol) { margin-left: 16px !important; } diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index ad8a15900..c7fd073b4 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -66,35 +66,39 @@
- - - - - +
+ + + + + + + +
@@ -603,10 +607,12 @@ function chatMessage(chat?: any, problem?: string, re_chat?: boolean, other_para const scrollTop = ref(0) const scorll = ref(true) +const isBottom = ref(false) const getMaxHeight = () => { return dialogScrollbar.value!.scrollHeight } + /** * 滚动滚动条到最上面 * @param $event @@ -621,6 +627,8 @@ const handleScrollTop = ($event: any) => { } else { scorll.value = false } + isBottom.value = + scrollTop.value + scrollDiv.value.wrapRef.offsetHeight < dialogScrollbar.value!.scrollHeight emit('scroll', { ...$event, dialogScrollbar: dialogScrollbar.value, scrollDiv: scrollDiv.value }) } /** diff --git a/ui/src/components/app-table/index.vue b/ui/src/components/app-table/index.vue index eb82af3f1..003b82394 100644 --- a/ui/src/components/app-table/index.vue +++ b/ui/src/components/app-table/index.vue @@ -36,7 +36,7 @@
{{ item.name }} - + {{ item.version }}
diff --git a/ui/src/views/tool/toolStore/ToolCard.vue b/ui/src/views/tool/toolStore/ToolCard.vue index 47d82965d..092bdb6fb 100644 --- a/ui/src/views/tool/toolStore/ToolCard.vue +++ b/ui/src/views/tool/toolStore/ToolCard.vue @@ -1,10 +1,29 @@