Browse Source

修复切换数据重置问题

wangcc 2 years ago
parent
commit
41cd32adc0

+ 3 - 3
src/components/ParkingRate/index.vue

@@ -3,7 +3,7 @@
  * @Author: wangcc
  * @Date: 2023-01-09 11:22:53
  * @LastEditors: wangcc
- * @LastEditTime: 2023-01-30 14:55:59
+ * @LastEditTime: 2023-02-17 16:00:13
  * @FilePath: \parking_LargeScreen\src\components\ParkingRate\index.vue
  * @Copyright: Copyright (c) 2016~2023 by wangcc, All Rights Reserved. 
 -->
@@ -181,8 +181,8 @@ export default {
     };
   },
   mounted() {
-    this.videoPlayerPark();
-    this.videoPlayerRoad();
+    // this.videoPlayerPark();
+    // this.videoPlayerRoad();
   },
   created() {
     this.getVehicleData();

+ 1 - 1
src/components/Receivables/PercenTage.vue

@@ -43,7 +43,7 @@ export default {
         99: '其他'
       },
       searchFrom: {
-        isRoad: '1'
+        isRoad: this.$store.state.addr.isRoad
       },
       setTime: ''
     };

+ 27 - 17
src/components/Receivables/Receivables.vue

@@ -3,7 +3,7 @@
  * @Author: wangcc
  * @Date: 2023-01-09 11:20:54
  * @LastEditors: wangcc
- * @LastEditTime: 2023-01-29 13:52:53
+ * @LastEditTime: 2023-02-17 16:08:45
  * @FilePath: \parking_LargeScreen\src\components\Receivables\Receivables.vue
  * @Copyright: Copyright (c) 2016~2023 by wangcc, All Rights Reserved. 
 -->
@@ -16,7 +16,9 @@
         </div>
         <div class="total-num-box">
           <span class="total-title">{{countName}}</span>
-          <span class="total-num"><Count-to :startVal='startVal' :endVal='totalData.roadTotal' :duration='4000'></Count-to></span>
+          <span class="total-num">
+            <Count-to :startVal="startVal" :endVal="totalData.roadTotal" :duration="4000"></Count-to>
+          </span>
         </div>
       </div>
       <div class="item-list">
@@ -25,7 +27,9 @@
         </div>
         <div class="total-num-box">
           <span class="total-title">车位数(个)</span>
-          <span class="total-num"><Count-to :startVal='startVal' :endVal='totalData.spaceTotal' :duration='4000'></Count-to></span>
+          <span class="total-num">
+            <Count-to :startVal="startVal" :endVal="totalData.spaceTotal" :duration="4000"></Count-to>
+          </span>
         </div>
       </div>
       <div class="item-list">
@@ -34,7 +38,9 @@
         </div>
         <div class="total-num-box">
           <span class="total-title">累计实收(元)</span>
-          <span class="total-num"><Count-to :startVal='startVal' :endVal='totalData.realAmount' :duration='4000'></Count-to></span>
+          <span class="total-num">
+            <Count-to :startVal="startVal" :endVal="totalData.realAmount" :duration="4000"></Count-to>
+          </span>
         </div>
       </div>
       <div class="item-list">
@@ -43,7 +49,9 @@
         </div>
         <div class="total-num-box">
           <span class="total-title">累计停车次数(次)</span>
-          <span class="total-num"><Count-to :startVal='startVal' :endVal='totalData.countVehicle' :duration='4000'></Count-to></span>
+          <span class="total-num">
+            <Count-to :startVal="startVal" :endVal="totalData.countVehicle" :duration="4000"></Count-to>
+          </span>
         </div>
       </div>
     </div>
