mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-20 06:34:55 +00:00
[improvement][headless-fe] Optimized the tag setting system. (#868)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab. [improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions. [improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager. * [improvement][semantic-fe] Add time granularity setting in the data source configuration. * [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility * [improvement][semantic-fe] Modification of data source creation prompt wording" * [improvement][semantic-fe] metric market experience optimization * [improvement][semantic-fe] enhance the analysis of metric trends * [improvement][semantic-fe] optimize the presentation of metric trend permissions * [improvement][semantic-fe] add metric trend download functionality * [improvement][semantic-fe] fix the dimension initialization issue in metric correlation * [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source. * [improvement][semantic-fe] Optimizing pagination logic and some CSS styles * [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum" * [improvement][semantic-fe] Fixing the default value setting for the indicator list * [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models * [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API * [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators * [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality * [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component. * [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not. * [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas. * [improvement][semantic-fe] Updating the datePicker component to use dayjs instead. * [improvement][semantic-fe] Fixing the issue with passing the model ID for dimensions in the indicator market. * [improvement][semantic-fe] Fixing the abnormal state of the popup when creating a model. * [improvement][semantic-fe] Adding permission logic for bulk operations in the indicator market. * [improvement][semantic-fe] Adding the ability to download and transpose data. * [improvement][semantic-fe] Fixing the initialization issue with the date selection component in the indicator details page when switching time granularity. * [improvement][semantic-fe] Fixing the logic error in the dimension value setting. * [improvement][semantic-fe] Fixing the synchronization issue with the question and answer settings information. * [improvement][semantic-fe] Optimizing the canvas functionality for better performance and user experience. * [improvement][semantic-fe] Optimizing the update process for drawing model relationship edges in the canvas. * [improvement][semantic-fe] Changing the line type for canvas connections. * [improvement][semantic-fe] Replacing the initialization variable from "semantic" to "headless". * [improvement][semantic-fe] Fixing the missing migration issue for default drill-down dimension configuration in model editing. Additionally, optimizing the data retrieval method for initializing fields in the model. * [improvement][semantic-fe] Updating the logic for the fieldName. * [improvement][semantic-fe] Adjusting the position of the metrics tab. * [improvement][semantic-fe] Changing the 字段名称 to 英文名称. * [improvement][semantic-fe] Fix metric measurement deletion. * [improvement][semantic-fe] UI optimization for metric details page. * [improvement][semantic-fe] UI optimization for metric details page. * [improvement][semantic-fe] UI adjustment for metric details page. * [improvement][semantic-fe] The granularity field in the time type of model editing now supports setting it as empty. * [improvement][semantic-fe] Added field type and metric type to the metric creation options. * [improvement][semantic-fe] The organization structure selection feature has been added to the permission management. * [improvement][semantic-fe] Improved user experience for the metric list. * [improvement][semantic-fe] fix update the metric list. * [improvement][headless-fe] Added view management functionality. * [improvement][headless-fe] The view management functionality has been added. This feature allows users to create, edit, and manage different views within the system. * [improvement][headless-fe] Added model editing side effect detection. * [improvement][headless-fe] Fixed the logic error in view editing. * [improvement][headless-fe] Fixed the issue with initializing dimension associations in metric settings. * [improvement][headless-fe] Added the ability to hide the Q&A settings entry point. * [improvement][headless-fe] Fixed the issue with selecting search results in metric field creation. * [improvement][headless-fe] Added search functionality to the field list in model editing. * [improvement][headless-fe] fix the field list in model editing * [improvement][headless-fe] Restructured the data for the dimension value settings interface. * [improvement][headless-fe] Added dynamic variable functionality to model creation based on SQL scripts. * [improvement][headless-fe] Added support for passing dynamic variables as parameters in the executeSql function. * [improvement][headless-fe] Resolved the issue where users were unable to select all options for dimensions, metrics, and fields in the metric generation process. * [improvement][headless-fe] Replaced the term "view" with "dataset" * [improvement][headless-fe] Added the ability to export metrics and dimensions to a specific target. * [improvement][headless-fe] Enhanced dataset creation to support the tag mode. * [improvement][headless-fe] Added tag value setting. * [improvement][headless-fe] Optimized the tag setting system. * [improvement][headless-fe] Optimized the tag setting system.
This commit is contained in:
@@ -103,7 +103,7 @@ const ClassDimensionTable: React.FC<Props> = ({ domainManger, dispatch }) => {
|
||||
});
|
||||
setLoading(false);
|
||||
if (code === 200) {
|
||||
queryDimensionList({ ...filterParams, ...defaultPagination });
|
||||
queryDimensionList({ ...filterParams, ...pagination });
|
||||
dispatch({
|
||||
type: 'domainManger/queryDimensionList',
|
||||
payload: {
|
||||
@@ -131,7 +131,7 @@ const ClassDimensionTable: React.FC<Props> = ({ domainManger, dispatch }) => {
|
||||
|
||||
setLoading(false);
|
||||
if (code === 200) {
|
||||
queryDimensionList({ ...filterParams, ...defaultPagination });
|
||||
queryDimensionList({ ...filterParams, ...pagination });
|
||||
dispatch({
|
||||
type: 'domainManger/queryDimensionList',
|
||||
payload: {
|
||||
@@ -206,6 +206,7 @@ const ClassDimensionTable: React.FC<Props> = ({ domainManger, dispatch }) => {
|
||||
{
|
||||
dataIndex: 'description',
|
||||
title: '描述',
|
||||
width: 250,
|
||||
search: false,
|
||||
render: columnsConfig.description.render,
|
||||
},
|
||||
@@ -375,7 +376,7 @@ const ClassDimensionTable: React.FC<Props> = ({ domainManger, dispatch }) => {
|
||||
),
|
||||
},
|
||||
{
|
||||
label: '标签状态',
|
||||
label: '是否为标签',
|
||||
component: (
|
||||
<Select
|
||||
style={{ width: 145 }}
|
||||
@@ -439,7 +440,7 @@ const ClassDimensionTable: React.FC<Props> = ({ domainManger, dispatch }) => {
|
||||
</Button>,
|
||||
<BatchCtrlDropDownButton
|
||||
key="ctrlBtnList"
|
||||
extenderEnable={true}
|
||||
extenderList={['exportTagButton']}
|
||||
onDeleteConfirm={() => {
|
||||
queryBatchUpdateStatus(selectedRowKeys, StatusEnum.DELETED);
|
||||
}}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { message, Button, Space, Popconfirm, Input, Select, Tag } from 'antd';
|
||||
import React, { useRef, useState, useEffect } from 'react';
|
||||
import type { Dispatch } from 'umi';
|
||||
import { StatusEnum } from '../enum';
|
||||
import { connect } from 'umi';
|
||||
import { connect, history } from 'umi';
|
||||
import type { StateType } from '../model';
|
||||
import { SENSITIVE_LEVEL_ENUM, SENSITIVE_LEVEL_OPTIONS, TAG_DEFINE_TYPE } from '../constant';
|
||||
import {
|
||||
@@ -13,6 +13,8 @@ import {
|
||||
batchUpdateMetricStatus,
|
||||
batchDownloadMetric,
|
||||
batchCreateTag,
|
||||
batchMetricPublish,
|
||||
batchMetricUnPublish,
|
||||
} from '../service';
|
||||
import MetricInfoCreateForm from './MetricInfoCreateForm';
|
||||
import BatchCtrlDropDownButton from '@/components/BatchCtrlDropDownButton';
|
||||
@@ -23,11 +25,12 @@ import { ISemantic } from '../data';
|
||||
import { ColumnsConfig } from './TableColumnRender';
|
||||
|
||||
type Props = {
|
||||
onEmptyMetricData?: () => void;
|
||||
dispatch: Dispatch;
|
||||
domainManger: StateType;
|
||||
};
|
||||
|
||||
const ClassMetricTable: React.FC<Props> = ({ domainManger, dispatch }) => {
|
||||
const ClassMetricTable: React.FC<Props> = ({ onEmptyMetricData, domainManger, dispatch }) => {
|
||||
const { selectModelId: modelId, selectDomainId } = domainManger;
|
||||
const [createModalVisible, setCreateModalVisible] = useState<boolean>(false);
|
||||
const [metricItem, setMetricItem] = useState<ISemantic.IMetricItem>();
|
||||
@@ -39,6 +42,7 @@ const ClassMetricTable: React.FC<Props> = ({ domainManger, dispatch }) => {
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
};
|
||||
const initState = useRef<boolean>(false);
|
||||
const [pagination, setPagination] = useState(defaultPagination);
|
||||
|
||||
const [filterParams, setFilterParams] = useState<Record<string, any>>({});
|
||||
@@ -95,6 +99,27 @@ const ClassMetricTable: React.FC<Props> = ({ domainManger, dispatch }) => {
|
||||
message.error(msg);
|
||||
};
|
||||
|
||||
const queryBatchUpdatePublish = async (ids: React.Key[], status: boolean) => {
|
||||
if (Array.isArray(ids) && ids.length === 0) {
|
||||
return;
|
||||
}
|
||||
const queryPublish = status ? batchMetricPublish : batchMetricUnPublish;
|
||||
const { code, msg } = await queryPublish({
|
||||
ids,
|
||||
});
|
||||
if (code === 200) {
|
||||
queryMetricList({ ...filterParams, ...defaultPagination });
|
||||
dispatch({
|
||||
type: 'domainManger/queryMetricList',
|
||||
payload: {
|
||||
modelId,
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
message.error(msg);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
queryMetricList({ ...filterParams, ...defaultPagination });
|
||||
}, [filterParams]);
|
||||
@@ -115,6 +140,11 @@ const ClassMetricTable: React.FC<Props> = ({ domainManger, dispatch }) => {
|
||||
current: pageNum,
|
||||
total,
|
||||
});
|
||||
|
||||
if (list.length === 0 && !initState.current) {
|
||||
onEmptyMetricData?.();
|
||||
}
|
||||
initState.current = true;
|
||||
setTableData(list);
|
||||
} else {
|
||||
message.error(msg);
|
||||
@@ -169,7 +199,22 @@ const ClassMetricTable: React.FC<Props> = ({ domainManger, dispatch }) => {
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'isPublish',
|
||||
title: '是否发布',
|
||||
width: 150,
|
||||
search: false,
|
||||
render: (isPublish) => {
|
||||
switch (isPublish) {
|
||||
case 0:
|
||||
return '否';
|
||||
case 1:
|
||||
return <span style={{ color: '#1677ff' }}>是</span>;
|
||||
default:
|
||||
return <Tag color="default">未知</Tag>;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
dataIndex: 'description',
|
||||
title: '描述',
|
||||
@@ -285,6 +330,12 @@ const ClassMetricTable: React.FC<Props> = ({ domainManger, dispatch }) => {
|
||||
case 'exportTagButton':
|
||||
queryBatchExportTag(selectedRowKeys);
|
||||
break;
|
||||
case 'batchPublish':
|
||||
queryBatchUpdatePublish(selectedRowKeys, true);
|
||||
break;
|
||||
case 'batchUnPublish':
|
||||
queryBatchUpdatePublish(selectedRowKeys, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -355,6 +406,28 @@ const ClassMetricTable: React.FC<Props> = ({ domainManger, dispatch }) => {
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: '是否为标签',
|
||||
component: (
|
||||
<Select
|
||||
style={{ width: 145 }}
|
||||
placeholder="请选择标签状态"
|
||||
allowClear
|
||||
onChange={(value) => {
|
||||
setFilterParams((preState) => {
|
||||
return {
|
||||
...preState,
|
||||
isTag: value,
|
||||
};
|
||||
});
|
||||
}}
|
||||
options={[
|
||||
{ value: 1, label: '是' },
|
||||
{ value: 0, label: '否' },
|
||||
]}
|
||||
/>
|
||||
),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
}
|
||||
@@ -400,7 +473,7 @@ const ClassMetricTable: React.FC<Props> = ({ domainManger, dispatch }) => {
|
||||
<BatchCtrlDropDownButton
|
||||
key="ctrlBtnList"
|
||||
downloadLoading={downloadLoading}
|
||||
extenderEnable={true}
|
||||
extenderList={['batchPublish', 'batchUnPublish', 'exportTagButton']}
|
||||
onDeleteConfirm={() => {
|
||||
queryBatchUpdateStatus(selectedRowKeys, StatusEnum.DELETED);
|
||||
}}
|
||||
|
||||
@@ -93,10 +93,12 @@ const DimensionInfoModal: React.FC<CreateFormProps> = ({
|
||||
};
|
||||
|
||||
const queryBatchDeleteTag = async (dimensionItem: ISemantic.IDimensionItem) => {
|
||||
const { code, msg } = await batchDeleteTag({
|
||||
itemIds: [dimensionItem.id],
|
||||
tagDefineType: TAG_DEFINE_TYPE.DIMENSION,
|
||||
});
|
||||
const { code, msg } = await batchDeleteTag([
|
||||
{
|
||||
itemIds: [dimensionItem.id],
|
||||
tagDefineType: TAG_DEFINE_TYPE.DIMENSION,
|
||||
},
|
||||
]);
|
||||
if (code === 200) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Tabs, Breadcrumb, Space } from 'antd';
|
||||
import React from 'react';
|
||||
import React, { useRef, useEffect } from 'react';
|
||||
import { connect, history } from 'umi';
|
||||
|
||||
import ClassDimensionTable from './ClassDimensionTable';
|
||||
@@ -41,10 +41,15 @@ const DomainManagerTab: React.FC<Props> = ({
|
||||
onBackDomainBtnClick,
|
||||
onMenuChange,
|
||||
}) => {
|
||||
const initState = useRef<boolean>(false);
|
||||
const defaultTabKey = 'metric';
|
||||
const { selectDomainId, domainList, selectModelId, selectModelName, selectDomainName } =
|
||||
const { selectDomainId, selectModelId, selectModelName, selectDomainName, domainData } =
|
||||
domainManger;
|
||||
|
||||
useEffect(() => {
|
||||
initState.current = false;
|
||||
}, [selectModelId]);
|
||||
|
||||
const tabItem = [
|
||||
{
|
||||
label: '模型管理',
|
||||
@@ -73,6 +78,7 @@ const DomainManagerTab: React.FC<Props> = ({
|
||||
{
|
||||
label: '标签对象管理',
|
||||
key: 'tagObjectManange',
|
||||
hidden: !!domainData?.parentId,
|
||||
children: <TagObjectTable />,
|
||||
},
|
||||
{
|
||||
@@ -96,8 +102,10 @@ const DomainManagerTab: React.FC<Props> = ({
|
||||
// children: <DatabaseTable />,
|
||||
// },
|
||||
].filter((item) => {
|
||||
const target = domainList.find((domain) => domain.id === selectDomainId);
|
||||
if (target?.hasEditPermission) {
|
||||
if (item.hidden) {
|
||||
return false;
|
||||
}
|
||||
if (domainData?.hasEditPermission) {
|
||||
return true;
|
||||
}
|
||||
return item.key !== 'permissonSetting';
|
||||
@@ -107,7 +115,16 @@ const DomainManagerTab: React.FC<Props> = ({
|
||||
{
|
||||
label: '指标管理',
|
||||
key: 'metric',
|
||||
children: <ClassMetricTable />,
|
||||
children: (
|
||||
<ClassMetricTable
|
||||
onEmptyMetricData={() => {
|
||||
if (!initState.current) {
|
||||
initState.current = true;
|
||||
onMenuChange?.('dimenstion');
|
||||
}
|
||||
}}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: '维度管理',
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { message, TreeSelect } from 'antd';
|
||||
import type { DataNode } from 'antd/lib/tree';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useEffect, useState, useRef } from 'react';
|
||||
import type { FC } from 'react';
|
||||
import { connect } from 'umi';
|
||||
import type { Dispatch } from 'umi';
|
||||
import type { StateType } from '../model';
|
||||
import { getDomainList } from '../../SemanticModel/service';
|
||||
import { constructorClassTreeFromList, addPathInTreeData } from '../utils';
|
||||
import styles from './style.less';
|
||||
@@ -13,78 +11,97 @@ import { ISemantic } from '../data';
|
||||
type Props = {
|
||||
value?: any;
|
||||
width?: number | string;
|
||||
firstLevelOnly?: boolean;
|
||||
onChange?: () => void;
|
||||
treeSelectProps?: Record<string, any>;
|
||||
domainList: ISemantic.IDomainItem[];
|
||||
dispatch: Dispatch;
|
||||
onDefaultValue?: (value?: number) => void;
|
||||
};
|
||||
|
||||
const DomainTreeSelect: FC<Props> = ({
|
||||
value,
|
||||
width = 300,
|
||||
width = 250,
|
||||
firstLevelOnly = false,
|
||||
onChange,
|
||||
onDefaultValue,
|
||||
treeSelectProps = {},
|
||||
domainList,
|
||||
dispatch,
|
||||
}) => {
|
||||
const [domainTree, setDomainTree] = useState<DataNode[]>([]);
|
||||
|
||||
const defaultValue = useRef<number>();
|
||||
const [initState, setInitState] = useState<boolean>(false);
|
||||
|
||||
const initProjectTree = async () => {
|
||||
const { code, data, msg } = await getDomainList();
|
||||
if (!initState) {
|
||||
setInitState(true);
|
||||
}
|
||||
const domainList = data;
|
||||
if (code === 200) {
|
||||
dispatch({
|
||||
type: 'domainManger/setDomainList',
|
||||
payload: { domainList: data },
|
||||
});
|
||||
const treeData = addPathInTreeData(constructorClassTreeFromList(domainList));
|
||||
if (firstLevelOnly) {
|
||||
const firstLevelNodes = treeData.map((item: any) => {
|
||||
return { ...item, children: [] };
|
||||
});
|
||||
defaultValue.current = firstLevelNodes[0]?.id;
|
||||
onDefaultValue?.(defaultValue.current);
|
||||
setDomainTree(firstLevelNodes);
|
||||
return;
|
||||
}
|
||||
setDomainTree(treeData);
|
||||
} else {
|
||||
message.error(msg);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (domainList.length === 0) {
|
||||
initProjectTree();
|
||||
}
|
||||
initProjectTree();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const treeData = addPathInTreeData(constructorClassTreeFromList(domainList));
|
||||
setDomainTree(treeData);
|
||||
}, [domainList]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={styles.domainTreeSelect}
|
||||
style={{
|
||||
width,
|
||||
}}
|
||||
>
|
||||
<TreeSelect
|
||||
showSearch
|
||||
style={{ width: '100%' }}
|
||||
value={value}
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
placeholder={'请选择主题域'}
|
||||
allowClear
|
||||
multiple
|
||||
treeNodeFilterProp="title"
|
||||
treeDefaultExpandAll
|
||||
onChange={onChange}
|
||||
treeData={domainTree}
|
||||
{...treeSelectProps}
|
||||
/>
|
||||
{defaultValue.current ? (
|
||||
<TreeSelect
|
||||
defaultValue={defaultValue.current}
|
||||
popupClassName={styles.domainSelector}
|
||||
showSearch
|
||||
key="defaultValue"
|
||||
style={{ width: '100%' }}
|
||||
value={value}
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
placeholder={'请选择主题域'}
|
||||
allowClear
|
||||
multiple
|
||||
treeNodeFilterProp="title"
|
||||
treeDefaultExpandAll
|
||||
onChange={onChange}
|
||||
treeData={domainTree}
|
||||
{...treeSelectProps}
|
||||
/>
|
||||
) : (
|
||||
<TreeSelect
|
||||
defaultValue={defaultValue.current}
|
||||
popupClassName={styles.domainSelector}
|
||||
showSearch
|
||||
key="preRender"
|
||||
style={{ width: '100%' }}
|
||||
value={value}
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
placeholder={'请选择主题域'}
|
||||
allowClear
|
||||
multiple
|
||||
treeNodeFilterProp="title"
|
||||
treeDefaultExpandAll
|
||||
onChange={onChange}
|
||||
treeData={domainTree}
|
||||
{...treeSelectProps}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default connect(
|
||||
({
|
||||
domainManger: { selectDomainId, selectDomainName, domainList },
|
||||
}: {
|
||||
domainManger: StateType;
|
||||
}) => ({
|
||||
selectDomainId,
|
||||
selectDomainName,
|
||||
domainList,
|
||||
}),
|
||||
)(DomainTreeSelect);
|
||||
export default DomainTreeSelect;
|
||||
|
||||
@@ -250,7 +250,7 @@ const MetricInfoCreateForm: React.FC<CreateFormProps> = ({
|
||||
dataFormat,
|
||||
dataFormatType,
|
||||
alias,
|
||||
tags,
|
||||
classifications,
|
||||
metricDefineType,
|
||||
metricDefineByMeasureParams,
|
||||
metricDefineByMetricParams,
|
||||
@@ -264,7 +264,7 @@ const MetricInfoCreateForm: React.FC<CreateFormProps> = ({
|
||||
bizName,
|
||||
sensitiveLevel,
|
||||
description,
|
||||
tags,
|
||||
classifications,
|
||||
isTag,
|
||||
// isPercent,
|
||||
dataFormatType: dataFormatType || '',
|
||||
@@ -396,10 +396,12 @@ const MetricInfoCreateForm: React.FC<CreateFormProps> = ({
|
||||
};
|
||||
|
||||
const queryBatchDelete = async (metricItem: ISemantic.IMetricItem) => {
|
||||
const { code, msg } = await batchDeleteTag({
|
||||
itemIds: [metricItem.id],
|
||||
tagDefineType: TAG_DEFINE_TYPE.METRIC,
|
||||
});
|
||||
const { code, msg } = await batchDeleteTag([
|
||||
{
|
||||
itemIds: [metricItem.id],
|
||||
tagDefineType: TAG_DEFINE_TYPE.METRIC,
|
||||
},
|
||||
]);
|
||||
if (code === 200) {
|
||||
return;
|
||||
}
|
||||
@@ -661,10 +663,10 @@ const MetricInfoCreateForm: React.FC<CreateFormProps> = ({
|
||||
)}
|
||||
</Row>
|
||||
</FormItem>
|
||||
<FormItem name="tags" label="标签">
|
||||
<FormItem name="classifications" label="分类">
|
||||
<Select
|
||||
mode="tags"
|
||||
placeholder="输入别名后回车确认,多别名输入、复制粘贴支持英文逗号自动分隔"
|
||||
placeholder="输入分类名后回车确认,多别名输入、复制粘贴支持英文逗号自动分隔"
|
||||
tokenSeparators={[',']}
|
||||
maxTagCount={9}
|
||||
options={tagOptions}
|
||||
|
||||
@@ -37,13 +37,13 @@ const MetricMeasuresFormTable: React.FC<Props> = ({
|
||||
);
|
||||
|
||||
const [selectedKeys, setSelectedKeys] = useState<string[]>(() => {
|
||||
return measuresParams?.measures.map((item: any) => {
|
||||
return measuresParams?.measures.map((item: ISemantic.IMeasure) => {
|
||||
return item.bizName;
|
||||
});
|
||||
});
|
||||
|
||||
const [selectedKeysMap, setSelectedKeysMap] = useState<Record<string, boolean>>(() => {
|
||||
return measuresParams.measures.reduce((keyMap, item: any) => {
|
||||
return measuresParams.measures.reduce((keyMap: any, item: ISemantic.IMeasure) => {
|
||||
keyMap[item.bizName] = true;
|
||||
return keyMap;
|
||||
}, {});
|
||||
|
||||
@@ -97,7 +97,7 @@ export const ColumnsConfig = (params?: {
|
||||
},
|
||||
indicatorInfo: {
|
||||
render: (_, record: ISemantic.IMetricItem) => {
|
||||
const { name, alias, bizName, tags, id, isCollect } = record;
|
||||
const { name, alias, bizName, classifications, id, isCollect } = record;
|
||||
let url = `/metric/detail/`;
|
||||
let starType: StarType = 'metric';
|
||||
if (params) {
|
||||
@@ -137,7 +137,7 @@ export const ColumnsConfig = (params?: {
|
||||
{bizName}
|
||||
</div>
|
||||
|
||||
{(alias || isArrayOfValues(tags)) && (
|
||||
{(alias || isArrayOfValues(classifications)) && (
|
||||
<div style={{ marginTop: 8 }}>
|
||||
<Space direction="vertical" size={4}>
|
||||
{alias && (
|
||||
@@ -181,16 +181,16 @@ export const ColumnsConfig = (params?: {
|
||||
</Space>
|
||||
)}
|
||||
|
||||
{isArrayOfValues(tags) && (
|
||||
{isArrayOfValues(classifications) && (
|
||||
<Space
|
||||
size={4}
|
||||
style={{ color: '#5f748d', fontSize: 12, margin: '5px 0 5px 0' }}
|
||||
>
|
||||
<TagsOutlined />
|
||||
<div style={{ width: 'max-content' }}>标签:</div>
|
||||
<div style={{ width: 'max-content' }}>分类:</div>
|
||||
<span style={{ marginLeft: 2 }}>
|
||||
<Space size={[0, 8]} wrap>
|
||||
{tags.map((tag: string) => {
|
||||
{classifications.map((tag: string) => {
|
||||
return (
|
||||
<Tag
|
||||
color="#eee"
|
||||
@@ -280,7 +280,7 @@ export const ColumnsConfig = (params?: {
|
||||
switch (status) {
|
||||
case StatusEnum.ONLINE:
|
||||
tagProps = {
|
||||
// color: 'success',
|
||||
// color: 'processing',
|
||||
color: 'geekblue',
|
||||
label: '已启用',
|
||||
};
|
||||
|
||||
@@ -285,20 +285,10 @@
|
||||
|
||||
|
||||
.domainSelector {
|
||||
display: flex;
|
||||
width: max-content;
|
||||
padding: 0 11px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
border-radius: 4px;
|
||||
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
||||
color: #000a24d9;
|
||||
.downIcon {
|
||||
margin-left: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
&:hover {
|
||||
color:#296DF3;
|
||||
:global {
|
||||
.ant-select-tree .ant-select-tree-treenode-active .ant-select-tree-node-content-wrapper {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user