liyangzheng 1 gadu atpakaļ
vecāks
revīzija
55e1235d05
1 mainītis faili ar 11 papildinājumiem un 4 dzēšanām
  1. 11 4
      src/pages/mapLoad/FatherMap.vue

+ 11 - 4
src/pages/mapLoad/FatherMap.vue

@@ -286,7 +286,6 @@ const addNode = (newInfo) => {
     newInfo = Object.assign(newInfo, globalConfig);
     info.value.push(newInfo);
     console.log(newInfo, "???新增节点的信息");
-    // makeFun(newInfo)
     nextTick(() => {
         renderFlag.value = "new";
         makeFun(newInfo);
@@ -406,9 +405,16 @@ const renderNode = (flag) => {
 };
 //设置节点可连接属性
 const makeFun = (item) => {
-    plumbInit.setSourceEnabled(item.id, item.isSource);
-    plumbInit.setTargetEnabled(item.id, item.isTarget);
-    plumbInit.setDraggable(item.id, true);
+    var common = {
+        isSource: true,
+        isTarget: true,
+        connector: ['Straight'],
+        overlays: [['Arrow', { width: 12, length: 12, location: 0.5 }]]
+    }
+    plumbInit.addEndpoint(item.id + '', common)
+    // plumbInit.setSourceEnabled(item.id, { anchors: ['Right'] }, common);
+    // plumbInit.setTargetEnabled(item.id, { anchors: ['Right'] }, common);
+    // plumbInit.setDraggable(item.id, true);
     plumbInit.makeSource(item.id, {
         filter: ".plumbNode",
         filterExclude: false,
@@ -444,6 +450,7 @@ const makeFun = (item) => {
             item.top = el.pos[1];
         },
     });
+    console.log(item, 'item555');
 };
 
 // 给元素设置渲染样式