temp
This commit is contained in:
@@ -27,7 +27,7 @@ import { NodeProperties } from './properties/NodeProperties';
|
||||
import { emitter } from '@kevisual/container';
|
||||
// router: Router
|
||||
const nodeTypes = {
|
||||
container: Container,
|
||||
// container: Container,
|
||||
};
|
||||
|
||||
export const Flow = () => {
|
||||
@@ -139,7 +139,7 @@ const ReactFlowApp = () => {
|
||||
message.error('developing');
|
||||
},
|
||||
});
|
||||
const { onNeedAdd, onAdd, onMouseMove, adding } = useAddNode();
|
||||
// const { onNeedAdd, onAdd, onMouseMove, adding } = useAddNode();
|
||||
const onSave = useCallback(() => {
|
||||
panelStore.saveNodesEdges({
|
||||
nodes,
|
||||
@@ -171,15 +171,15 @@ const ReactFlowApp = () => {
|
||||
e.preventDefault();
|
||||
}}
|
||||
onPaneClick={(e) => {
|
||||
if (adding) {
|
||||
onAdd();
|
||||
}
|
||||
// if (adding) {
|
||||
// onAdd();
|
||||
// }
|
||||
}}
|
||||
onNodeContextMenu={(e, node) => {
|
||||
console.log('context menu', e, node);
|
||||
onContextMenu(e as any, node);
|
||||
}}
|
||||
onMouseMove={(e) => onMouseMove(e)}
|
||||
// onMouseMove={(e) => onMouseMove(e)}
|
||||
onClick={(e) => {
|
||||
onClose();
|
||||
}}>
|
||||
@@ -194,7 +194,7 @@ const ReactFlowApp = () => {
|
||||
<Button
|
||||
icon={<PlusOutlined />}
|
||||
onClick={(e) => {
|
||||
onNeedAdd({ id: 'flow' + generateId(), data: { label: '容器' }, type: 'container' }, e);
|
||||
// onNeedAdd({ id: 'flow' + generateId(), data: { label: '容器' }, type: 'container' }, e);
|
||||
}}></Button>
|
||||
</Tooltip>
|
||||
<Tooltip title='save'>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { usePanelStore } from '../store';
|
||||
import { useShallow } from 'zustand/react/shallow';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { DialogModal } from '@kevisual/ui';
|
||||
import '@kevisual/ui';
|
||||
// import '@kevisual/ui';
|
||||
export const App = () => {
|
||||
const param = useParams();
|
||||
const id = param.id;
|
||||
|
||||
@@ -13,11 +13,11 @@ export const NodeProperties = () => {
|
||||
const reactflow = useReactFlow();
|
||||
const [open, setOpen] = useState(false);
|
||||
const [form] = Form.useForm();
|
||||
const panelStore = usePanelStore((state) => {
|
||||
const panelStore = usePanelStore(useShallow((state) => {
|
||||
return {
|
||||
updateNodeData: state.updateNodeData,
|
||||
};
|
||||
});
|
||||
}));
|
||||
const aiStore = useAiStore(
|
||||
useShallow((state) => {
|
||||
return {
|
||||
@@ -36,7 +36,7 @@ export const NodeProperties = () => {
|
||||
return item;
|
||||
});
|
||||
// console.log('newNodes', newNodes);
|
||||
// state.setNodes(newNodes); // 会丢失数据,因为最终没有调用context的setNodes方法
|
||||
state.setNodes(newNodes); // 会丢失数据,因为最终没有调用context的setNodes方法
|
||||
emitter.emit('setNodes', newNodes);
|
||||
};
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user