Browse Source

Automatically Split Line

naibo 1 year ago
parent
commit
ab47ed2be0
3 changed files with 13 additions and 1 deletions
  1. 12 0
      ElectronJS/src/taskGrid/logic.js
  2. 0 0
      ElectronJS/tasks/112.json
  3. 1 1
      ExecuteStage/.vscode/launch.json

+ 12 - 0
ElectronJS/src/taskGrid/logic.js

@@ -83,6 +83,18 @@ function changeGetDataParameters(msg, i) {
     msg["parameters"][i]["afterJSWaitTime"] = 0; //执行后js等待时间
     msg["parameters"][i]["downloadPic"] = 0; //是否下载图片
     msg["parameters"][i]["splitLine"] = 0; //是否分割行
+    try {
+        let exampleValue = msg["parameters"][i]["exampleValues"][0]["value"];
+        //计算句子中去掉空格后的长度
+        let len = exampleValue.replace(/\s+/g, "").length;
+        //如果是文本类型的话,长度超过200就默认分割行
+        if (len > 200 && msg["parameters"][i]["nodeType"] == 0 && msg["parameters"][i]["contentType"] == 0) {
+            msg["parameters"][i]["splitLine"] = 1; //如果示例值长度超过200,就默认分割行
+            showInfo(LANG("单个字段示例值长度超过200,已自动开启换行功能。",  "The length of the example value of a single field exceeds 200, and the line break function has been automatically turned on."), 4000);
+        }
+    } catch (e) {
+        console.log(e);
+    }
 }
 
 

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


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

@@ -12,7 +12,7 @@
             "justMyCode": false,
             //  "args": ["--ids", "[7]", "--read_type", "remote", "--headless", "0"]
             // "args": ["--ids", "[9]", "--read_type", "remote", "--headless", "0", "--saved_file_name", "YOUTUBE"]
-            "args": ["--ids", "[26]", "--headless", "0", "--user_data", "0", "--keyboard", "0",
+            "args": ["--ids", "[75]", "--headless", "0", "--user_data", "0", "--keyboard", "0",
         "--read_type", "remote"]
             // "args": "--ids '[97]' --user_data 1 --server_address http://localhost:8074 --config_folder '/Users/naibo/Documents/EasySpider/ElectronJS/' --headless 0 --read_type remote --config_file_name config.json --saved_file_name"
         }

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