Quellcode durchsuchen

Merge remote-tracking branch 'origin/develop' into develop

scorpioyq vor 2 Jahren
Ursprung
Commit
d0d63d0d5a
3 geänderte Dateien mit 45 neuen und 44 gelöschten Zeilen
  1. 0 3
      src/layout/left.vue
  2. 15 16
      src/layout/top.vue
  3. 30 25
      src/views/home/component/params/params7.vue

+ 0 - 3
src/layout/left.vue

@@ -87,9 +87,6 @@ export default {
       ) {
         this.activeCollapse = this.data[this.active].name
         this.data[this.active].children[this.subActive].checked = true
-      } else {
-        this.activeCollapse = this.data[this.active].name
-        this.data[this.active].checked = true
       }
     },
     menus() {

+ 15 - 16
src/layout/top.vue

@@ -268,22 +268,21 @@ export default {
       const self = this
       self.timeoutObj && clearTimeout(self.timeoutObj)
       self.serverTimeoutObj && clearTimeout(self.serverTimeoutObj)
-      self.timeoutObj = setTimeout(function () {
-        // 这里发送一个心跳,后端收到后,返回一个心跳消息,
-        console.log(self.websock)
-        if (self.websock.readyState === 1) {
-          // 如果连接正常
-          self.websock.send('heartCheck') // 这里可以自己跟后端约定
-        } else {
-          // 否则重连
-          this.websock.close()
-          self.reconnect()
-        }
-        self.serverTimeoutObj = setTimeout(function () {
-          // 超时关闭
-          self.websock.close()
-        }, self.timeout)
-      }, self.timeout)
+      // self.timeoutObj = setTimeout(function () {
+      //   // 这里发送一个心跳,后端收到后,返回一个心跳消息,
+      //   console.log(self.websock)
+      //   if (self.websock.readyState === 1) {
+      //     // 如果连接正常
+      //     self.websock.send('heartCheck') // 这里可以自己跟后端约定
+      //   } else {
+      //     // 否则重连
+      //     // self.reconnect()
+      //   }
+      //   self.serverTimeoutObj = setTimeout(function () {
+      //     // 超时关闭
+      //     self.websock.close()
+      //   }, self.timeout)
+      // }, self.timeout)
     },
 
     dropDown(res) {

+ 30 - 25
src/views/home/component/params/params7.vue

@@ -2,7 +2,9 @@
   <div class="flex flex-center flex-col">
     <!-- title and btn -->
     <div class="flex flex-center full-width flex-justify-between mt-10 mb-10">
-      <span class="full-width text-left bold">{{ info.dictValue }}</span>
+      <span class="full-width text-left bold"
+        >{{ info.dictValue }}(单位:万元)</span
+      >
       <el-button
         v-if="detail.can_update"
         type="primary"
@@ -41,8 +43,8 @@
           <div
             class="flex flex-justify-start flex-align-center full-width flex-child-average"
           >
-            <div class="value flex flex-justify-end">
-              {{ item.year }}年度计划投资(万元)
+            <div class="value flex flex-justify-end mr-10">
+              {{ item.year }}年度计划投资
             </div>
             <el-input
               v-model="item.planSum"
@@ -54,7 +56,7 @@
           <div
             class="flex flex-justify-start flex-align-center full-width flex-child-average"
           >
-            <div class="value flex flex-justify-end">年度累计投资(万元)</div>
+            <div class="value flex flex-justify-end">年度累计投资</div>
             <div class="ml-20 value-box flex flex-justify-start">
               {{ item.actualSum }}
             </div>
@@ -79,7 +81,7 @@
       <div class="flex flex-justify-start ml-20" v-if="detail.can_update">
         <el-select v-model="selectYear2">
           <el-option
-            v-for="item in years"
+            v-for="item in years2"
             :key="item.value"
             :label="item.label"
             :value="item.value"
@@ -105,8 +107,8 @@
           <div
             class="flex flex-justify-start flex-align-center full-width flex-child-average"
           >
-            <div class="value flex flex-justify-end">
-              {{ item.year }}年度计划纳统投资(万元)
+            <div class="value flex flex-justify-end mr-10">
+              {{ item.year }}年度计划纳统投资
             </div>
             <el-input
               type="number"
@@ -118,9 +120,7 @@
           <div
             class="flex flex-justify-start flex-align-center full-width flex-child-average"
           >
-            <div class="value flex flex-justify-end">
-              年度累计纳统投资(万元)
-            </div>
+            <div class="value flex flex-justify-end">年度累计纳统投资</div>
             <div class="ml-20 value-box flex flex-justify-start">
               {{ item.actualSum }}
             </div>
@@ -248,6 +248,7 @@ export default {
       currentMonth: null,
       show: false,
       years: [],
+      years2: [],
       selectYear: '',
       selectYear2: ''
     }
@@ -255,22 +256,35 @@ export default {
   methods: {
     initYear() {
       this.years.length = 0
+      this.years2.length = 0
       let localYears = []
+      let localYears2 = []
+      if (this.detail && this.detail.amount && this.detail.amount.data) {
+        localYears = this.detail.amount.data.map(ele => ele.year)
+      }
+      const year = new Date().getFullYear()
+      for (let i = 2017; i <= year + 1; i++) {
+        const item = { label: i, value: i }
+        if (localYears.findIndex(sub => sub === i) === -1) {
+          this.years.push(item)
+        }
+      }
+
       if (
         this.detail &&
         this.detail.investment &&
         this.detail.investment.data
       ) {
-        localYears = this.detail.investment.data.map(ele => ele.year)
+        localYears2 = this.detail.investment.data.map(ele => ele.year)
       }
-      const year = new Date().getFullYear()
       for (let i = 2017; i <= year + 1; i++) {
         const item = { label: i, value: i }
-        if (localYears.findIndex(sub => sub === i) === -1) {
-          this.years.push(item)
+        if (localYears2.findIndex(sub => sub === i) === -1) {
+          this.years2.push(item)
         }
       }
       this.years.reverse()
+      this.years2.reverse()
     },
     /**
      * 新增年度
@@ -305,17 +319,8 @@ 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] }
-      }
+      this.form.amount = { data: [...this.amount] }
+      this.form.investment = { data: [...this.investment] }
     },
     /**
      * 更新数据