mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 19:51:00 +00:00
[feature](webapp) add dsl query fields (#75)
This commit is contained in:
@@ -82,6 +82,7 @@ export type ChatContextType = {
|
||||
entity: { alias: string[], id: number };
|
||||
entityInfo: { dimensions: EntityDimensionType[] };
|
||||
elementMatches: any[];
|
||||
nativeQuery: boolean;
|
||||
queryMode: string;
|
||||
dimensionFilters: FilterItemType[];
|
||||
properties: any;
|
||||
|
||||
@@ -73,8 +73,11 @@ const ParseTip: React.FC<Props> = ({
|
||||
properties,
|
||||
entity,
|
||||
elementMatches,
|
||||
nativeQuery,
|
||||
} = parseInfo || {};
|
||||
|
||||
const maxOptionCount = queryMode === 'DSL' ? 10 : MAX_OPTION_VALUES_COUNT;
|
||||
|
||||
const { startDate, endDate } = dateInfo || {};
|
||||
const dimensionItems = dimensions?.filter(item => item.type === 'DIMENSION');
|
||||
const metric = metrics?.[0];
|
||||
@@ -180,19 +183,26 @@ const ParseTip: React.FC<Props> = ({
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{['METRIC_GROUPBY', 'METRIC_ORDERBY', 'ENTITY_DETAIL'].includes(queryMode) &&
|
||||
{['METRIC_GROUPBY', 'METRIC_ORDERBY', 'ENTITY_DETAIL', 'DSL'].includes(queryMode) &&
|
||||
fields &&
|
||||
fields.length > 0 && (
|
||||
<div className={`${prefixCls}-tip-item`}>
|
||||
<div className={`${prefixCls}-tip-item-name`}>
|
||||
{queryMode === 'ENTITY_DETAIL' ? '查询字段' : '下钻维度'}:
|
||||
{queryMode === 'DSL'
|
||||
? nativeQuery
|
||||
? '查询字段'
|
||||
: '下钻维度'
|
||||
: queryMode === 'ENTITY_DETAIL'
|
||||
? '查询字段'
|
||||
: '下钻维度'}
|
||||
:
|
||||
</div>
|
||||
<div className={itemValueClass}>
|
||||
{fields
|
||||
.slice(0, MAX_OPTION_VALUES_COUNT)
|
||||
.slice(0, maxOptionCount)
|
||||
.map(field => field.name)
|
||||
.join('、')}
|
||||
{fields.length > MAX_OPTION_VALUES_COUNT && '...'}
|
||||
{fields.length > maxOptionCount && '...'}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -74,7 +74,7 @@ const Copilot: React.FC<Props> = ({ globalCopilotFilter, copilotSendMsg }) => {
|
||||
onClick={onTransferChat}
|
||||
/>
|
||||
</div>
|
||||
<div className={styles.title}>内容库问答</div>
|
||||
<div className={styles.title}>Copilot</div>
|
||||
</div>
|
||||
<div className={styles.chat}>
|
||||
<Chat
|
||||
|
||||
Reference in New Issue
Block a user