(feature)(chat-sdk) add PLAIN_TEXT query mode (#1229)

This commit is contained in:
williamhliu
2024-06-26 09:42:23 +08:00
committed by GitHub
parent 210163a82a
commit 82b2552d9d
3 changed files with 48 additions and 40 deletions

View File

@@ -9,6 +9,7 @@ import React, { ReactNode, useState } from 'react';
type Props = {
queryId?: number;
queryMode?: string;
executeLoading: boolean;
entitySwitchLoading: boolean;
chartIndex: number;
@@ -23,6 +24,7 @@ type Props = {
const ExecuteItem: React.FC<Props> = ({
queryId,
queryMode,
executeLoading,
entitySwitchLoading,
chartIndex,
@@ -54,6 +56,9 @@ const ExecuteItem: React.FC<Props> = ({
};
if (executeLoading) {
if (queryMode === 'PLAIN_TEXT') {
return <Loading />;
}
return getNodeTip('数据查询中');
}
@@ -73,6 +78,10 @@ const ExecuteItem: React.FC<Props> = ({
return null;
}
if (data.queryMode === 'PLAIN_TEXT') {
return <>{data.textResult}</>;
}
return (
<>
<div className={`${prefixCls}-title-bar`}>