diff --git a/webapp/packages/supersonic-fe/config/routes.ts b/webapp/packages/supersonic-fe/config/routes.ts index 0f2655218..c9bb6a33e 100644 --- a/webapp/packages/supersonic-fe/config/routes.ts +++ b/webapp/packages/supersonic-fe/config/routes.ts @@ -34,7 +34,7 @@ const ROUTES = [ component: './Agent', envEnableList: [ENV_KEY.CHAT], }, - { + { path: '/model', name: 'semanticModel', envEnableList: [ENV_KEY.SEMANTIC], @@ -53,6 +53,7 @@ const ROUTES = [ }, ], }, + { path: '/database', name: 'database', diff --git a/webapp/packages/supersonic-fe/src/pages/SemanticModel/Datasource/components/DataSourceFieldForm.tsx b/webapp/packages/supersonic-fe/src/pages/SemanticModel/Datasource/components/DataSourceFieldForm.tsx index c72cfab83..6d8c7a6b4 100644 --- a/webapp/packages/supersonic-fe/src/pages/SemanticModel/Datasource/components/DataSourceFieldForm.tsx +++ b/webapp/packages/supersonic-fe/src/pages/SemanticModel/Datasource/components/DataSourceFieldForm.tsx @@ -4,7 +4,13 @@ import TableTitleTooltips from '../../components/TableTitleTooltips'; import { isUndefined } from 'lodash'; import { ExclamationCircleOutlined } from '@ant-design/icons'; import Marquee from 'react-fast-marquee'; -import { TYPE_OPTIONS, DATE_FORMATTER, AGG_OPTIONS, EnumDataSourceType } from '../constants'; +import { + TYPE_OPTIONS, + DATE_FORMATTER, + AGG_OPTIONS, + EnumDataSourceType, + DATE_OPTIONS, +} from '../constants'; import styles from '../style.less'; type FieldItem = { @@ -15,6 +21,7 @@ type FieldItem = { agg?: string; checked?: number; dateFormat?: string; + timeGranularity?: string; }; type Props = { @@ -106,7 +113,7 @@ const FieldForm: React.FC = ({ fields, onFieldChange }) => { { title: '扩展配置', dataIndex: 'extender', - width: 100, + width: 180, render: (_: any, record: FieldItem) => { const { type } = record; if (type === EnumDataSourceType.MEASURES) { @@ -131,6 +138,9 @@ const FieldForm: React.FC = ({ fields, onFieldChange }) => { } if (type === EnumDataSourceType.TIME) { const dateFormat = fields.find((field) => field.bizName === record.bizName)?.dateFormat; + const timeGranularity = fields.find( + (field) => field.bizName === record.bizName, + )?.timeGranularity; return ( { + handleFieldChange(record, 'timeGranularity', value); + }} + defaultValue={DATE_OPTIONS[0]} + style={{ minWidth: 50 }} + > + {DATE_OPTIONS.map((item) => ( + + ))} + ); }