@@ -74,19 +82,24 @@ export default {
     return {
       amountData: {
         countVehicle: '',
-        realAmount:''
+        realAmount: ''
       },
       startVal: 0,
       totalData: {},
       countName: '路段数量(个)',
       searchFrom: {
-        isRoad: '1'
-      },
+        isRoad: this.$store.state.addr.isRoad
+      }
     };
   },
   created() {
     this.getTotalData();
-    this.getAmtVehicle()
+    this.getAmtVehicle();
+    if (this.$store.state.addr.isRoad == 0) {
+      this.countName = '停车场数量(个)';
+    } else {
+      this.countName = '路段数量(个)';
+    }
   },
   watch: {
     '$store.state.addr.isRoad': {
@@ -98,13 +111,11 @@ export default {
         }
         this.searchFrom.isRoad = val;
         this.getTotalData();
-        this.getAmtVehicle()
+        this.getAmtVehicle();
       }
     }
   },
-   mounted() {
-
-  },
+  mounted() {},
   methods: {
     async getTotalData() {
       let { code, data } = await totalData(this.searchFrom);
@@ -115,8 +126,8 @@ export default {
     async getAmtVehicle() {
       let { code, data } = await amtVehicle(this.searchFrom);
       if (code == 200) {
-        data.countVehicle = data.countVehicle.toString()
-        data.realAmount = data.realAmount.toString()
+        data.countVehicle = data.countVehicle.toString();
+        data.realAmount = data.realAmount.toString();
         this.amountData = data;
       }
     }
@@ -173,7 +184,7 @@ export default {
       margin-bottom: 28px;
     }
   }
-  
+
   .toDay-total {
     background: RGBA(24, 33, 52, 0.3);
     backdrop-filter: blur(10px);
@@ -201,5 +212,4 @@ export default {
     }
   }
 }
-
 </style>

+ 2 - 2
src/components/Receivables/analyse.vue

@@ -3,7 +3,7 @@
  * @Author: wangcc
  * @Date: 2023-01-11 15:28:30
  * @LastEditors: wangcc
- * @LastEditTime: 2023-02-17 13:50:30
+ * @LastEditTime: 2023-02-17 16:03:21
  * @FilePath: \parking_LargeScreen\src\components\Receivables\analyse.vue
  * @Copyright: Copyright (c) 2016~2023 by wangcc, All Rights Reserved. 
 -->
@@ -38,7 +38,7 @@ export default {
       },
       hackReset: false,
       searchFrom: {
-        isRoad: '1'
+        isRoad: this.$store.state.addr.isRoad
       },
       setTime: ''
     };

+ 7 - 2
src/components/Receivables/ranking.vue

@@ -3,7 +3,7 @@
  * @Author: wangcc
  * @Date: 2023-01-11 12:08:30
  * @LastEditors: wangcc
- * @LastEditTime: 2023-01-11 17:58:18
+ * @LastEditTime: 2023-02-17 16:08:01
  * @FilePath: \parking_LargeScreen\src\components\Receivables\ranking.vue
  * @Copyright: Copyright (c) 2016~2023 by wangcc, All Rights Reserved. 
 -->
