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 |   56 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 47 insertions(+), 9 deletions(-)

diff --git a/components/EquipmentInspection.vue b/components/EquipmentInspection.vue
index 7770ebf..3012d9f 100644
--- a/components/EquipmentInspection.vue
+++ b/components/EquipmentInspection.vue
@@ -12,8 +12,8 @@
 				</view>
 				<view class="info-item">
 					<text class="info-label">鏃ユ湡锛�</text>
-					<picker mode="date" :value="currentDate" @change="handleDateChange">
-						<view class="date-picker">{{ currentDate }}</view>
+					<picker mode="date" fields="month" :value="currentDate" @change="handleDateChange">
+						<view class="date-picker">{{ displayDate }}</view>
 					</picker>
 				</view>
 			</view>
@@ -117,6 +117,14 @@
 			dirty: false
 		}
 	},
+	computed: {
+		displayDate() {
+			// 鏍煎紡鍖栨樉绀轰负 "2025骞�11鏈�"
+			if (!this.currentDate) return ''
+			const [year, month] = this.currentDate.split('-')
+			return `${year}骞�${month}鏈坄
+		}
+	},
 	created() {
 		this.initChecks()
 	},
@@ -152,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
@@ -178,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
@@ -255,9 +293,9 @@
 
 .info-row {
 	display: flex;
-	justify-content: space-between;
+	justify-content: flex-start;
 	align-items: center;
-	gap: 20px;
+	gap: 60px;
 }
 
 .info-item {

--
Gitblit v1.9.3