From a563361b45430e4c99ddc625d995154f34b3e556 Mon Sep 17 00:00:00 2001
From: tjx <t2856754968@163.com>
Date: 星期二, 04 十一月 2025 18:55:33 +0800
Subject: [PATCH] 样式调整1
---
components/EquipmentInspection.vue | 44 +++++++++++++++++++++++++++++++++++++-------
1 files changed, 37 insertions(+), 7 deletions(-)
diff --git a/components/EquipmentInspection.vue b/components/EquipmentInspection.vue
index fefa8e6..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
@@ -263,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