From a68880015e0d83939ff90f4d9e943c3d423bd358 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期三, 12 十一月 2025 14:45:17 +0800
Subject: [PATCH] 已开工不自动保存
---
components/machine.vue | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/components/machine.vue b/components/machine.vue
index c237153..636d121 100644
--- a/components/machine.vue
+++ b/components/machine.vue
@@ -257,12 +257,17 @@
})
}
},
- mounted() {
- // 椤甸潰鍔犺浇鏃讹紝鍚姩瀹氭椂鍣紝姣忛殧5鍒嗛挓鑷姩淇濆瓨锛堝綋鍓嶇ず渚嬩娇鐢� 30s锛屽彲鏀瑰洖 5 鍒嗛挓锛�
- this.autoSaveTimer = setInterval(() => {
- this.save(); // 鐩存帴璋冪敤宸叉湁鐨勪繚瀛樻柟娉曪紙save 宸茶繑鍥� Promise锛�
- }, 1 * 30 * 1000); // 30绉�
- },
+ mounted() {
+ // 椤甸潰鍔犺浇鏃讹紝鍚姩瀹氭椂鍣紝姣忛殧30绉掕嚜鍔ㄤ繚瀛�
+ this.autoSaveTimer = setInterval(() => {
+ // 鍒ゆ柇褰撳墠宸ュ崟鏄惁涓哄紑宸ョ姸鎬侊紝鑻ユ槸鍒欎笉瑙﹀彂淇濆瓨
+ if (this.statusForm && this.statusForm.status === '寮�宸�') {
+ // 宸插紑宸ヤ笉鑷姩淇濆瓨
+ return;
+ }
+ this.save(); // 鍙湁闈炲紑宸ョ姸鎬佹墠鑷姩淇濆瓨
+ }, 1 * 30 * 1000); // 30绉�
+ },
beforeDestroy() {
// 椤甸潰鍗歌浇鏃舵竻鐞嗗畾鏃跺櫒
clearInterval(this.autoSaveTimer);
@@ -286,6 +291,7 @@
position: absolute;
top: 8px;
right: 40px;
+ width: 200px;
z-index: 1000;
}
@@ -313,8 +319,9 @@
.item {
display: flex;
flex-direction: row;
- align-items: flex-start;
+ align-items: center;
margin-bottom: 10px;
+ gap: 10px;
}
.item h4 {
@@ -325,7 +332,8 @@
}
button {
- width: 100%;
+ width: 50%;
+ flex-shrink: 0;
padding: 10px;
font-size: 16px;
border: none;
@@ -348,7 +356,8 @@
padding: 8px;
font-size: 15px;
border: 1px solid #ccc;
- width: 100%;
+ width: 50%;
+ flex-grow: 1;
box-sizing: border-box;
}
@@ -376,7 +385,8 @@
height: 40px;
padding: 8px;
font-size: 15px;
- width: 100%;
+ width: 50%;
+ flex-grow: 1;
box-sizing: border-box;
margin-top: 0;
}
--
Gitblit v1.9.3