From 9365896bb672a877b8abe7d9b8aeb663858702c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8C=97=E6=9E=B3?=
<7854742+wang_rumeng@user.noreply.gitee.com>
Date: Fri, 5 Sep 2025 17:24:16 +0800
Subject: [PATCH] =?UTF-8?q?-=20[x]=20=E6=98=BE=E7=A4=BA=20=E5=8E=9F?=
=?UTF-8?q?=E5=88=86=E9=95=9C=EF=BC=8C=E5=89=AA=E8=BE=91=E5=90=8E=20-=20[x?=
=?UTF-8?q?]=20=E6=94=AF=E6=8C=81=E6=89=B9=E9=87=8F=E4=B8=8B=E8=BD=BD?=
=?UTF-8?q?=E5=88=86=E9=95=9C=E8=A7=86=E9=A2=91=20Chatbox=E6=9F=A5?=
=?UTF-8?q?=E6=89=BE=E6=B6=88=E6=81=AF=E6=98=AF=E5=90=A6=E6=9C=89=E4=BB=BB?=
=?UTF-8?q?=E5=8A=A1=20=E8=BF=98=E5=9C=A8=E6=89=A7=E8=A1=8C=E4=B8=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/SmartChatBox/useMessages.ts | 9 ++++
components/pages/work-flow.tsx | 4 +-
components/pages/work-flow/media-viewer.tsx | 21 +++++++-
components/pages/work-flow/thumbnail-grid.tsx | 53 ++++++++++++++-----
.../pages/work-flow/use-workflow-data.tsx | 1 -
utils/tools.ts | 10 ++++
6 files changed, 80 insertions(+), 18 deletions(-)
diff --git a/components/SmartChatBox/useMessages.ts b/components/SmartChatBox/useMessages.ts
index 79f2312..a3e5de4 100644
--- a/components/SmartChatBox/useMessages.ts
+++ b/components/SmartChatBox/useMessages.ts
@@ -267,6 +267,15 @@ export function useMessages({ config, onMessagesUpdate }: UseMessagesProps): [Me
}
}, [updateMessages]);
+ // 监听 消息列表中是否存在 pending 状态的消息,有的话 将 loading 置为 true
+ useEffect(() => {
+ if (displayMessages.some(msg => msg.status === 'pending')) {
+ setIsLoading(true);
+ } else {
+ setIsLoading(false);
+ }
+ }, [displayMessages]);
+
return [
{
messages: displayMessages,
diff --git a/components/pages/work-flow.tsx b/components/pages/work-flow.tsx
index 1eb56e8..edd8e2f 100644
--- a/components/pages/work-flow.tsx
+++ b/components/pages/work-flow.tsx
@@ -216,7 +216,7 @@ const WorkFlow = React.memo(function WorkFlow() {
{isLoading ? (