From 0bb49996bc5aa800c99506eb9df83c29be377143 Mon Sep 17 00:00:00 2001 From: xlsea Date: Wed, 3 Jul 2024 17:58:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(sj=5Fmap=5Freduce):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0=E9=A2=91=E7=8E=87=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/log-drawer.vue | 7 ++++--- src/views/workflow/form/batch/index.vue | 16 +++++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/components/common/log-drawer.vue b/src/components/common/log-drawer.vue index d51b35a..f91f8ac 100644 --- a/src/components/common/log-drawer.vue +++ b/src/components/common/log-drawer.vue @@ -86,14 +86,14 @@ async function getLogList() { } if (!logError && logData) { - finished.value = logData.finished; + finished.value = logData.finished || syncTime.value === 0; startId = logData.nextStartId; fromIndex = logData.fromIndex; if (logData.message) { logList.value.push(...logData.message); logList.value.sort((a, b) => Number.parseInt(a.time_stamp, 10) - Number.parseInt(b.time_stamp, 10)); } - if (!finished.value) { + if (!finished.value && syncTime.value !== 0) { clearTimeout(interval.value); interval.value = setTimeout(getLogList, syncTime.value * 1000); } @@ -165,6 +165,8 @@ function openNewTab() { } const handleSyncSelect = async (time: number) => { + syncTime.value = time; + if (time === -1) { if (finished.value) { finished.value = false; @@ -178,7 +180,6 @@ const handleSyncSelect = async (time: number) => { return; } - syncTime.value = time; finished.value = false; await getLogList(); }; diff --git a/src/views/workflow/form/batch/index.vue b/src/views/workflow/form/batch/index.vue index 15c6974..66f5702 100644 --- a/src/views/workflow/form/batch/index.vue +++ b/src/views/workflow/form/batch/index.vue @@ -35,7 +35,7 @@ const getBatchDetail = async () => { const { data, error } = await fetchWorkflowBatchInfo(id); if (!error) { node.value = data; - finished.value = !(data.workflowBatchStatus && [1, 2].includes(data.workflowBatchStatus)); + finished.value = !(data.workflowBatchStatus && [1, 2].includes(data.workflowBatchStatus)) || syncTime.value === 0; if (!finished.value && syncTime.value !== 0) { clearTimeout(interval.value); interval.value = setTimeout(getBatchDetail, syncTime.value * 1000); @@ -47,6 +47,8 @@ const getBatchDetail = async () => { }; const handleSyncSelect = async (time: number) => { + syncTime.value = time; + if (time === -1) { if (finished.value) { finished.value = false; @@ -60,7 +62,6 @@ const handleSyncSelect = async (time: number) => { return; } - syncTime.value = time; finished.value = false; await getBatchDetail(); }; @@ -115,7 +116,7 @@ const syncOptions = ref([