Browse Source

优雅的break选项

naibo 2 years ago
parent
commit
2de6f6d5a6

File diff suppressed because it is too large
+ 0 - 0
.temp_to_pub/EasySpider_windows_x64/execution_instances/5.json


File diff suppressed because it is too large
+ 0 - 0
.temp_to_pub/EasySpider_windows_x64/tasks/34.json


+ 15 - 16
ElectronJS/src/taskGrid/FlowChart_CN.html

@@ -348,11 +348,11 @@
                 <div class="elements" v-if="nodeType==5">
                     <p><input onkeydown="inputDelete(event)" type="checkbox" v-model='nowNode["parameters"]["iframe"]'></input>操作在iframe内</p>
                     <label>自定义执行模式</label>
-                    <select v-model='nowNode["parameters"]["codeMode"]' class="form-control">
+                    <select v-model='codeMode' class="form-control">
                         <option value = 0>执行一段JavaScript脚本</option>
                         <option value = 1>执行一段操作系统级别命令</option>
                         <option v-if="nowNode['isInLoop']" value = 2>针对当前循环项的JavaScript脚本</option>
-                        <option v-if="nowNode['isInLoop']" value = 3>退出当前循环(Break操作,选择这个可以忽略下面的选项)</option>
+                        <option v-if="nowNode['isInLoop']" value = 3>退出当前循环(Break操作)</option>
 <!--                        <option v-if="nowNode['isInLoop']" value = 4>跳过当前循环后面的操作(Continue操作,选择这个可以忽略下面的选项)</option>-->
                     </select>
 
@@ -361,7 +361,7 @@
                         <textarea onkeydown="inputDelete(event)" class="form-control" rows="2" v-model='nowNode["parameters"]["code"]' placeholder="输入JS或系统命令,如:document.body.innerText = '1' 或 python D:/test.py,分别为JS命令和系统命令示例。如选择针对当前循环项的JS脚本,则循环项元素用arguments[0]表示,如arguments[0].style.color = 'blue'"></textarea>
                         <p style="margin-top: 15px">是否将执行后的输出/返回值作为字段记录:</p>
                         <p><select v-model='nowNode["parameters"]["recordASField"]' class="form-control">
-                            <option :value = 0>否</option>
+                            <option :value = 0>否(仍可在任意操作中用Field["操作名"]表示此命令返回值)</option>
                             <option :value = 1>是(JavaScript脚本需要以return 开头)</option>
                         </select></p>
                         <p><label>参数类型转换为:</label>
@@ -457,19 +457,6 @@
                     <label v-if='parseInt(loopType) == 0'>最多执行循环次数(0代表无限循环直到找不到元素为止):</label>
                     <input onkeydown="inputDelete(event)" required v-if='parseInt(loopType) == 0' class="form-control" type="number" v-model.number='nowNode["parameters"]["exitCount"]'></input>
 
-
-                    <label><b>历史记录回退后</b>等待秒数:</label>
-                    <input onkeydown="inputDelete(event)" required type="number" class="form-control" v-model.number='list.nl[index.nowNodeIndex]["parameters"]["historyWait"]'></input>
-                    <label>执行完是否向下滚动:</label>
-                    <select v-model='nowNode["parameters"]["scrollType"]' class="form-control">
-                        <option value = 0>不滚动</option>
-                        <option value = 1>向下滚动一屏</option>
-                        <option value = 2>滚动到底部</option>
-                    </select>
-                    <label>滚动次数(滚动类型设置为<b>不滚动</b>时<b>无效</b>):</label>
-                    <input onkeydown="inputDelete(event)" class="form-control" v-model.number="nowNode['parameters']['scrollCount']" type="number" required></input>
-                    <label>滚动后等待时间(秒):</label>
-                    <input onkeydown="inputDelete(event)" class="form-control" v-model.number="nowNode['parameters']['scrollWaitTime']" type="number" required></input>
                     <div id="breakAdvanced" v-if='nowNode["parameters"]["loopType"] < 5'>
                         <div>
                             <p><label>(高级操作)使用代码/脚本定义循环退出条件(也可以在流程中添加自定义操作,然后选择Break选项): </label></p>
@@ -486,6 +473,18 @@
                             </div>
                         </div>
                     </div>
