mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:07:06 +00:00
(improvement)(chat-sdk) modify sql field and plugin card width (#1662)
This commit is contained in:
@@ -49,7 +49,7 @@ const SqlItem: React.FC<Props> = ({
|
||||
return null;
|
||||
}
|
||||
|
||||
const { schema, linking, priorExts } = llmReq || {};
|
||||
const { schema, terms, priorExts } = llmReq || {};
|
||||
|
||||
const fewShots = (Object.values(llmResp?.sqlRespMap || {})[0] as any)?.fewShots || [];
|
||||
|
||||
@@ -57,9 +57,9 @@ const SqlItem: React.FC<Props> = ({
|
||||
return `
|
||||
Schema映射
|
||||
${schema?.fieldNameList?.length > 0 ? `名称:${schema.fieldNameList.join('、')}` : ''}${
|
||||
linking?.length > 0
|
||||
schema?.values?.length > 0
|
||||
? `
|
||||
取值:${linking
|
||||
取值:${schema.values
|
||||
.map((item: any) => {
|
||||
return `${item.fieldName}: ${item.fieldValue}`;
|
||||
})
|
||||
@@ -71,9 +71,9 @@ ${schema?.fieldNameList?.length > 0 ? `名称:${schema.fieldNameList.join('、
|
||||
附加:${priorExts}`
|
||||
: ''
|
||||
}${
|
||||
schema?.terms?.length > 0
|
||||
terms?.length > 0
|
||||
? `
|
||||
术语:${schema.terms
|
||||
术语:${terms
|
||||
.map((item: any) => {
|
||||
return `${item.name}${item.alias?.length > 0 ? `(${item.alias.join(',')})` : ''}: ${
|
||||
item.description
|
||||
@@ -253,11 +253,11 @@ ${format(sqlInfo.querySQL)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{linking?.length > 0 && (
|
||||
{schema?.values?.length > 0 && (
|
||||
<div className={`${prefixCls}-schema-row`}>
|
||||
<div className={`${prefixCls}-schema-title`}>取值:</div>
|
||||
<div className={`${prefixCls}-schema-content`}>
|
||||
{linking
|
||||
{schema.values
|
||||
.map((item: any) => {
|
||||
return `${item.fieldName}: ${item.fieldValue}`;
|
||||
})
|
||||
@@ -271,11 +271,11 @@ ${format(sqlInfo.querySQL)}
|
||||
<div className={`${prefixCls}-schema-content`}>{priorExts}</div>
|
||||
</div>
|
||||
)}
|
||||
{schema?.terms?.length > 0 && (
|
||||
{terms?.length > 0 && (
|
||||
<div className={`${prefixCls}-schema-row`}>
|
||||
<div className={`${prefixCls}-schema-title`}>术语:</div>
|
||||
<div className={`${prefixCls}-schema-content`}>
|
||||
{schema.terms
|
||||
{terms
|
||||
.map((item: any) => {
|
||||
return `${item.name}${
|
||||
item.alias?.length > 0 ? `(${item.alias.join(',')})` : ''
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { MsgDataType } from '../../../common/type';
|
||||
import { getToken, isProd } from '../../../utils/utils';
|
||||
import { getToken, isMobile, isProd } from '../../../utils/utils';
|
||||
import { webPageHost } from '../../../common/env';
|
||||
|
||||
type Props = {
|
||||
@@ -111,7 +111,11 @@ const WebPage: React.FC<Props> = ({ id, data }) => {
|
||||
id={`reportIframe_${id}`}
|
||||
name={`reportIframe_${id}`}
|
||||
src={pluginUrl}
|
||||
style={{ width: '100%', height, border: 'none' }}
|
||||
style={{
|
||||
width: isMobile ? 'calc(100vw - 20px)' : 'calc(100vw - 410px)',
|
||||
height,
|
||||
border: 'none',
|
||||
}}
|
||||
title="reportIframe"
|
||||
allowFullScreen
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user