浏览代码

Automatically Split Line

naibo 1 年之前
父节点
当前提交
ab47ed2be0
共有 3 个文件被更改,包括 13 次插入1 次删除
  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]["afterJSWaitTime"] = 0; //执行后js等待时间
     msg["parameters"][i]["downloadPic"] = 0; //是否下载图片
     msg["parameters"][i]["downloadPic"] = 0; //是否下载图片
     msg["parameters"][i]["splitLine"] = 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);
+    }
 }
 }
 
 
 
 

文件差异内容过多而无法显示
+ 0 - 0
ElectronJS/tasks/112.json


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

@@ -12,7 +12,7 @@
             "justMyCode": false,
             "justMyCode": false,
             //  "args": ["--ids", "[7]", "--read_type", "remote", "--headless", "0"]
             //  "args": ["--ids", "[7]", "--read_type", "remote", "--headless", "0"]
             // "args": ["--ids", "[9]", "--read_type", "remote", "--headless", "0", "--saved_file_name", "YOUTUBE"]
             // "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"]
         "--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"
             // "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"
         }
         }

部分文件因为文件数量过多而无法显示