diff --git a/src/pages/flowEditor/components/nodeContentOther.tsx b/src/pages/flowEditor/components/nodeContentOther.tsx index 1aea57f..5dd968c 100644 --- a/src/pages/flowEditor/components/nodeContentOther.tsx +++ b/src/pages/flowEditor/components/nodeContentOther.tsx @@ -238,37 +238,41 @@ const NodeContent = ({ data }: { data: NodeContentData }) => { )} + {(dataIns.length || dataOuts.length) && ( + <> + {/*分割*/} +
+ 中间分割 +
-
- 中间分割 -
- - {/*content栏-data部分*/} -
-
- {dataIns.length > 0 && !isStartNode && ( -
- {dataIns.map((input, index) => ( -
- {input.id || `输入${index + 1}`} + {/*content栏-data部分*/} +
+
+ {dataIns.length > 0 && !isStartNode && ( +
+ {dataIns.map((input, index) => ( +
+ {input.id || `输入${index + 1}`} +
+ ))}
- ))} -
- )} + )} - {dataOuts.length > 0 && !isEndNode && ( -
- {dataOuts.map((output, index) => ( -
- {output.id || `输出${index + 1}`} + {dataOuts.length > 0 && !isEndNode && ( +
+ {dataOuts.map((output, index) => ( +
+ {output.id || `输出${index + 1}`} +
+ ))}
- ))} + )}
- )} -
-
+
+ + )} {/*footer栏*/} {showFooter && ( diff --git a/src/pages/flowEditor/node/basicNode/BasicNode.tsx b/src/pages/flowEditor/node/basicNode/BasicNode.tsx index 8976c54..050aced 100644 --- a/src/pages/flowEditor/node/basicNode/BasicNode.tsx +++ b/src/pages/flowEditor/node/basicNode/BasicNode.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import styles from '@/pages/flowEditor/node/style/base.module.less'; -// import styles from '@/pages/flowEditor/node/style/baseOther.module.less'; +// import styles from '@/pages/flowEditor/node/style/base.module.less'; +import styles from '@/pages/flowEditor/node/style/baseOther.module.less'; import NodeContent from '@/pages/flowEditor/components/nodeContent'; import NodeContentOther from '@/pages/flowEditor/components/nodeContentOther'; import { useStore } from '@xyflow/react'; @@ -21,8 +21,8 @@ const BasicNode = ({ data, id }: { data: defaultNodeTypes; id: string }) => { {title}
- - {/**/} + {/**/} +
); }; diff --git a/src/pages/flowEditor/node/endNode/EndNode.tsx b/src/pages/flowEditor/node/endNode/EndNode.tsx index 27852d9..726254c 100644 --- a/src/pages/flowEditor/node/endNode/EndNode.tsx +++ b/src/pages/flowEditor/node/endNode/EndNode.tsx @@ -1,15 +1,17 @@ import React from 'react'; -import styles from '@/pages/flowEditor/node/style/base.module.less'; +// import styles from '@/pages/flowEditor/node/style/base.module.less'; +import styles from '@/pages/flowEditor/node/style/baseOther.module.less'; import NodeContent from '@/pages/flowEditor/components/nodeContent'; import { useStore } from '@xyflow/react'; import { defaultNodeTypes } from '@/pages/flowEditor/node/types/defaultType'; +import NodeContentOther from '@/pages/flowEditor/components/nodeContentOther'; const EndNode = ({ data, id }: { data: defaultNodeTypes; id: string }) => { const title = data.title || '结束'; // 获取节点选中状态 - 适配React Flow v12 API - const isSelected = useStore((state) => + const isSelected = useStore((state) => state.nodeLookup.get(id)?.selected || false ); @@ -19,7 +21,8 @@ const EndNode = ({ data, id }: { data: defaultNodeTypes; id: string }) => { {title}
- + {/**/} + ); }; diff --git a/src/pages/flowEditor/node/localNode/LocalNode.tsx b/src/pages/flowEditor/node/localNode/LocalNode.tsx index 41383fe..2bcde28 100644 --- a/src/pages/flowEditor/node/localNode/LocalNode.tsx +++ b/src/pages/flowEditor/node/localNode/LocalNode.tsx @@ -1,8 +1,10 @@ import React from 'react'; import { useStore } from '@xyflow/react'; -import styles from '@/pages/flowEditor/node/style/base.module.less'; +// import styles from '@/pages/flowEditor/node/style/base.module.less'; +import styles from '@/pages/flowEditor/node/style/baseOther.module.less'; import NodeContent from '@/pages/flowEditor/components/nodeContent'; import DynamicIcon from '@/components/DynamicIcon'; +import NodeContentOther from '@/pages/flowEditor/components/nodeContentOther'; const setIcon = (nodeType: string) => { @@ -71,7 +73,8 @@ const LocalNode = ({ data, id }: { data: any; id: string }) => { {setIcon(data.type)} {title} - + {/**/} + ); }; diff --git a/src/pages/flowEditor/node/startNode/StartNode.tsx b/src/pages/flowEditor/node/startNode/StartNode.tsx index 6ea0b48..a579e74 100644 --- a/src/pages/flowEditor/node/startNode/StartNode.tsx +++ b/src/pages/flowEditor/node/startNode/StartNode.tsx @@ -1,8 +1,10 @@ import React from 'react'; -import styles from '@/pages/flowEditor/node/style/base.module.less'; +// import styles from '@/pages/flowEditor/node/style/base.module.less'; +import styles from '@/pages/flowEditor/node/style/baseOther.module.less'; import NodeContent from '@/pages/flowEditor/components/nodeContent'; import { useStore } from '@xyflow/react'; import { defaultNodeTypes } from '@/pages/flowEditor/node/types/defaultType'; +import NodeContentOther from '@/pages/flowEditor/components/nodeContentOther'; const StartNode = ({ data, id }: { data: defaultNodeTypes; id: string }) => { @@ -19,7 +21,8 @@ const StartNode = ({ data, id }: { data: defaultNodeTypes; id: string }) => { {title} - + {/**/} + ); }; diff --git a/src/store/index.ts b/src/store/index.ts index 2cf52a5..a214795 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,12 +1,14 @@ import { configureStore } from '@reduxjs/toolkit'; import globalReducer from './global'; import userReducer from './user'; +import ideContainerReducer from './ideContainer'; // 创建 store const store = configureStore({ reducer: { global: globalReducer, - user: userReducer + user: userReducer, + ideContainer: ideContainerReducer } });