+                    <label><b>历史记录回退后</b>等待秒数:</label>
+                    <input onkeydown="inputDelete(event)" required type="number" class="form-control" v-model.number='list.nl[index.nowNodeIndex]["parameters"]["historyWait"]'></input>
+                    <label>执行完是否向下滚动:</label>
+                    <select v-model='nowNode["parameters"]["scrollType"]' class="form-control">
+                        <option value = 0>不滚动</option>
+                        <option value = 1>向下滚动一屏</option>
+                        <option value = 2>滚动到底部</option>
+                    </select>
+                    <label>滚动次数(滚动类型设置为<b>不滚动</b>时<b>无效</b>):</label>
+                    <input onkeydown="inputDelete(event)" class="form-control" v-model.number="nowNode['parameters']['scrollCount']" type="number" required></input>
+                    <label>滚动后等待时间(秒):</label>
+                    <input onkeydown="inputDelete(event)" class="form-control" v-model.number="nowNode['parameters']['scrollWaitTime']" type="number" required></input>
                 </div>
 
                 <div class="elements" v-if="nodeType==9">

+ 22 - 14
ElectronJS/src/taskGrid/FlowChart_CN.js

@@ -35,6 +35,7 @@ let app = new Vue({
         index: vueData,
         nodeType: 0, // 当前元素的类型
         nowNode: null, // 用来临时存储元素的节点
+        codeMode: 0, //代码模式
         loopType: -1, //点击循环时候用来循环选项
         useLoop: false, //记录是否使用循环内元素
         nowArrow: { "position": -1, "pId": 0, "num": 0 },
@@ -66,7 +67,7 @@ let app = new Vue({
                 }
             }
         },
-        loopType: {
+        loopType: { //循环类型发生变化的时候更新参数值
             handler: function(newVal, oldVal) {
                 this.nowNode["parameters"]["loopType"] = newVal;
             }
@@ -86,6 +87,11 @@ let app = new Vue({
                 this.nowNode["parameters"]["paras"] = newVal["parameters"];
             }
         },
+        codeMode: {
+            handler: function(newVal, oldVal) {
+                this.nowNode["parameters"]["codeMode"] = newVal;
+            }
+        }
     },
     methods: {
         getCookies: function() { //获取cookies
@@ -222,19 +228,7 @@ function newNode(node) {
     }
 }
 
-function elementMousedown(e) {
-    if (e.button == 2) //右键点击
-    {
-        if (nowNode != null) {
-            nowNode.style.borderColor = "skyblue";
-        }
-        nowNode = this;
-        vueData.nowNodeIndex = actionSequence[this.getAttribute("data")];
-        this.style.borderColor = "blue";
-        handleElement(); //处理元素
-    }
-    e.stopPropagation(); //防止冒泡
-}
+
 
 function branchMouseDown(e) {
     if (e.button == 2) //右键点击
@@ -293,6 +287,20 @@ function branchClick(e) {
     e.stopPropagation(); //防止冒泡
 }
 
+function elementMousedown(e) {
+    if (e.button == 2) //右键点击
+    {
+        if (nowNode != null) {
+            nowNode.style.borderColor = "skyblue";
+        }
+        nowNode = this;
+        vueData.nowNodeIndex = actionSequence[this.getAttribute("data")];
+        this.style.borderColor = "blue";
+        handleElement(); //处理元素
+    }
+    e.stopPropagation(); //防止冒泡
+}
+
 //元素点击事件
 function elementClick(e) {
     if (nowNode != null) {

+ 3 - 1
ElectronJS/src/taskGrid/logic_CN.js

@@ -129,7 +129,7 @@ function notifyParameterNum(num) {
 //     }
 // }
 
-// 流程图元素点击后的处理逻辑
+// 流程图元素点击后的处理逻辑,注意在FlowChart_CN.js中watch的那些数据的加载都需要在这里执行!!!
 function handleElement() {
     app._data["nowNode"] = nodeList[vueData.nowNodeIndex];
     app._data["nodeType"] = app._data["nowNode"]["option"];
@@ -139,6 +139,8 @@ function handleElement() {
     } else if (app._data["nodeType"] == 3) {
         app._data.paraIndex = 0; //参数索引初始化
         app._data.paras.parameters = app._data["nowNode"]["parameters"]["paras"];
+    } else if(app._data["nodeType"] == 5){
+      app._data.codeMode = app._data["nowNode"]["parameters"]["codeMode"];
     } else if (app._data["nodeType"] == 10) {
         app._data.TClass = app._data["nowNode"]["parameters"]["class"];
     }

File diff suppressed because it is too large
+ 0 - 0
ElectronJS/tasks/34.json


+ 1 - 1
ExecuteStage/.vscode/launch.json

@@ -12,7 +12,7 @@
             "justMyCode": true,
             //  "args": ["--id", "[7]", "--read_type", "remote", "--headless", "0"]
             // "args": ["--id", "[9]", "--read_type", "remote", "--headless", "0", "--saved_file_name", "YOUTUBE"]
-            "args": ["--id", "[4]", "--headless", "0", "--user_data", "1"]
+            "args": ["--id", "[5]", "--headless", "0", "--user_data", "1"]
         }
     ]
 }

Some files were not shown because too many files changed in this diff