mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-15 06:27:21 +00:00
(feature)(webapp) change model name to model names tag (#455)
This commit is contained in:
@@ -37,7 +37,7 @@ export type EntityInfoType = {
|
||||
export type DateInfoType = {
|
||||
dateList: any[];
|
||||
dateMode: string;
|
||||
period: string;
|
||||
period: string;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
text: string;
|
||||
@@ -59,22 +59,23 @@ export type ModelType = {
|
||||
id: number;
|
||||
model: number;
|
||||
name: string;
|
||||
modelNames: string[];
|
||||
type: string;
|
||||
useCnt: number;
|
||||
}
|
||||
};
|
||||
|
||||
export type EntityDimensionType = {
|
||||
bizName: string;
|
||||
itemId: number;
|
||||
name: string;
|
||||
value: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type SqlInfoType = {
|
||||
s2SQL: string;
|
||||
correctS2SQL: string;
|
||||
querySQL: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type ChatContextType = {
|
||||
id: number;
|
||||
@@ -86,12 +87,12 @@ export type ChatContextType = {
|
||||
dateInfo: DateInfoType;
|
||||
dimensions: FieldType[];
|
||||
metrics: FieldType[];
|
||||
entity: { alias: string[], id: number };
|
||||
entity: { alias: string[]; id: number };
|
||||
entityInfo: EntityInfoType;
|
||||
elementMatches: any[];
|
||||
nativeQuery: boolean;
|
||||
queryMode: string;
|
||||
queryType: 'METRIC' | 'TAG' | 'OTHER';
|
||||
queryType: 'METRIC' | 'TAG' | 'OTHER';
|
||||
dimensionFilters: FilterItemType[];
|
||||
properties: any;
|
||||
sqlInfo: SqlInfoType;
|
||||
@@ -102,26 +103,26 @@ export enum MsgValidTypeEnum {
|
||||
SEARCH_EXCEPTION = 1,
|
||||
EMPTY = 2,
|
||||
INVALID = 3,
|
||||
};
|
||||
}
|
||||
|
||||
export type PluginResonseType = {
|
||||
description: string;
|
||||
webPage: { url: string, paramOptions: any, params: any, valueParams: any };
|
||||
webPage: { url: string; paramOptions: any; params: any; valueParams: any };
|
||||
pluginId: number;
|
||||
pluginType: string;
|
||||
name: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type MetricInfoType = {
|
||||
date: string;
|
||||
name: string;
|
||||
statistics: any;
|
||||
value: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type AggregateInfoType = {
|
||||
metricInfos: MetricInfoType[]
|
||||
}
|
||||
metricInfos: MetricInfoType[];
|
||||
};
|
||||
|
||||
export type MsgDataType = {
|
||||
id: number;
|
||||
@@ -155,7 +156,7 @@ export type ParseDataType = {
|
||||
selectedParses: ChatContextType[];
|
||||
candidateParses: ChatContextType[];
|
||||
similarSolvedQuery: SimilarQuestionType[];
|
||||
}
|
||||
};
|
||||
|
||||
export type QueryDataType = {
|
||||
chatContext: ChatContextType;
|
||||
@@ -182,7 +183,7 @@ export enum SemanticTypeEnum {
|
||||
DIMENSION = 'DIMENSION',
|
||||
METRIC = 'METRIC',
|
||||
VALUE = 'VALUE',
|
||||
};
|
||||
}
|
||||
|
||||
export const SEMANTIC_TYPE_MAP = {
|
||||
[SemanticTypeEnum.DOMAIN]: '数据模型',
|
||||
@@ -194,7 +195,7 @@ export const SEMANTIC_TYPE_MAP = {
|
||||
export type SuggestionItemType = {
|
||||
model: number;
|
||||
name: string;
|
||||
bizName: string
|
||||
bizName: string;
|
||||
};
|
||||
|
||||
export type SuggestionType = {
|
||||
@@ -203,10 +204,10 @@ export type SuggestionType = {
|
||||
};
|
||||
|
||||
export type SuggestionDataType = {
|
||||
currentAggregateType: string,
|
||||
columns: ColumnType[],
|
||||
mainEntity: EntityInfoType,
|
||||
suggestions: SuggestionType,
|
||||
currentAggregateType: string;
|
||||
columns: ColumnType[];
|
||||
mainEntity: EntityInfoType;
|
||||
suggestions: SuggestionType;
|
||||
};
|
||||
|
||||
export type HistoryMsgItemType = {
|
||||
@@ -231,22 +232,22 @@ export type DrillDownDimensionType = {
|
||||
model: number;
|
||||
name: string;
|
||||
bizName: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type SendMsgParamsType = {
|
||||
msg: string;
|
||||
agentId: number;
|
||||
modelId: number;
|
||||
filters?: FilterItemType[];
|
||||
}
|
||||
};
|
||||
|
||||
export type SimilarQuestionType = {
|
||||
// queryId: number;
|
||||
// parseId: number;
|
||||
queryText: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type ParseTimeCostType = {
|
||||
parseTime: number;
|
||||
sqlTime: number;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { ReactNode } from 'react';
|
||||
import { AGG_TYPE_MAP, PREFIX_CLS } from '../../common/constants';
|
||||
import { ChatContextType, DateInfoType, EntityInfoType, FilterItemType } from '../../common/type';
|
||||
import { Button, DatePicker } from 'antd';
|
||||
import { Button, DatePicker, Tag } from 'antd';
|
||||
import { CheckCircleFilled, ReloadOutlined } from '@ant-design/icons';
|
||||
import Loading from './Loading';
|
||||
import FilterItem from './FilterItem';
|
||||
@@ -89,7 +89,7 @@ const ParseTip: React.FC<Props> = ({
|
||||
|
||||
const {
|
||||
modelId,
|
||||
modelName,
|
||||
model,
|
||||
dimensions,
|
||||
metrics,
|
||||
aggType,
|
||||
@@ -101,6 +101,8 @@ const ParseTip: React.FC<Props> = ({
|
||||
nativeQuery,
|
||||
} = currentParseInfo || {};
|
||||
|
||||
const { modelNames } = model || {};
|
||||
|
||||
const entityAlias = entity?.alias?.[0]?.split('.')?.[0];
|
||||
|
||||
const entityDimensions = entityInfo?.dimensions?.filter(
|
||||
@@ -149,7 +151,11 @@ const ParseTip: React.FC<Props> = ({
|
||||
) : (
|
||||
<div className={`${prefixCls}-tip-item`}>
|
||||
<div className={`${prefixCls}-tip-item-name`}>数据模型:</div>
|
||||
<div className={itemValueClass}>{modelName}</div>
|
||||
<div className={itemValueClass}>
|
||||
{modelNames?.map(modelName => (
|
||||
<Tag key={modelName}>{modelName}</Tag>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{(queryType === 'METRIC' || queryType === 'TAG') && (
|
||||
|
||||
Reference in New Issue
Block a user