From 8c418d10f3ae69678737f2f481de1c79f80cf551 Mon Sep 17 00:00:00 2001 From: naibo Date: Mon, 27 Mar 2023 00:01:26 +0800 Subject: [PATCH] Operation name Bug fix --- ElectronJS/main.js | 6 +++--- ElectronJS/src/taskGrid/FlowChart.js | 2 +- ElectronJS/src/taskGrid/FlowChart_CN.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ElectronJS/main.js b/ElectronJS/main.js index e0cfd9e..eee063d 100644 --- a/ElectronJS/main.js +++ b/ElectronJS/main.js @@ -107,13 +107,13 @@ async function beginInvoke(msg) { flowchart_window.loadURL(url); } mainWindow.hide(); - const window = windowManager.getActiveWindow(); // Prints the currently focused window bounds. - console.log(window); // This method has to be called on macOS before changing the window's bounds, otherwise it will throw an error. // It will prompt an accessibility permission request dialog, if needed. - if(!process.platform == "linux" && !process.platform == "darwin"){ + if(process.platform != "linux" && process.platform != "darwin"){ const {windowManager} = require("node-window-manager"); + const window = windowManager.getActiveWindow(); + console.log(window); windowManager.requestAccessibility(); // Sets the active window's bounds. let size = screen.getPrimaryDisplay().workAreaSize diff --git a/ElectronJS/src/taskGrid/FlowChart.js b/ElectronJS/src/taskGrid/FlowChart.js index 8500693..72c2311 100644 --- a/ElectronJS/src/taskGrid/FlowChart.js +++ b/ElectronJS/src/taskGrid/FlowChart.js @@ -271,7 +271,7 @@ function addElement(op, para) { if (option == 1) { //打开网页选项 title = "Open Page"; } else { - title = $(".options")[option - 2].innerHTML; //获取新增操作名称 + title = $(".options")[option - 1].innerHTML; //获取新增操作名称 } toolBoxKernel(null, para); diff --git a/ElectronJS/src/taskGrid/FlowChart_CN.js b/ElectronJS/src/taskGrid/FlowChart_CN.js index cabcb0d..dae3dd8 100644 --- a/ElectronJS/src/taskGrid/FlowChart_CN.js +++ b/ElectronJS/src/taskGrid/FlowChart_CN.js @@ -271,7 +271,7 @@ function addElement(op, para) { if (option == 1) { //打开网页选项 title = "打开网页"; } else { - title = $(".options")[option - 2].innerHTML; //获取新增操作名称 + title = $(".options")[option - 1].innerHTML; //获取新增操作名称 } toolBoxKernel(null, para);