mirror of
https://github.com/flipped-aurora/gin-vue-admin.git
synced 2026-10-11 20:05:34 +00:00
增加快捷键复制粘贴
This commit is contained in:
@@ -11,6 +11,7 @@ export default function(G6) {
|
||||
onKeydown(e) {
|
||||
const items = this.graph.get('selectedItems');
|
||||
const focus = this.graph.get('focusGraphWrapper');
|
||||
console.log(e.keyCode)
|
||||
if (e.keyCode === 46 && items && items.length > 0 && focus) {
|
||||
if (this.graph.executeCommand) {
|
||||
this.graph.executeCommand('delete', {});
|
||||
@@ -31,9 +32,19 @@ export default function(G6) {
|
||||
if (this.graph.executeCommand) {
|
||||
this.graph.executeCommand('redo', {});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (e.ctrlKey == true && e.keyCode == 67) { //Ctrl+c
|
||||
e.returnvalue = false;
|
||||
if (this.graph.executeCommand) {
|
||||
this.graph.executeCommand('copy', {});
|
||||
}
|
||||
}
|
||||
if (e.ctrlKey == true && e.keyCode == 86) { //Ctrl+v
|
||||
e.returnvalue = false;
|
||||
if (this.graph.executeCommand) {
|
||||
this.graph.executeCommand('paste', {});
|
||||
}
|
||||
}
|
||||
},
|
||||
onCanvasLeave(e) {
|
||||
this.graph.set('focusGraphWrapper', false);
|
||||
|
||||
Reference in New Issue
Block a user