From c7a81b2a1d9d3e0e3809e5ecc11d2e64e51e3d2c Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 09 四月 2024 15:24:11 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/components/Flow/GraphConfig.jsx | 87 +++++++++++++++++++++++++++++++++++++++----
1 files changed, 78 insertions(+), 9 deletions(-)
diff --git a/zy-asrs-flow/src/components/Flow/GraphConfig.jsx b/zy-asrs-flow/src/components/Flow/GraphConfig.jsx
index b2c9136..646a93b 100644
--- a/zy-asrs-flow/src/components/Flow/GraphConfig.jsx
+++ b/zy-asrs-flow/src/components/Flow/GraphConfig.jsx
@@ -1,4 +1,5 @@
import React, { useRef, useEffect } from "react";
+import { Graph, Shape } from "@antv/x6";
const commonGraphPorts = {
groups: {
@@ -6,9 +7,14 @@
position: 'top',
attrs: {
circle: {
- magnet: true,
- stroke: '#8f8f8f',
r: 5,
+ magnet: true,
+ stroke: '#5F95FF',
+ strokeWidth: 1,
+ fill: '#fff',
+ style: {
+ visibility: 'hidden',
+ },
},
},
},
@@ -16,9 +22,14 @@
position: 'bottom',
attrs: {
circle: {
- magnet: true,
- stroke: '#8f8f8f',
r: 5,
+ magnet: true,
+ stroke: '#5F95FF',
+ strokeWidth: 1,
+ fill: '#fff',
+ style: {
+ visibility: 'hidden',
+ },
},
},
},
@@ -26,9 +37,14 @@
position: 'left',
attrs: {
circle: {
- magnet: true,
- stroke: '#8f8f8f',
r: 5,
+ magnet: true,
+ stroke: '#5F95FF',
+ strokeWidth: 1,
+ fill: '#fff',
+ style: {
+ visibility: 'hidden',
+ },
},
},
},
@@ -36,9 +52,14 @@
position: 'right',
attrs: {
circle: {
- magnet: true,
- stroke: '#8f8f8f',
r: 5,
+ magnet: true,
+ stroke: '#5F95FF',
+ strokeWidth: 1,
+ fill: '#fff',
+ style: {
+ visibility: 'hidden',
+ },
},
},
},
@@ -71,4 +92,52 @@
},
}
-export { commonGraphPorts, commonGraphAttrs }
\ No newline at end of file
+const initGraphConnecting = {
+ // router: 'manhattan',
+ connector: {
+ name: 'rounded',
+ args: {
+ radius: 8,
+ },
+ },
+ anchor: 'center',
+ connectionPoint: 'anchor',
+ allowBlank: false,
+ snap: {
+ radius: 20,
+ },
+ createEdge() {
+ return new Shape.Edge({
+ attrs: {
+ line: {
+ stroke: '#A2B1C3',
+ strokeWidth: 2,
+ targetMarker: {
+ name: 'block',
+ width: 12,
+ height: 8,
+ },
+ },
+ },
+ zIndex: 0,
+ })
+ },
+ validateConnection({ targetMagnet }) {
+ return !!targetMagnet
+ },
+}
+
+const initNodeData = {
+ codeContent: null,
+ root: false,//榛樿涓嶆槸鏍硅妭鐐�
+ isLogic: false,//榛樿涓嶆槸閫昏緫鍒ゆ柇
+ logicBool: false,//閫昏緫鍒ゆ柇榛樿鍊�
+ searchLogicId: 1,//榛樿閫昏緫id
+ searchLogicBool: true,//榛樿閫昏緫id鏂瑰悜
+ searchIndex: 0,//榛樿鎵ц浼樺厛绾�
+ type: "none", //缁勪欢绫诲瀷
+ execClass: null,//鎵ц绫�
+ execApi: null,//鎵ц鎺ュ彛
+}
+
+export { commonGraphPorts, commonGraphAttrs, initGraphConnecting, initNodeData }
\ No newline at end of file
--
Gitblit v1.9.1