diff --git a/edc-web/app/__pycache__/models.cpython-311.pyc b/edc-web/app/__pycache__/models.cpython-311.pyc index 6346ae4..4fea4a8 100644 Binary files a/edc-web/app/__pycache__/models.cpython-311.pyc and b/edc-web/app/__pycache__/models.cpython-311.pyc differ diff --git a/edc-web/app/routes/__pycache__/test_op.cpython-311.pyc b/edc-web/app/routes/__pycache__/test_op.cpython-311.pyc index 2e8c208..f0abe55 100644 Binary files a/edc-web/app/routes/__pycache__/test_op.cpython-311.pyc and b/edc-web/app/routes/__pycache__/test_op.cpython-311.pyc differ diff --git a/edc-web/app/static/js/test_op.js b/edc-web/app/static/js/test_op.js index fee1649..014fbee 100644 --- a/edc-web/app/static/js/test_op.js +++ b/edc-web/app/static/js/test_op.js @@ -6,6 +6,7 @@ let autoDone = 0; let autoFailed = 0; let autoRemaining = 0; let autoStartTime = ""; +let localSinceStr = ""; let pollInterval = null; let timeoutTimers = {}; // record_id → timer const TIMEOUT_MS = 10000; @@ -48,7 +49,15 @@ async function startAuto() { autoDone = 0; autoFailed = 0; autoRemaining = count; - autoStartTime = new Date().toISOString(); // 记录开始时间 + autoStartTime = new Date().toISOString(); // 记录开始时间 (UTC) + // MySQL 存的是本地时间,需要转本地格式传给后端过滤 + const now = new Date(); + localSinceStr = now.getFullYear() + "-" + + String(now.getMonth() + 1).padStart(2, "0") + "-" + + String(now.getDate()).padStart(2, "0") + " " + + String(now.getHours()).padStart(2, "0") + ":" + + String(now.getMinutes()).padStart(2, "0") + ":" + + String(now.getSeconds()).padStart(2, "0"); // 显示开始时间 document.getElementById("auto-time").style.display = "block"; @@ -114,7 +123,7 @@ async function pollProgress() { if (!autoRunning) return; try { - const resp = await fetch(`/api/automation/${DNT_ID}/progress?since=${encodeURIComponent(autoStartTime)}`); + const resp = await fetch(`/api/automation/${DNT_ID}/progress?since=${encodeURIComponent(localSinceStr)}`); const data = await resp.json(); const stats = data.stats;