Browse Source

Merge branch 'prod' into develop

scorpio 2 years ago
parent
commit
5d870a1df1
1 changed files with 16 additions and 1 deletions
  1. 16 1
      src/views/home/component/params/params7.vue

+ 16 - 1
src/views/home/component/params/params7.vue

@@ -256,7 +256,11 @@ export default {
     initYear() {
       this.years.length = 0
       let localYears = []
-      if (this.detail && this.detail.investment) {
+      if (
+        this.detail &&
+        this.detail.investment &&
+        this.detail.investment.data
+      ) {
         localYears = this.detail.investment.data.map(ele => ele.year)
       }
       const year = new Date().getFullYear()
@@ -301,6 +305,17 @@ export default {
       } else if (type === 2) {
         this.investment.splice(0, 0, newYearObj)
       }
+      if (Object.hasOwn(this.form, 'amount')) {
+        this.form.amount = { data: [...this.amount] }
+      } else {
+        this.form.amount = { data: [...this.amount] }
+      }
+
+      if (Object.hasOwn(this.form, 'investment')) {
+        this.form.investment = { data: [...this.investment] }
+      } else {
+        this.form.investment = { data: [...this.investment] }
+      }
     },
     /**
      * 更新数据