tjx
2025-11-05 fcf1b378012eec8a4a3debe5d9e3120f36c7a507
components/EquipmentInspection.vue
@@ -165,13 +165,14 @@
               // 确保每个子数组都是有效的数组
               const isValid = record.dailyChecks.every(arr => Array.isArray(arr) && arr.length === 31)
               if (isValid) {
                  this.dailyChecks = record.dailyChecks
                  // 使用 $set 确保 Vue 能够检测到嵌套数组的变化
                  this.$set(this, 'dailyChecks', record.dailyChecks.map(arr => [...arr]))
               } else {
                  console.warn('日常点检数据格式不正确,使用默认值')
                  this.dailyChecks = this.dailyItems.map(() => Array(31).fill(false))
                  this.$set(this, 'dailyChecks', this.dailyItems.map(() => Array(31).fill(false)))
               }
            } else {
               this.dailyChecks = this.dailyItems.map(() => Array(31).fill(false))
               this.$set(this, 'dailyChecks', this.dailyItems.map(() => Array(31).fill(false)))
            }
            // 验证并设置月度点检数据
@@ -179,13 +180,14 @@
               // 确保每个子数组都是有效的数组
               const isValid = record.monthlyChecks.every(arr => Array.isArray(arr) && arr.length === 31)
               if (isValid) {
                  this.monthlyChecks = record.monthlyChecks
                  // 使用 $set 确保 Vue 能够检测到嵌套数组的变化
                  this.$set(this, 'monthlyChecks', record.monthlyChecks.map(arr => [...arr]))
               } else {
                  console.warn('月度点检数据格式不正确,使用默认值')
                  this.monthlyChecks = this.monthlyItems.map(() => Array(31).fill(false))
                  this.$set(this, 'monthlyChecks', this.monthlyItems.map(() => Array(31).fill(false)))
               }
            } else {
               this.monthlyChecks = this.monthlyItems.map(() => Array(31).fill(false))
               this.$set(this, 'monthlyChecks', this.monthlyItems.map(() => Array(31).fill(false)))
            }
            this.dirty = false