From 5a456d046ff4c15422200aeec1904d89f4758d36 Mon Sep 17 00:00:00 2001 From: ZLY Date: Fri, 24 Oct 2025 16:15:45 +0800 Subject: [PATCH] =?UTF-8?q?feat(ide):=20=E6=B7=BB=E5=8A=A0=E5=A4=8D?= =?UTF-8?q?=E6=9D=82=E6=B5=81=E7=A8=8B=E7=BC=96=E6=8E=92=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/flowEditor/utils/projectFlowHandle.ts | 2 +- src/pages/ideContainer/index.tsx | 5 ++++- src/pages/ideContainer/navBar.tsx | 6 ++++-- src/pages/ideContainer/sideBar.tsx | 10 ++++++---- src/pages/ideContainer/types/index.ts | 1 + src/pages/orchestration/complex/index.tsx | 11 +++++++++++ 6 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 src/pages/orchestration/complex/index.tsx diff --git a/src/pages/flowEditor/utils/projectFlowHandle.ts b/src/pages/flowEditor/utils/projectFlowHandle.ts index b68df72..6f86781 100644 --- a/src/pages/flowEditor/utils/projectFlowHandle.ts +++ b/src/pages/flowEditor/utils/projectFlowHandle.ts @@ -10,7 +10,7 @@ export const projectFlowHandle = (initialData, useDefault, setNodes, setEdges, d const { nodes: convertedNodes, edges: convertedEdges - } = convertFlowData(initialData?.main.components, useDefault); + } = convertFlowData(initialData?.main?.components || initialData?.compData?.components, useDefault); // 为所有边添加类型 const initialEdges: Edge[] = convertedEdges.map(edge => ({ diff --git a/src/pages/ideContainer/index.tsx b/src/pages/ideContainer/index.tsx index 0cd0b0b..4395fdb 100644 --- a/src/pages/ideContainer/index.tsx +++ b/src/pages/ideContainer/index.tsx @@ -18,6 +18,7 @@ import { getAppListBySceneId } from '@/api/apps'; import { getProjectComp } from '@/api/scene'; import ProjectContainer from '@/pages/orchestration/project'; +import ComplexContainer from '@/pages/orchestration/complex'; import ApplicationContainer from '@/pages/orchestration/application'; import EventContainer from '@/pages/orchestration/event'; import GlobalVarContainer from '@/pages/orchestration/globalVar'; @@ -46,7 +47,7 @@ const EnvConfig = () =>
环境配 // 所有可显示的组件路径列表 const ALL_PATHS = [ - 'compFlow', 'appFlow', 'compList', 'appInstance', 'event', 'globalVar', 'appCompList', + 'compFlow', 'complexFlow', 'appFlow', 'compList', 'appInstance', 'event', 'globalVar', 'appCompList', 'myComponents', 'matchingComponents', 'componentReview', 'componentList', 'componentCoding', 'componentDeployment', 'componentTest', 'envConfig' ]; @@ -220,6 +221,8 @@ function IDEContainer() { switch (path) { case 'compFlow': return ; + case 'complexFlow': + return ; case 'appFlow': return ; case 'compList': diff --git a/src/pages/ideContainer/navBar.tsx b/src/pages/ideContainer/navBar.tsx index 6bf5fbe..0461c2e 100644 --- a/src/pages/ideContainer/navBar.tsx +++ b/src/pages/ideContainer/navBar.tsx @@ -53,6 +53,7 @@ const NavBar: React.ForwardRefRenderFunction = ({ const key = selected.key; const parentKey = selected.parentKey; const title = selected.title; + const pathTitle = selected?.pathTitle || null; // 检查tab是否已存在 const existingTab = tabs.find(tab => tab.key === (key) && tab.title === title); @@ -63,7 +64,8 @@ const NavBar: React.ForwardRefRenderFunction = ({ key: key, parentKey: parentKey, title: title, - path: path + path: path, + pathTitle: pathTitle }; setTabs(prev => [...prev, newTab]); @@ -128,7 +130,7 @@ const NavBar: React.ForwardRefRenderFunction = ({ ))} diff --git a/src/pages/ideContainer/sideBar.tsx b/src/pages/ideContainer/sideBar.tsx index ff3415b..1fdb3fb 100644 --- a/src/pages/ideContainer/sideBar.tsx +++ b/src/pages/ideContainer/sideBar.tsx @@ -310,12 +310,11 @@ const SideBar: React.FC = ({ }, [menu, searchValue, activeKey]); const getProjectEnvData = async (data) => { - if (!data.path || !data.key) return; + if (!data.path || !data.key || data.hasOwnProperty('compData')) return; const parentKey = menu[activeKey]?.key; const currentMenu = _.cloneDeep(menuData[identity]); const index = currentMenu.findIndex(v => v.key === parentKey); const res: any = await getAppInfoNew(data.id); - console.log('res.data:', res.data.subs); if (res.code === 200) { const children = currentMenu[index].children.find(v => v.id === data.id); children.children[0].children = res.data.events.map(item => { @@ -340,7 +339,11 @@ const SideBar: React.FC = ({ title: info.flowName, children: null, icon: '/ideContainer/icon/tool.png', - compData: info + compData: info, + path: 'complexFlow', + key: info.flowId, + pathTitle: `${data.title} / ${info.flowName}`, + parentKey: 'appList' }; }) }; @@ -614,7 +617,6 @@ const SideBar: React.FC = ({ onSelect={async (_selectedKeys, info) => { const selectedNode = info.node; const originalData = selectedNode.props.dataRef; - console.log(originalData); if (selected?.parentKey === 'appList') { await getProjectEnvData(originalData); diff --git a/src/pages/ideContainer/types/index.ts b/src/pages/ideContainer/types/index.ts index cdc985a..903ab88 100644 --- a/src/pages/ideContainer/types/index.ts +++ b/src/pages/ideContainer/types/index.ts @@ -4,4 +4,5 @@ export interface Selected { key?: string; parentKey?: string; children?: Selected[]; + pathTitle?: string; } \ No newline at end of file diff --git a/src/pages/orchestration/complex/index.tsx b/src/pages/orchestration/complex/index.tsx new file mode 100644 index 0000000..8119ed0 --- /dev/null +++ b/src/pages/orchestration/complex/index.tsx @@ -0,0 +1,11 @@ +import React, { useEffect, useState } from 'react'; +import FlowEditor from '@/pages/flowEditor/index'; + +const complexContainer = ({ selected }) => { + + return ( + + ); +}; + +export default complexContainer; \ No newline at end of file