|
|
|
|
@ -12,7 +12,7 @@ import {
|
|
|
|
|
Menu,
|
|
|
|
|
Popconfirm
|
|
|
|
|
} from '@arco-design/web-react';
|
|
|
|
|
import { IconApps, IconMore } from '@arco-design/web-react/icon';
|
|
|
|
|
import { IconApps, IconMore, IconDelete, IconEdit } from '@arco-design/web-react/icon';
|
|
|
|
|
import { menuData1, menuData2 } from './config/menuData';
|
|
|
|
|
import { IconSearch, IconPlus } from '@arco-design/web-react/icon';
|
|
|
|
|
import { Selected } from '@/pages/ideContainer/types';
|
|
|
|
|
@ -180,14 +180,17 @@ const SideBar: React.FC<SideBarProps> = ({ selected, identity, subMenuData, onMe
|
|
|
|
|
v.key = `compFlow-${v.id}`;
|
|
|
|
|
v.path = 'compFlow';
|
|
|
|
|
v.parentKey = subMenuKey;
|
|
|
|
|
v.icon = '/ideContainer/icon/app.png';
|
|
|
|
|
v.children = [
|
|
|
|
|
{
|
|
|
|
|
title: '事件',
|
|
|
|
|
children: null
|
|
|
|
|
children: null,
|
|
|
|
|
icon: '/ideContainer/icon/list.png'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '组件列表',
|
|
|
|
|
children: null
|
|
|
|
|
children: null,
|
|
|
|
|
icon: '/ideContainer/icon/list.png'
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
});
|
|
|
|
|
@ -243,16 +246,19 @@ const SideBar: React.FC<SideBarProps> = ({ selected, identity, subMenuData, onMe
|
|
|
|
|
children.children[0].children = res.data.events.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
title: item,
|
|
|
|
|
children: null
|
|
|
|
|
children: null,
|
|
|
|
|
icon: '/ideContainer/icon/list.png'
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
children.children[1].children = Object.keys(res.data.compList).map(item => {
|
|
|
|
|
return {
|
|
|
|
|
title: compTypeMap[item],
|
|
|
|
|
icon: item === 'appComponent' ? '/ideContainer/icon/app1.png' : '/ideContainer/icon/complexApp.png',
|
|
|
|
|
children: res.data.compList[item].map(item => {
|
|
|
|
|
return {
|
|
|
|
|
title: item,
|
|
|
|
|
children: null
|
|
|
|
|
children: null,
|
|
|
|
|
icon: '/ideContainer/icon/tool.png'
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
@ -265,6 +271,7 @@ const SideBar: React.FC<SideBarProps> = ({ selected, identity, subMenuData, onMe
|
|
|
|
|
|
|
|
|
|
// 同时更新本地 menu 状态以触发重新渲染
|
|
|
|
|
setMenu(prevMenu => {
|
|
|
|
|
console.log('prevMenu:', prevMenu);
|
|
|
|
|
const newMenu = [...prevMenu];
|
|
|
|
|
newMenu[activeKey] = { ...newMenu[activeKey], children: currentMenu[index].children };
|
|
|
|
|
return newMenu;
|
|
|
|
|
@ -284,13 +291,23 @@ const SideBar: React.FC<SideBarProps> = ({ selected, identity, subMenuData, onMe
|
|
|
|
|
};
|
|
|
|
|
if (item.children && item.children.length > 0) {
|
|
|
|
|
return (
|
|
|
|
|
<TreeNode {...treeNodeProps} title={item.title} key={key}>
|
|
|
|
|
<TreeNode
|
|
|
|
|
{...treeNodeProps}
|
|
|
|
|
title={item.title}
|
|
|
|
|
key={key}
|
|
|
|
|
icon={item?.icon ? <img src={item.icon as string} style={{ width: 14, height: 14 }} /> : null}
|
|
|
|
|
>
|
|
|
|
|
{renderMenuItems(item.children, key)}
|
|
|
|
|
</TreeNode>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return <TreeNode {...treeNodeProps} title={item.title} key={key} />;
|
|
|
|
|
return (<TreeNode
|
|
|
|
|
{...treeNodeProps}
|
|
|
|
|
title={item.title}
|
|
|
|
|
key={key}
|
|
|
|
|
icon={item?.icon ? <img src={item.icon as string} style={{ width: 14, height: 14 }} /> : null}
|
|
|
|
|
/>);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
@ -317,7 +334,11 @@ const SideBar: React.FC<SideBarProps> = ({ selected, identity, subMenuData, onMe
|
|
|
|
|
setModalType('EDIT');
|
|
|
|
|
setShowModal(true);
|
|
|
|
|
}}
|
|
|
|
|
>编辑信息
|
|
|
|
|
>
|
|
|
|
|
<span style={{ color: 'rgba(161, 165, 194, 1)' }}>
|
|
|
|
|
<IconEdit style={{ marginRight: 6 }} />
|
|
|
|
|
编辑信息
|
|
|
|
|
</span>
|
|
|
|
|
</MenuItem>
|
|
|
|
|
<MenuItem
|
|
|
|
|
key="deleteApp"
|
|
|
|
|
@ -339,7 +360,10 @@ const SideBar: React.FC<SideBarProps> = ({ selected, identity, subMenuData, onMe
|
|
|
|
|
});
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
删除应用
|
|
|
|
|
<span style={{ color: 'rgba(255, 82, 25, 1)' }}>
|
|
|
|
|
<IconDelete style={{ marginRight: 6 }} />
|
|
|
|
|
删除应用
|
|
|
|
|
</span>
|
|
|
|
|
</MenuItem>
|
|
|
|
|
</Menu>
|
|
|
|
|
);
|
|
|
|
|
|