From 7a9244386cded40491eaa783bda01f65162b4296 Mon Sep 17 00:00:00 2001 From: Shawnsdaddy Date: Wed, 9 Oct 2024 00:16:22 -0700 Subject: [PATCH] =?UTF-8?q?UI=20BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arknights_mower/utils/log.py | 9 ++++++++- ui/src/components/PlanEditor.vue | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arknights_mower/utils/log.py b/arknights_mower/utils/log.py index b31eda70..e87ee24e 100644 --- a/arknights_mower/utils/log.py +++ b/arknights_mower/utils/log.py @@ -1,4 +1,5 @@ import logging +import pathlib import shutil import sys import time @@ -85,6 +86,8 @@ def screenshot_cleanup(): start_time_ns = time.time_ns() - config.conf.screenshot * 3600 * 10**9 for i in screenshot_folder.iterdir(): if i.is_dir(): + if i.name =='run_order': + continue shutil.rmtree(i) elif not i.stem.isnumeric(): i.unlink() @@ -108,7 +111,11 @@ def screenshot_worker(): Thread(target=screenshot_worker, daemon=True).start() -def save_screenshot(img: bytes) -> None: +def save_screenshot(img: bytes,sub_folder = None) -> None: filename = f"{time.time_ns()}.jpg" logger.debug(filename) + if sub_folder: + sub_folder_path = Path(screenshot_folder)/sub_folder + sub_folder_path.mkdir(parents=True, exist_ok=True) + filename = f"{sub_folder}/{filename}" screenshot_queue.put((img, filename)) diff --git a/ui/src/components/PlanEditor.vue b/ui/src/components/PlanEditor.vue index b16c5d78..8eddba63 100644 --- a/ui/src/components/PlanEditor.vue +++ b/ui/src/components/PlanEditor.vue @@ -193,7 +193,7 @@ function drop_facility(target, event) { const allPlans = ['main', ...backup_plans.value] allPlans.forEach((item, index) => { - if ((sub_plan.value === 'main' && item === 'main') || sub_plan.value === index) { + if ((sub_plan.value === 'main' && item === 'main') || sub_plan.value + 1 === index) { return } // 执行更新操作