From 0226ebf341c1f102b57ec76558ed78a037b82024 Mon Sep 17 00:00:00 2001 From: williamhliu <137068196+williamhliu@users.noreply.github.com> Date: Mon, 1 Jul 2024 18:21:18 +0800 Subject: [PATCH] (feature)(chat-sdk) Support plain text display for queryMode as WEB_SERVICE (#1316) --- .../packages/chat-sdk/src/components/ChatItem/ExecuteItem.tsx | 4 ++-- webapp/packages/chat-sdk/src/components/ChatItem/index.tsx | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/webapp/packages/chat-sdk/src/components/ChatItem/ExecuteItem.tsx b/webapp/packages/chat-sdk/src/components/ChatItem/ExecuteItem.tsx index 95fe654b5..b14e4f82f 100644 --- a/webapp/packages/chat-sdk/src/components/ChatItem/ExecuteItem.tsx +++ b/webapp/packages/chat-sdk/src/components/ChatItem/ExecuteItem.tsx @@ -40,7 +40,7 @@ const ExecuteItem: React.FC = ({ const [showMsgContentTable, setShowMsgContentTable] = useState(false); const [msgContentType, setMsgContentType] = useState(); - const titlePrefix = queryMode === 'PLAIN_TEXT' ? '问答' : '数据'; + const titlePrefix = queryMode === 'PLAIN_TEXT' || queryMode === 'WEB_SERVICE' ? '问答' : '数据'; const getNodeTip = (title: ReactNode, tip?: string) => { return ( @@ -115,7 +115,7 @@ const ExecuteItem: React.FC = ({ )} {renderCustomExecuteNode && executeItemNode ? ( executeItemNode - ) : data?.queryMode === 'PLAIN_TEXT' ? ( + ) : data?.queryMode === 'PLAIN_TEXT' || data?.queryMode === 'WEB_SERVICE' ? ( data?.textResult ) : data?.queryMode === 'WEB_PAGE' ? ( diff --git a/webapp/packages/chat-sdk/src/components/ChatItem/index.tsx b/webapp/packages/chat-sdk/src/components/ChatItem/index.tsx index 73e9d35b0..43c31368f 100644 --- a/webapp/packages/chat-sdk/src/components/ChatItem/index.tsx +++ b/webapp/packages/chat-sdk/src/components/ChatItem/index.tsx @@ -97,6 +97,7 @@ const ChatItem: React.FC = ({ } else if ( (queryColumns && queryColumns.length > 0 && queryResults) || queryMode === 'WEB_PAGE' || + queryMode === 'WEB_SERVICE' || queryMode === 'PLAIN_TEXT' ) { data = res.data;