diff --git a/ElectronJS/main.js b/ElectronJS/main.js index 43f1ca8..04872bb 100644 --- a/ElectronJS/main.js +++ b/ElectronJS/main.js @@ -85,6 +85,10 @@ let flowchart_window = null; let current_handle = null; let old_handles = []; let handle_pairs = {}; +let socket_window = null; +let socket_start = null; +let socket_flowchart = null; +let invoke_window = null; // var ffi = require('ffi-napi'); // var libm = ffi.Library('libm', { @@ -233,27 +237,7 @@ async function beginInvoke(msg, ws) { break; } } - // .then(function (element) { - // console.log("element", element, handles); - // element.sendKeys(Key.HOME, Key.chord(Key.SHIFT, Key.END), keyInfo); - // exit = true; - // }, function (error) { - // console.log("error", error); - // len = len - 1; - // if (len == 0) { - // exit = true; - // } - // } - // ); } - // let handles = driver.getAllWindowHandles(); - // driver.switchTo().window(handles[handles.length - 1]); - // driver.findElement(By.xpath(msg.message.xpath)).sendKeys(Key.HOME, Key.chord(Key.SHIFT, Key.END), keyInfo); - // robot.keyTap("a", "control"); - // robot.keyTap("backspace"); - // robot.typeString(keyInfo); - // robot.keyTap("shift"); - // robot.keyTap("shift"); } else if (msg.type == 3) { try { if (msg.from == 0) { @@ -368,6 +352,11 @@ async function beginInvoke(msg, ws) { } catch { console.log("open devtools error"); } + try{ + invoke_window.openDevTools(); + } catch { + console.log("open devtools error"); + } } else if (msg.type == 7) { // 获得当前页面Cookies try{ @@ -383,9 +372,6 @@ async function beginInvoke(msg, ws) { const WebSocket = require('ws'); const {all} = require("express/lib/application"); -let socket_window = null; -let socket_start = null; -let socket_flowchart = null; let wss = new WebSocket.Server({port: websocket_port}); wss.on('connection', function (ws) { ws.on('message', async function (message, isBinary) { @@ -521,7 +507,7 @@ function handleOpenBrowser(event, lang = "en", user_data_folder = "", mobile = f } function handleOpenInvoke(event, lang = "en") { - const window = new BrowserWindow({icon: iconPath}); + invoke_window = new BrowserWindow({icon: iconPath}); let url = ""; language = lang; if (lang == "en") { @@ -530,10 +516,10 @@ function handleOpenInvoke(event, lang = "en") { url = server_address + `/taskGrid/taskList.html?type=1&wsport=${websocket_port}&backEndAddressServiceWrapper=` + server_address + "&lang=zh"; } // and load the index.html of the app. - window.loadURL(url, { extraHeaders: 'pragma: no-cache\n' }); - window.maximize(); + invoke_window.loadURL(url, { extraHeaders: 'pragma: no-cache\n' }); + invoke_window.maximize(); mainWindow.hide(); - window.on('close', function (event) { + invoke_window.on('close', function (event) { mainWindow.show(); }); } diff --git a/ElectronJS/src/taskGrid/FlowChart.css b/ElectronJS/src/taskGrid/FlowChart.css index 52f02c6..1f35cec 100644 --- a/ElectronJS/src/taskGrid/FlowChart.css +++ b/ElectronJS/src/taskGrid/FlowChart.css @@ -8,6 +8,10 @@ margin-top: 10px; } + label{ + margin-left: 2px; + } + div.node { height: 45px; width: 150px; @@ -19,38 +23,38 @@ padding: 5px; margin: 10px auto; } - + .arrow { margin: 10px auto; text-align: center; font-size: 23px!important; color: black; } - + .arrow:hover { background-color: deepskyblue!important; cursor: pointer; color: white; } - + .branchAdd { margin: 10px auto; text-align: center; font-size: 18px!important; color: black; } - + .branchAdd:hover { background-color: deepskyblue; cursor: pointer; color: white; } - + div.node:hover { cursor: pointer; background: navy; } - + .loop { border: skyblue solid; text-align: center; @@ -61,11 +65,11 @@ margin: 10px auto; border-radius: 7px; } - + .options { height: 35px; } - + .judge { /* display: flex; */ text-align: center; @@ -76,7 +80,7 @@ justify-content: center; border-radius: 7px; } - + .branch { display: inline-block; margin: 5px; @@ -88,11 +92,11 @@ margin: 10px; border-radius: 7px; } - + .sequence { display: block; } - + .toolbox button { margin-top: 5px; margin-left: 3px; @@ -100,35 +104,35 @@ width: 80%; font-size: 15px!important; } - + .Modify { margin: 20px; } - + .Modify input { font-size: 17px!important; } - + .elements { font-size: 17px!important; margin: 10px 0; } - + .elements p { margin: 5px 0; } - + .elements input[type=checkbox] { width: 20px; height: 20px; vertical-align: sub; margin-right: 5px; } - + .elements textarea { min-height: 100px; } - + .elements label { font-size: 17px!important; margin: 10px 0; @@ -143,7 +147,7 @@ border: 1px solid rgb(78, 78, 78); padding-left: 2px; } - + table { table-layout: fixed; word-break: break-all; @@ -153,7 +157,7 @@ white-space: nowrap; width: 100%; } */ - + .toolkitcontain { border: 1px solid #cdd!important; width: 100%; @@ -163,7 +167,7 @@ margin-top: 10px; position: relative; } - + .toolkitcontain table { table-layout: fixed; word-break: break-all; @@ -173,7 +177,7 @@ white-space: nowrap; width: 100%; } - + .toolkitcontain th, .toolkitcontain td, .toolkitcontain tr { @@ -187,7 +191,7 @@ padding-left: 1px; -webkit-user-select: none; } - + .toolkitcontain .toolkittb2 { position: sticky; top: 0px; @@ -195,13 +199,13 @@ background-color: azure; z-index: 1000; } - + .toolkitcontain .toolkittb4 { position: absolute; } - + .toolkitcontain a { font-size: 13px!important; cursor: pointer; color: blue; - } \ No newline at end of file + } diff --git a/ElectronJS/src/taskGrid/FlowChart.html b/ElectronJS/src/taskGrid/FlowChart.html index 421d845..d89457a 100644 --- a/ElectronJS/src/taskGrid/FlowChart.html +++ b/ElectronJS/src/taskGrid/FlowChart.html @@ -580,7 +580,14 @@ If the expression returns a value greater than 0 or evaluates to True, the opera
- + + + + + + + + + + + + - +