@@ -37,12 +37,17 @@ export default {
       countName: '路段名称',
       tableData: [],
       searchFrom: {
-        isRoad: '1'
+        isRoad: this.$store.state.addr.isRoad
       }
     };
   },
   created() {
     this.getAmtTop();
+    if (this.$store.state.addr.isRoad == 0) {
+          this.countName = '停车场名称';
+        } else {
+          this.countName = '路段名称';
+        }
   },
   watch: {
     '$store.state.addr.isRoad': {

+ 3 - 3
src/components/charts/PieCharts.vue

@@ -3,7 +3,7 @@
  * @Author: wangcc
  * @Date: 2023-01-11 14:51:13
  * @LastEditors: wangcc
- * @LastEditTime: 2023-02-17 14:19:19
+ * @LastEditTime: 2023-02-17 16:00:50
  * @FilePath: \parking_LargeScreen\src\components\charts\PieCharts.vue
  * @Copyright: Copyright (c) 2016~2023 by wangcc, All Rights Reserved. 
 -->
@@ -56,7 +56,7 @@ export default {
                 fontSize: 35 * scale,
                 width: 35 * scale,
                 fontFamily: 'BarlowBold',
-                padding: [0, 0, 0, 37],
+                padding: [0, 0, 0, 30],
             };
         })
         let options = {
@@ -94,7 +94,7 @@ export default {
                     for (let i = 0; i < echartData.length; i++) {
                         if (echartData[i].name === name) {
                             target = echartData[i].value;
-                            percent = ((echartData[i].value / sumNum) * 100).toFixed(3);
+                            percent = ((echartData[i].value / sumNum) * 100).toFixed(2);
                             str = ` {checkName|${name} } {${'percent' + i}|${percent}} {${'unit' + i}|%}`
                         }
                     }

+ 2 - 2
src/components/map.vue

@@ -3,7 +3,7 @@
  * @Author: wangcc
  * @Date: 2023-01-09 11:19:36
  * @LastEditors: wangcc
- * @LastEditTime: 2023-01-29 11:36:38
+ * @LastEditTime: 2023-02-17 15:59:36
  * @FilePath: \parking_LargeScreen\src\components\map.vue
  * @Copyright: Copyright (c) 2016~2023 by wangcc, All Rights Reserved. 
 -->
@@ -26,7 +26,7 @@ export default {
       show: true,
       infoWindow: null,
       searchFrom: {
-        isRoad: '1'
+        isRoad: this.$store.state.addr.isRoad
       }
     };
   },

+ 8 - 7
src/components/selectLabel.vue

@@ -3,7 +3,7 @@
  * @Author: wangcc
  * @Date: 2023-01-11 09:26:51
  * @LastEditors: wangcc
- * @LastEditTime: 2023-01-11 17:32:43
+ * @LastEditTime: 2023-02-17 15:58:18
  * @FilePath: \parking_LargeScreen\src\components\selectLabel.vue
  * @Copyright: Copyright (c) 2016~2023 by wangcc, All Rights Reserved. 
 -->
@@ -12,7 +12,7 @@
     <div class="typeBox">
       类型:
       <el-select
-        v-model="value"
+        v-model="tabValue"
         style="width:88px;height:24px"
         @change="selectChange"
         :popper-append-to-body="false"
@@ -29,9 +29,10 @@
 import { mapMutations, mapState, mapGetters } from 'vuex';
 export default {
   name: 'selectLabel',
+  // props:{tabValue: ''},
   data() {
     return {
-      value: '1',
+      tabValue: this.$store.state.addr.isRoad,
       options: [
         {
           type: '0',
@@ -44,12 +45,12 @@ export default {
       ]
     };
   },
+  created() {
+  },
   methods: {
-    ...mapMutations([
-      'changeSelectIsRoad',
-    ]),
+    ...mapMutations(['changeSelectIsRoad']),
     selectChange(e) {
-      this.changeSelectIsRoad(e)
+      this.changeSelectIsRoad(e);
     }
   }
 };

+ 5 - 2
src/views/screenIndex/index.vue

@@ -3,7 +3,7 @@
  * @Author: wangcc
  * @Date: 2023-01-09 11:18:33
  * @LastEditors: wangcc
- * @LastEditTime: 2023-01-29 17:09:42
+ * @LastEditTime: 2023-02-17 15:58:54
  * @FilePath: \parking_LargeScreen\src\views\screenIndex\index.vue
  * @Copyright: Copyright (c) 2016~2023 by wangcc, All Rights Reserved. 
 -->
@@ -46,7 +46,8 @@ export default {
   },
   data() {
     return {
-      tabType: '1'
+      tabType: '1',
+      tabValue:''
     };
   },
   created() {
@@ -61,6 +62,8 @@ export default {
       if (item.id !=1) {
         this.$refs.PercenTage.clearTime();
         this.$refs.analyse.clearTime();
+      }else {
+        this.tabValue = '1'
       }
     },
   }