From 8f84469cbf316989a9af8e574a11dd612ccc562a Mon Sep 17 00:00:00 2001
From: tjx <t2856754968@163.com>
Date: 星期二, 04 十一月 2025 18:14:04 +0800
Subject: [PATCH] 样式调整1

---
 components/EquipmentInspection.vue |   40 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/components/EquipmentInspection.vue b/components/EquipmentInspection.vue
index 61c9c18..3012d9f 100644
--- a/components/EquipmentInspection.vue
+++ b/components/EquipmentInspection.vue
@@ -160,14 +160,32 @@
 					date: this.currentDate
 				}, { mock: true, showLoading: true })
 
-				if (record && record.dailyChecks) {
-					this.dailyChecks = record.dailyChecks
+				// 楠岃瘉骞惰缃棩甯哥偣妫�鏁版嵁
+				if (record && Array.isArray(record.dailyChecks) && record.dailyChecks.length === 6) {
+					// 纭繚姣忎釜瀛愭暟缁勯兘鏄湁鏁堢殑鏁扮粍
+					const isValid = record.dailyChecks.every(arr => Array.isArray(arr) && arr.length === 31)
+					if (isValid) {
+						this.dailyChecks = record.dailyChecks
+					} else {
+						console.warn('鏃ュ父鐐规鏁版嵁鏍煎紡涓嶆纭紝浣跨敤榛樿鍊�')
+						this.dailyChecks = this.dailyItems.map(() => Array(31).fill(false))
+					}
 				} else {
-					this.initChecks()
+					this.dailyChecks = this.dailyItems.map(() => Array(31).fill(false))
 				}
 
-				if (record && record.monthlyChecks) {
-					this.monthlyChecks = record.monthlyChecks
+				// 楠岃瘉骞惰缃湀搴︾偣妫�鏁版嵁
+				if (record && Array.isArray(record.monthlyChecks) && record.monthlyChecks.length === 2) {
+					// 纭繚姣忎釜瀛愭暟缁勯兘鏄湁鏁堢殑鏁扮粍
+					const isValid = record.monthlyChecks.every(arr => Array.isArray(arr) && arr.length === 31)
+					if (isValid) {
+						this.monthlyChecks = record.monthlyChecks
+					} else {
+						console.warn('鏈堝害鐐规鏁版嵁鏍煎紡涓嶆纭紝浣跨敤榛樿鍊�')
+						this.monthlyChecks = this.monthlyItems.map(() => Array(31).fill(false))
+					}
+				} else {
+					this.monthlyChecks = this.monthlyItems.map(() => Array(31).fill(false))
 				}
 
 				this.dirty = false
@@ -186,8 +204,20 @@
 			}
 
 			if (type === 'daily') {
+				// 瀹夊叏妫�鏌ワ細纭繚鏁扮粍鍜岀储寮曟湁鏁�
+				if (!Array.isArray(this.dailyChecks) || !Array.isArray(this.dailyChecks[itemIdx])) {
+					console.error('鏃ュ父鐐规鏁版嵁缁撴瀯寮傚父锛岄噸鏂板垵濮嬪寲')
+					this.initChecks()
+					return
+				}
 				this.$set(this.dailyChecks[itemIdx], dayIdx, !this.dailyChecks[itemIdx][dayIdx])
 			} else {
+				// 瀹夊叏妫�鏌ワ細纭繚鏁扮粍鍜岀储寮曟湁鏁�
+				if (!Array.isArray(this.monthlyChecks) || !Array.isArray(this.monthlyChecks[itemIdx])) {
+					console.error('鏈堝害鐐规鏁版嵁缁撴瀯寮傚父锛岄噸鏂板垵濮嬪寲')
+					this.initChecks()
+					return
+				}
 				this.$set(this.monthlyChecks[itemIdx], dayIdx, !this.monthlyChecks[itemIdx][dayIdx])
 			}
 			this.dirty = true

--
Gitblit v1.9.3