|
|
@@ -18,7 +18,7 @@ For commercial licensing, please contact [email protected]
|
|
|
*/
|
|
|
|
|
|
import React from 'react';
|
|
|
-import { Button, Space, Tag, Typography, Modal } from '@douyinfe/semi-ui';
|
|
|
+import { Button, Space, Tag, Typography, Modal, Tooltip } from '@douyinfe/semi-ui';
|
|
|
import {
|
|
|
timestamp2string,
|
|
|
getLobeHubIcon,
|
|
|
@@ -208,8 +208,8 @@ const renderOperations = (text, record, setEditingModel, setShowEdit, manageMode
|
|
|
);
|
|
|
};
|
|
|
|
|
|
-// 名称匹配类型渲染
|
|
|
-const renderNameRule = (rule, t) => {
|
|
|
+// 名称匹配类型渲染(带匹配数量 Tooltip)
|
|
|
+const renderNameRule = (rule, record, t) => {
|
|
|
const map = {
|
|
|
0: { color: 'green', label: t('精确') },
|
|
|
1: { color: 'blue', label: t('前缀') },
|
|
|
@@ -218,11 +218,27 @@ const renderNameRule = (rule, t) => {
|
|
|
};
|
|
|
const cfg = map[rule];
|
|
|
if (!cfg) return '-';
|
|
|
- return (
|
|
|
+
|
|
|
+ let label = cfg.label;
|
|
|
+ if (rule !== 0 && record.matched_count) {
|
|
|
+ label = `${cfg.label} ${record.matched_count}${t('个模型')}`;
|
|
|
+ }
|
|
|
+
|
|
|
+ const tagElement = (
|
|
|
<Tag color={cfg.color} size="small" shape='circle'>
|
|
|
- {cfg.label}
|
|
|
+ {label}
|
|
|
</Tag>
|
|
|
);
|
|
|
+
|
|
|
+ if (rule === 0 || !record.matched_models || record.matched_models.length === 0) {
|
|
|
+ return tagElement;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (
|
|
|
+ <Tooltip content={record.matched_models.join(', ')} showArrow>
|
|
|
+ {tagElement}
|
|
|
+ </Tooltip>
|
|
|
+ );
|
|
|
};
|
|
|
|
|
|
export const getModelsColumns = ({
|
|
|
@@ -253,7 +269,7 @@ export const getModelsColumns = ({
|
|
|
{
|
|
|
title: t('匹配类型'),
|
|
|
dataIndex: 'name_rule',
|
|
|
- render: (val) => renderNameRule(val, t),
|
|
|
+ render: (val, record) => renderNameRule(val, record, t),
|
|
|
},
|
|
|
{
|
|
|
title: t('描述'),
|