Browse Source

feat: 添加逻辑节点

Gaokun Wang 2 weeks ago
parent
commit
f7e196748f
2 changed files with 7 additions and 26 deletions
  1. 0 1
      src/views/graph/index.ts
  2. 7 25
      src/views/graph/shape.ts

+ 0 - 1
src/views/graph/index.ts

@@ -199,7 +199,6 @@ export default class FlowGraph {
         {
           name: 'logic',
           title: '逻辑节点'
-          // graphHeight: 180
         },
         {
           name: 's-pro',

+ 7 - 25
src/views/graph/shape.ts

@@ -73,21 +73,9 @@ export const SubRect = Graph.registerNode('sub-flow-rect', {
       fontSize: 12,
       fill: 'rgba(0,0,0,0.6)',
       'text-anchor': 'start'
-    },
-    lip: {
-      fill: '#d4237a',
-      refX: 10
-      // transform: 'scale(0.02)'
     }
   },
   markup: [
-    {
-      tagName: 'path',
-      selector: 'lip',
-      attrs: {
-        d: 'M366.336 270.506667c20.736 19.029333 21.333333 49.493333 1.536 68.949333l-1.536 1.536L131.84 554.666667l234.496 213.674666c20.736 18.944 21.333333 49.322667 1.536 68.864l-1.536 1.536a58.538667 58.538667 0 0 1-75.605333 1.450667l-1.706667-1.450667-273.066667-248.917333a46.677333 46.677333 0 0 1-1.536-68.864l1.536-1.450667 273.066667-248.917333a58.453333 58.453333 0 0 1 77.312 0z m593.92 425.216c35.242667 0 63.744 26.709333 63.744 59.733333 0 32.256-27.306667 58.624-61.525333 59.733333H509.696c-35.157333 0-63.658667-26.794667-63.658667-59.733333 0-32.341333 27.306667-58.624 61.44-59.733333h452.778667z m0-398.250667c35.242667 0 63.744 26.794667 63.744 59.733333 0 32.341333-27.306667 58.624-61.525333 59.733334H509.696c-35.157333 0-63.658667-26.709333-63.658667-59.733334 0-32.256 27.306667-58.624 61.44-59.733333h452.778667z'
-      }
-    },
     {
       tagName: 'rect',
       selector: 'body'
@@ -106,33 +94,27 @@ export const SubRect = Graph.registerNode('sub-flow-rect', {
 
 // 逻辑节点
 export const logicPath = Graph.registerNode('logic-flow-path', {
-  inherit: 'rect',
-  width: 80,
-  height: 42,
+  inherit: 'circle',
+  width: 20,
+  height: 20,
   attrs: {
     body: {
       stroke: '#5F95FF',
       strokeWidth: 1,
       fill: '#ffffff'
     },
-    text: {
-      fontSize: 12,
-      fill: '#080808'
-    },
     lip: {
+      refX: 4,
+      refY: 4,
       fill: '#d4237a',
-      transform: 'scale(0.02)'
+      transform: 'scale(0.01)'
     }
   },
   markup: [
     {
-      tagName: 'rect',
+      tagName: 'circle',
       selector: 'body'
     },
-    {
-      tagName: 'text',
-      selector: 'text'
-    },
     {
       tagName: 'path',
       selector: 'lip',