update UI

This commit is contained in:
naibo 2023-07-02 20:13:03 +08:00
parent 4cca6a43fc
commit c7ddd1973e
6 changed files with 147 additions and 4 deletions

View File

@ -369,7 +369,7 @@ function handleOpenBrowser(event, lang = "en", user_data_folder = "", mobile = f
runBrowser(lang, user_data_folder, mobile);
let size = screen.getPrimaryDisplay().workAreaSize;
let width = parseInt(size.width);
let height = parseInt(size.height * 0.6);
let height = parseInt(size.height * 0.7);
flowchart_window = new BrowserWindow({
x: 0,
y: 0,

View File

@ -4,6 +4,10 @@
font-size: 17px!important;
}
.modal-body label{
margin-top: 10px;
}
div.node {
height: 45px;
width: 150px;

View File

@ -36,6 +36,7 @@
<div style="width: 200px;float:left;overflow: auto">
<div class="toolbox" style="text-align:center;margin: 20px;border-radius:10px;border:navy solid;background-color:rgb(242,243,245);z-index: 9999;">
<div style="padding: 10px;border-radius:10px;font-size: 20px;">工具箱</div>
<!-- window.resizeTo( screen.availWidth, screen.availHeight );-->
<button type="button" id="save" data-toggle="modal" data-target="#myModal" onmousedown="$('#myModal').modal('show');" class="btn btn-primary">保存任务</button>
<button type="button" data=1 class="btn btn-outline-primary options">打开网页</button>
<button type="button" data=2 class="btn btn-outline-primary options">点击元素</button>

View File

@ -1 +1,136 @@
{"id":110,"name":"京东全球版-专业的综合网上购物商城","url":"https://www.jd.com","links":"https://www.jd.com","create_time":"7/2/2023, 12:40:16 PM","version":"0.3.3","saveThreshold":10,"cloudflare":0,"environment":0,"containJudge":false,"desc":"https://www.jd.com","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"https://www.jd.com","desc":"要采集的网址列表,多行以\\n分开","type":"string","exampleValue":"https://www.jd.com"}],"outputParameters":[{"id":0,"name":"参数1_链接地址","desc":"","type":"string","exampleValue":"https://shouji.jd.com/"}],"graph":[{"index":0,"id":0,"parentId":0,"type":-1,"option":0,"title":"root","sequence":[1,2],"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","wait":0},"isInLoop":false},{"id":1,"index":1,"parentId":0,"type":0,"option":1,"title":"打开网页","sequence":[],"isInLoop":false,"position":0,"parameters":{"useLoop":false,"xpath":"","wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"https://www.jd.com","links":"https://www.jd.com","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1}},{"id":2,"index":2,"parentId":0,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"","wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":0,"contentType":0,"relative":false,"name":"参数1_链接地址","desc":"","relativeXPath":"/html/body/div[5]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/a[1]/@href","allXPaths":["/html/body/div[5]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/a[1]","//a[contains(., '手机')]","/html/body/div[last()-6]/div/div[last()-4]/div/div[last()-2]/div/div/div/div[last()-1]/div[last()-12]/a[last()-1]"],"exampleValues":[{"num":0,"value":"https://shouji.jd.com/"}],"unique_index":"9ol8y22adgljky0679","default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}]}}]}
{
"id": 110,
"name": "京东全球版-专业的综合网上购物商城",
"url": "https://www.jd.com",
"links": "https://www.jd.com",
"create_time": "7/2/2023, 12:40:16 PM",
"version": "0.3.3",
"saveThreshold": 10,
"cloudflare": 0,
"environment": 0,
"containJudge": false,
"desc": "https://www.jd.com",
"inputParameters": [
{
"id": 0,
"name": "urlList_0",
"nodeId": 1,
"nodeName": "打开网页",
"value": "https://www.jd.com",
"desc": "要采集的网址列表,多行以\\n分开",
"type": "string",
"exampleValue": "https://www.jd.com"
}
],
"outputParameters": [
{
"id": 0,
"name": "参数1_链接地址",
"desc": "",
"type": "string",
"exampleValue": "https://shouji.jd.com/"
}
],
"graph": [
{
"index": 0,
"id": 0,
"parentId": 0,
"type": -1,
"option": 0,
"title": "root",
"sequence": [
1,
2
],
"parameters": {
"history": 1,
"tabIndex": 0,
"useLoop": false,
"xpath": "",
"wait": 0
},
"isInLoop": false
},
{
"id": 1,
"index": 1,
"parentId": 0,
"type": 0,
"option": 1,
"title": "打开网页",
"sequence": [],
"isInLoop": false,
"position": 0,
"parameters": {
"useLoop": false,
"xpath": "",
"wait": 0,
"waitType": 0,
"beforeJS": "",
"beforeJSWaitTime": 0,
"afterJS": "",
"afterJSWaitTime": 0,
"url": "https://www.jd.com",
"links": "https://www.jd.com",
"maxWaitTime": 10,
"scrollType": 0,
"scrollCount": 1,
"scrollWaitTime": 1
}
},
{
"id": 2,
"index": 2,
"parentId": 0,
"type": 0,
"option": 3,
"title": "提取数据",
"sequence": [],
"isInLoop": false,
"position": 1,
"parameters": {
"history": 4,
"tabIndex": -1,
"useLoop": false,
"xpath": "",
"wait": 0,
"waitType": 0,
"beforeJS": "",
"beforeJSWaitTime": 0,
"afterJS": "",
"afterJSWaitTime": 0,
"paras": [
{
"nodeType": 0,
"contentType": 0,
"relative": false,
"name": "参数1_链接地址",
"desc": "",
"relativeXPath": "/html/body/div[5]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/a[1]/@href",
"allXPaths": [
"/html/body/div[5]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/a[1]",
"//a[contains(., '手机')]",
"/html/body/div[last()-6]/div/div[last()-4]/div/div[last()-2]/div/div/div/div[last()-1]/div[last()-12]/a[last()-1]"
],
"exampleValues": [
{
"num": 0,
"value": "https://shouji.jd.com/"
}
],
"unique_index": "9ol8y22adgljky0679",
"default": "",
"beforeJS": "",
"beforeJSWaitTime": 0,
"JS": "",
"JSWaitTime": 0,
"afterJS": "",
"afterJSWaitTime": 0,
"downloadPic": 0
}
]
}
}
]
}

File diff suppressed because one or more lines are too long

View File

@ -184,6 +184,9 @@ export function collectMultiWithPattern() {
"isDescendents": global.app._data.selectedDescendents, //标记是否采集的是子元素
"parameters": global.outputParameters,
};
for(let i=0;i<global.outputParameters.length;i++){
global.outputParameters[i]["exampleValues"] = [global.outputParameters[i]["exampleValues"][0]];
}
if (!detectAllSelected()) //如果不是全部选中的话
{
message.loopType = 2; //固定元素列表