|
@@ -14,6 +14,7 @@ import { handleGraphEvent, handleGraphApiEvent } from "@/events/flowEvent";
|
|
import { pageMenu, nodeMenu, edgeMenu } from "@/utils/contentMenu";
|
|
import { pageMenu, nodeMenu, edgeMenu } from "@/utils/contentMenu";
|
|
import { bindKeys } from "@/utils/fastKey";
|
|
import { bindKeys } from "@/utils/fastKey";
|
|
import { useSessionStorageState } from "ahooks";
|
|
import { useSessionStorageState } from "ahooks";
|
|
|
|
+import { handleSetEdgeStyle } from "@/utils";
|
|
|
|
|
|
export default function GraphModel() {
|
|
export default function GraphModel() {
|
|
const [graph, setGraph] = useState<Graph>();
|
|
const [graph, setGraph] = useState<Graph>();
|
|
@@ -45,7 +46,6 @@ export default function GraphModel() {
|
|
};
|
|
};
|
|
|
|
|
|
const addPageNode = () => {
|
|
const addPageNode = () => {
|
|
- console.log('增加画布节点')
|
|
|
|
const graph = graphRef.current;
|
|
const graph = graphRef.current;
|
|
pageNodeRef.current = graph?.addNode({
|
|
pageNodeRef.current = graph?.addNode({
|
|
shape: "page-container-node",
|
|
shape: "page-container-node",
|
|
@@ -136,6 +136,14 @@ export default function GraphModel() {
|
|
});
|
|
});
|
|
}, [pageState]);
|
|
}, [pageState]);
|
|
|
|
|
|
|
|
+ // 修改跨线展示
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ const edges = graphRef.current?.getEdges();
|
|
|
|
+ (edges || []).forEach(edge => {
|
|
|
|
+ handleSetEdgeStyle(edge, edge.data?.connectorType, pageState.jumpOver);
|
|
|
|
+ });
|
|
|
|
+ }, [pageState.jumpOver]);
|
|
|
|
+
|
|
const enabledTransform = (node: Node) => {
|
|
const enabledTransform = (node: Node) => {
|
|
const data = node.getData<{ isPage: boolean; lock: boolean }>();
|
|
const data = node.getData<{ isPage: boolean; lock: boolean }>();
|
|
return !data?.isPage && !data?.lock;
|
|
return !data?.isPage && !data?.lock;
|