瀏覽代碼

增加ctrl+z ctrl+y

pixel 4 年之前
父節點
當前提交
aa7d2b6ee1
共有 1 個文件被更改,包括 14 次插入0 次删除
  1. 14 0
      web/src/components/gva-wfd/behavior/deleteItem.js

+ 14 - 0
web/src/components/gva-wfd/behavior/deleteItem.js

@@ -20,6 +20,20 @@ export default function(G6) {
                 this.graph.set('selectedItems', []);
                 this.graph.emit('afteritemselected', []);
             }
+            if (e.ctrlKey == true && e.keyCode == 90) { //Ctrl+z
+                e.returnvalue = false;
+                if (this.graph.executeCommand) {
+                    this.graph.executeCommand('undo', {});
+                }
+            }
+            if (e.ctrlKey == true && e.keyCode == 89) { //Ctrl+y
+                e.returnvalue = false;
+                if (this.graph.executeCommand) {
+                    this.graph.executeCommand('redo', {});
+                }
+
+            }
+
         },
         onCanvasLeave(e) {
             this.graph.set('focusGraphWrapper', false);