From 0db3106d79902790a499e676eac7dca22e0f1ffa Mon Sep 17 00:00:00 2001 From: yan Date: Mon, 19 Jan 2026 00:26:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(auto-tools):=20=E6=B7=BB=E5=8A=A0=E9=94=84?= =?UTF-8?q?=E5=9C=B0=E9=98=9F=E4=BC=8D=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 HoeGround.json 配置文件用于存储锄地队伍映射 - 实现基于 JSON 的锄地队伍配置支持 - 添加 UID 过滤的锄地队伍映射功能 - 优化 PathOrder.json 默认配置结构 - 移除调试代码并完善配置加载日志 --- repo/js/FullyAutoAndSemiAutoTools/main.js | 31 +++++++++++++---------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/repo/js/FullyAutoAndSemiAutoTools/main.js b/repo/js/FullyAutoAndSemiAutoTools/main.js index 895247b77..4a553ab85 100644 --- a/repo/js/FullyAutoAndSemiAutoTools/main.js +++ b/repo/js/FullyAutoAndSemiAutoTools/main.js @@ -35,6 +35,8 @@ const json_path_name = { RefreshSettings: `${config_root}\\RefreshSettings.json`, pathJsonByUid: `${config_root}\\path-json-by-uid.json`, PathOrder: `${config_root}\\PathOrder.json`, + HoeGround: `${config_root}\\HoeGround.json`, + } // 定义记录文件的路径 // let RecordText = `${config_root}\\record.json` @@ -591,17 +593,27 @@ async function initRun(config_run) { } let groups = groupByParentAndName(matchedPaths); - + //锄地队对应 try { const teamHoeGroundStr = settings.team_hoe_ground || "parentName->name=key" teamHoeGroundStr.split(",").forEach(item => { - const [key, order] = item.split("="); - team.HoeGroundMap.set(key, parseInt(order)) + const [key, team_name] = item.split("="); + team.HoeGroundMap.set(key, team_name) }) } catch (e) { - } - + try{ + // { + // uid:"", + // parent_name:"", + // name:"", + // team_name:"" + // } json支持 + const teamHoeGroundList = JSON.parse(file.readTextSync(json_path_name.HoeGround)) ?? [{ uid: "", parent_name: "", name: "", team_name: ""}] + teamHoeGroundList.filter(item => item.uid === Record.uid).forEach(item => team.HoeGroundMap.set(`${item.parent_name}->${item.name}`, item.team_name)) + log.info(`{0}加载完成`, json_path_name.HoeGround) + } catch (e) { + } // 排序 const orderMap = new Map() try { @@ -612,7 +624,6 @@ async function initRun(config_run) { orderMap.set(key, parseInt(order)) }) } catch (e) { - } try { @@ -622,11 +633,10 @@ async function initRun(config_run) { // name:"", // order:0 // } json支持 - const orderList = JSON.parse(file.readTextSync(json_path_name.PathOrder)) ?? [] + const orderList = JSON.parse(file.readTextSync(json_path_name.PathOrder)) ?? [{ uid: "", parent_name: "", name: "", order: 0 }] orderList.filter(item => item.uid === Record.uid).forEach(item => orderMap.set(`${item.parent_name}->${item.name}`, item.order)) log.info(`{0}加载完成`, json_path_name.PathOrder) } catch (e) { - } groups.sort((a, b) => { @@ -655,11 +665,6 @@ async function initRun(config_run) { 'log-needRunMap.json', JSON.stringify([...needRunMap]) ); - // needRunMap.set(as_name, { - // paths: matchedPaths, - // as_name: as_name, - // name: settingsName //多选项 名称 如 treeLevel_0_0 - // }); } log.info("[执行前配置完成] needRunMap.size={0}", needRunMap.size); }