From babcf4f0462ed0945fcefe59b1666d709910872c Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 04 三月 2024 16:00:55 +0800
Subject: [PATCH] Merge branch 'master' of http://47.97.1.152:5880/r/zy-asrs-master

---
 zy-asrs-flow/src/components/Flow/GraphConfig.jsx |   74 ++++++++++++++++++++++++++++++++----
 1 files changed, 65 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..4f8bf75 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,39 @@
     },
 }
 
-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
+    },
+}
+
+export { commonGraphPorts, commonGraphAttrs, initGraphConnecting }
\ No newline at end of file

--
Gitblit v1.9.1