mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-13 13:07:32 +00:00
(improvement)(chat-sdk) add question in export log and hide date range picker when dateInfo is null (#1550)
This commit is contained in:
@@ -252,34 +252,36 @@ const ParseTip: React.FC<Props> = ({
|
|||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<div className={`${prefixCls}-tip-item-filter-content`}>
|
<div className={`${prefixCls}-tip-item-filter-content`}>
|
||||||
<div className={tipItemOptionClass}>
|
{!!dateInfo && (
|
||||||
<span className={`${prefixCls}-tip-item-filter-name`}>数据时间:</span>
|
<div className={tipItemOptionClass}>
|
||||||
{nativeQuery ? (
|
<span className={`${prefixCls}-tip-item-filter-name`}>数据时间:</span>
|
||||||
<span className={itemValueClass}>
|
{nativeQuery ? (
|
||||||
{startDate === endDate ? startDate : `${startDate} ~ ${endDate}`}
|
<span className={itemValueClass}>
|
||||||
</span>
|
{startDate === endDate ? startDate : `${startDate} ~ ${endDate}`}
|
||||||
) : (
|
</span>
|
||||||
<RangePicker
|
) : (
|
||||||
value={[dayjs(startDate), dayjs(endDate)]}
|
<RangePicker
|
||||||
onChange={onDateInfoChange}
|
value={[dayjs(startDate), dayjs(endDate)]}
|
||||||
format="YYYY-MM-DD"
|
onChange={onDateInfoChange}
|
||||||
renderExtraFooter={() => (
|
format="YYYY-MM-DD"
|
||||||
<Row gutter={[28, 28]}>
|
renderExtraFooter={() => (
|
||||||
{Object.keys(ranges).map(key => (
|
<Row gutter={[28, 28]}>
|
||||||
<Col key={key}>
|
{Object.keys(ranges).map(key => (
|
||||||
<Button
|
<Col key={key}>
|
||||||
size="small"
|
<Button
|
||||||
onClick={() => handlePresetClick(ranges[key as RangeKeys])}
|
size="small"
|
||||||
>
|
onClick={() => handlePresetClick(ranges[key as RangeKeys])}
|
||||||
{key}
|
>
|
||||||
</Button>
|
{key}
|
||||||
</Col>
|
</Button>
|
||||||
))}
|
</Col>
|
||||||
</Row>
|
))}
|
||||||
)}
|
</Row>
|
||||||
/>
|
)}
|
||||||
)}
|
/>
|
||||||
</div>
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{filters?.map((filter: any, index: number) => (
|
{filters?.map((filter: any, index: number) => (
|
||||||
<FilterItem
|
<FilterItem
|
||||||
modelId={modelId!}
|
modelId={modelId!}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { exportTextFile } from '../../utils/utils';
|
|||||||
type Props = {
|
type Props = {
|
||||||
agentId?: number;
|
agentId?: number;
|
||||||
queryId: number;
|
queryId: number;
|
||||||
|
question: string;
|
||||||
llmReq?: any;
|
llmReq?: any;
|
||||||
llmResp?: any;
|
llmResp?: any;
|
||||||
integrateSystem?: string;
|
integrateSystem?: string;
|
||||||
@@ -23,6 +24,7 @@ type Props = {
|
|||||||
const SqlItem: React.FC<Props> = ({
|
const SqlItem: React.FC<Props> = ({
|
||||||
agentId,
|
agentId,
|
||||||
queryId,
|
queryId,
|
||||||
|
question,
|
||||||
llmReq,
|
llmReq,
|
||||||
llmResp,
|
llmResp,
|
||||||
integrateSystem,
|
integrateSystem,
|
||||||
@@ -126,6 +128,11 @@ ${format(sqlInfo.querySQL)}
|
|||||||
|
|
||||||
const onExportLog = () => {
|
const onExportLog = () => {
|
||||||
let text = '';
|
let text = '';
|
||||||
|
if (question) {
|
||||||
|
text += `
|
||||||
|
问题:${question}
|
||||||
|
`;
|
||||||
|
}
|
||||||
if (llmReq) {
|
if (llmReq) {
|
||||||
text += getSchemaMapText();
|
text += getSchemaMapText();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -353,6 +353,7 @@ const ChatItem: React.FC<Props> = ({
|
|||||||
<SqlItem
|
<SqlItem
|
||||||
agentId={agentId}
|
agentId={agentId}
|
||||||
queryId={parseInfo.queryId}
|
queryId={parseInfo.queryId}
|
||||||
|
question={msg}
|
||||||
llmReq={llmReq}
|
llmReq={llmReq}
|
||||||
llmResp={llmResp}
|
llmResp={llmResp}
|
||||||
integrateSystem={integrateSystem}
|
integrateSystem={integrateSystem}
|
||||||
|
|||||||
Reference in New Issue
Block a user