1
This commit is contained in:
parent
3bb012457b
commit
296b5d3b9e
@ -1,5 +1,5 @@
|
|||||||
import React, {useState, useEffect} from 'react';
|
import React, {useState, useEffect} from 'react';
|
||||||
import {Card, Collapse, Tooltip, message} from 'antd';
|
import {Card, Collapse, Tooltip, message, Spin} from 'antd';
|
||||||
import type {NodeDefinition, NodeCategory} from '../types';
|
import type {NodeDefinition, NodeCategory} from '../types';
|
||||||
import {
|
import {
|
||||||
PlayCircleOutlined,
|
PlayCircleOutlined,
|
||||||
@ -144,8 +144,10 @@ const NodePanel: React.FC<NodePanelProps> = ({onNodeDragStart}) => {
|
|||||||
padding: '12px 16px'
|
padding: '12px 16px'
|
||||||
};
|
};
|
||||||
|
|
||||||
// 构建折叠面板的 items
|
// 构建折叠面板的 items,只包含有节点的分类
|
||||||
const collapseItems = Object.entries(categoryConfig).map(([category, {label, key}]) => ({
|
const collapseItems = Object.entries(categoryConfig)
|
||||||
|
.filter(([category]) => groupedNodes[category as NodeCategory]?.length > 0) // 过滤掉没有节点的分类
|
||||||
|
.map(([category, {label, key}]) => ({
|
||||||
key,
|
key,
|
||||||
label: <span style={{fontSize: '14px', fontWeight: 500}}>{label}</span>,
|
label: <span style={{fontSize: '14px', fontWeight: 500}}>{label}</span>,
|
||||||
children: (
|
children: (
|
||||||
@ -205,7 +207,7 @@ const NodePanel: React.FC<NodePanelProps> = ({onNodeDragStart}) => {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
),
|
)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user