From 24946a7945620878b05120a7fa91a2cc1be550ed Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期四, 13 十一月 2025 13:50:58 +0800
Subject: [PATCH] BUG
---
components/machine.vue | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/components/machine.vue b/components/machine.vue
index 1264dcc..e0a039c 100644
--- a/components/machine.vue
+++ b/components/machine.vue
@@ -257,12 +257,20 @@
})
}
},
- mounted() {
- // 椤甸潰鍔犺浇鏃讹紝鍚姩瀹氭椂鍣紝姣忛殧5鍒嗛挓鑷姩淇濆瓨锛堝綋鍓嶇ず渚嬩娇鐢� 30s锛屽彲鏀瑰洖 5 鍒嗛挓锛�
- this.autoSaveTimer = setInterval(() => {
- this.save(); // 鐩存帴璋冪敤宸叉湁鐨勪繚瀛樻柟娉曪紙save 宸茶繑鍥� Promise锛�
- }, 1 * 30 * 1000); // 30绉�
- },
+ mounted() {
+ // 椤甸潰鍔犺浇鏃讹紝鍚姩瀹氭椂鍣紝姣忛殧30绉掕嚜鍔ㄤ繚瀛�
+ this.autoSaveTimer = setInterval(() => {
+ // 1. 璋冩満瀹屾垚鏃堕棿鏈変簡灏变笉鑷姩淇濆瓨
+ if (this.maEndTime) {
+ return;
+ }
+ // 2. 閫佹鏃堕棿涓虹┖涔熶笉鑷姩淇濆瓨
+ if (!this.maShoutTime) {
+ return;
+ }
+ this.save(); // 婊¤冻鏉′欢鎵嶈嚜鍔ㄤ繚瀛�
+ }, 1 * 30 * 1000); // 30绉�
+ },
beforeDestroy() {
// 椤甸潰鍗歌浇鏃舵竻鐞嗗畾鏃跺櫒
clearInterval(this.autoSaveTimer);
@@ -286,6 +294,7 @@
position: absolute;
top: 8px;
right: 40px;
+ width: 200px;
z-index: 1000;
}
--
Gitblit v1.9.3