mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-19 13:04:21 +08:00
Merge c2adb3314d into a5051c7225
This commit is contained in:
@@ -48,12 +48,13 @@ const MetricTrend: React.FC<Props> = ({
|
||||
const { queryColumns, queryResults, aggregateInfo, entityInfo, chatContext } = data;
|
||||
const [chartType, setChartType] = useState('line');
|
||||
|
||||
const dateField: any = queryColumns?.find(
|
||||
const dateField = queryColumns?.find(
|
||||
(column: any) => column.showType === 'DATE' || column.type === 'DATE'
|
||||
);
|
||||
const dateColumnName = dateField?.bizName || '';
|
||||
const categoryColumnName =
|
||||
queryColumns?.find((column: any) => column.showType === 'CATEGORY')?.bizName || '';
|
||||
let categoryColumnName =
|
||||
queryColumns?.find((column: any) => column.showType === 'CATEGORY')?.bizName || '';
|
||||
categoryColumnName = categoryColumnName === dateColumnName ? '' : categoryColumnName;
|
||||
const metricFields = queryColumns?.filter((column: any) => column.showType === 'NUMBER');
|
||||
|
||||
const currentMetricField = queryColumns?.find((column: any) => column.showType === 'NUMBER');
|
||||
@@ -80,11 +81,11 @@ const MetricTrend: React.FC<Props> = ({
|
||||
<MetricInfo aggregateInfo={aggregateInfo} currentMetricField={currentMetricField} />
|
||||
)}
|
||||
<div className={`${prefixCls}-select-options`}>
|
||||
<DateOptions
|
||||
chatContext={chatContext}
|
||||
currentDateOption={currentDateOption}
|
||||
onSelectDateOption={onSelectDateOption}
|
||||
/>
|
||||
{/*<DateOptions*/}
|
||||
{/* chatContext={chatContext}*/}
|
||||
{/* currentDateOption={currentDateOption}*/}
|
||||
{/* onSelectDateOption={onSelectDateOption}*/}
|
||||
{/*/>*/}
|
||||
<div>
|
||||
<Select
|
||||
defaultValue="line"
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ISemantic } from '../../data';
|
||||
import {
|
||||
AGG_OPTIONS,
|
||||
DATE_FORMATTER,
|
||||
DATE_OPTIONS,
|
||||
// DATE_OPTIONS,
|
||||
DIM_OPTIONS,
|
||||
EnumDataSourceType,
|
||||
EnumModelDataType,
|
||||
@@ -275,7 +275,7 @@ const ModelFieldForm: React.FC<Props> = ({
|
||||
}
|
||||
}
|
||||
if ([EnumDataSourceType.TIME, EnumDataSourceType.PARTITION_TIME].includes(type)) {
|
||||
const { dateFormat, timeGranularity } = record;
|
||||
const { dateFormat } = record;
|
||||
const dateFormatterOptions =
|
||||
type === EnumDataSourceType.PARTITION_TIME ? PARTITION_TIME_FORMATTER : DATE_FORMATTER;
|
||||
|
||||
@@ -302,25 +302,25 @@ const ModelFieldForm: React.FC<Props> = ({
|
||||
<ExclamationCircleOutlined />
|
||||
</Tooltip>
|
||||
</Space>
|
||||
<Space>
|
||||
<span>时间粒度:</span>
|
||||
<Select
|
||||
placeholder="时间粒度"
|
||||
value={timeGranularity === '' ? undefined : timeGranularity}
|
||||
onChange={(value) => {
|
||||
handleFieldChange(record, 'timeGranularity', value);
|
||||
}}
|
||||
defaultValue={timeGranularity === '' ? undefined : DATE_OPTIONS[0]}
|
||||
style={{ minWidth: 180 }}
|
||||
allowClear
|
||||
>
|
||||
{DATE_OPTIONS.map((item) => (
|
||||
<Option key={item} value={item}>
|
||||
{item}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Space>
|
||||
{/*<Space>*/}
|
||||
{/* <span>时间粒度:</span>*/}
|
||||
{/* <Select*/}
|
||||
{/* placeholder="时间粒度"*/}
|
||||
{/* value={timeGranularity === '' ? undefined : timeGranularity}*/}
|
||||
{/* onChange={(value) => {*/}
|
||||
{/* handleFieldChange(record, 'timeGranularity', value);*/}
|
||||
{/* }}*/}
|
||||
{/* defaultValue={timeGranularity === '' ? undefined : DATE_OPTIONS[0]}*/}
|
||||
{/* style={{ minWidth: 180 }}*/}
|
||||
{/* allowClear*/}
|
||||
{/* >*/}
|
||||
{/* {DATE_OPTIONS.map((item) => (*/}
|
||||
{/* <Option key={item} value={item}>*/}
|
||||
{/* {item}*/}
|
||||
{/* </Option>*/}
|
||||
{/* ))}*/}
|
||||
{/* </Select>*/}
|
||||
{/*</Space>*/}
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user