Bläddra i källkod

数据同步问题

CzRger 4 månader sedan
förälder
incheckning
1afdfa04f1

+ 4 - 0
src/views/workflow/chart/context-menu-tool.vue

@@ -19,8 +19,12 @@ const {proxy}: any = getCurrentInstance()
 const state: any = reactive({
 })
 const onDel = () => {
+  WorkflowStore.graph.startBatch('node-del')
   WorkflowStore.graph.removeEdge(props.data.id)
   WorkflowStore.graph.removeNode(props.data.id)
+  setTimeout(() => {
+    WorkflowStore.graph.stopBatch('node-del')
+  }, 100)
   props.onClose(null, true)
 }
 </script>

+ 5 - 0
src/views/workflow/chart/index.vue

@@ -321,6 +321,11 @@ const initPlug = () => {
   state.graph.use(
     new History({
       enabled: true,
+      beforeAddCommand: (event, args: any) => {
+        if (args.key === 'ports' && args.options.propertyPath.includes('ports/items')) {
+          return false
+        }
+      }
     }),
   )
 }

+ 2 - 2
src/views/workflow/chart/node-add.vue

@@ -76,11 +76,11 @@ const onAddNode = (type) => {
   } else {
     node.data.edgeSource = `${props.node.id}_end`
   }
-  props.graph.startBatch('custom-batch-name')
+  props.graph.startBatch('node-add')
   props.graph.addNode(handleNode(node))
   props.graph.addEdge(handleEdge(edge))
   setTimeout(() => {
-    props.graph.stopBatch('custom-batch-name')
+    props.graph.stopBatch('node-add')
   }, 100)
 }
 </script>