mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-24 10:27:28 +08:00
Merge branch 'master' into feature/fontend_route_rebuild
# Conflicts: # webapp/packages/supersonic-fe/src/pages/SemanticModel/View/components/DataSetTable.tsx # webapp/packages/supersonic-fe/src/pages/SemanticModel/View/index.tsx # webapp/packages/supersonic-fe/src/pages/SemanticModel/components/DomainManagerTab.tsx
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Table, Select, Checkbox, Input, Space, Tooltip, Form, Switch, Row, Col } from 'antd';
|
||||
import { Checkbox, Form, Input, Select, Space, Switch, Table, Tooltip } from 'antd';
|
||||
import TableTitleTooltips from '../../components/TableTitleTooltips';
|
||||
import { isUndefined } from 'lodash';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
||||
import SqlEditor from '@/components/SqlEditor';
|
||||
import { ISemantic } from '../../data';
|
||||
import {
|
||||
TYPE_OPTIONS,
|
||||
DATE_FORMATTER,
|
||||
AGG_OPTIONS,
|
||||
EnumDataSourceType,
|
||||
DATE_FORMATTER,
|
||||
DATE_OPTIONS,
|
||||
DIM_OPTIONS,
|
||||
EnumDataSourceType,
|
||||
EnumModelDataType,
|
||||
PARTITION_TIME_FORMATTER,
|
||||
TYPE_OPTIONS,
|
||||
} from '../constants';
|
||||
import styles from '../style.less';
|
||||
|
||||
@@ -90,8 +90,7 @@ const ModelFieldForm: React.FC<Props> = ({
|
||||
dataIndex: 'type',
|
||||
width: 250,
|
||||
render: (_: any, record: FieldItem) => {
|
||||
const type = fields.find((field) => field.bizName === record.bizName)?.type;
|
||||
const classType = fields.find((field) => field.bizName === record.bizName)?.classType;
|
||||
const { type, classType } = record;
|
||||
const selectTypeValue = [EnumModelDataType.DIMENSION].includes(classType)
|
||||
? classType
|
||||
: type;
|
||||
@@ -229,13 +228,10 @@ const ModelFieldForm: React.FC<Props> = ({
|
||||
// );
|
||||
// }
|
||||
if (type === EnumDataSourceType.MEASURES) {
|
||||
const agg = record.expr
|
||||
? fields.find((field) => field.expr === record.expr)?.agg
|
||||
: undefined;
|
||||
return (
|
||||
<Select
|
||||
placeholder="度量算子"
|
||||
value={agg}
|
||||
value={record.agg}
|
||||
onChange={(value) => {
|
||||
handleFieldChange(record, 'agg', value);
|
||||
}}
|
||||
@@ -251,7 +247,6 @@ const ModelFieldForm: React.FC<Props> = ({
|
||||
</Select>
|
||||
);
|
||||
}
|
||||
|
||||
if (process.env.SHOW_TAG) {
|
||||
if (type === EnumDataSourceType.CATEGORICAL) {
|
||||
const isTag = fields.find((field) => field.bizName === record.bizName)?.isTag;
|
||||
@@ -299,10 +294,7 @@ const ModelFieldForm: React.FC<Props> = ({
|
||||
}
|
||||
}
|
||||
if ([EnumDataSourceType.TIME, EnumDataSourceType.PARTITION_TIME].includes(type)) {
|
||||
const dateFormat = fields.find((field) => field.bizName === record.bizName)?.dateFormat;
|
||||
const timeGranularity = fields.find(
|
||||
(field) => field.bizName === record.bizName,
|
||||
)?.timeGranularity;
|
||||
const { dateFormat, timeGranularity } = record;
|
||||
const dateFormatterOptions =
|
||||
type === EnumDataSourceType.PARTITION_TIME ? PARTITION_TIME_FORMATTER : DATE_FORMATTER;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user