Browse Source

智慧中心

Shannon_mu 3 years ago
parent
commit
5f33ba0345

+ 0 - 1
commandCenter/src/components/common/Header.vue

@@ -26,7 +26,6 @@
                 <el-select
                     v-model="communityId"
                     placeholder="所有社区"
-                    clearable
                     class="saveColumn-select"
                     @change="$store.commit('setHomeCommunityAll', communityId)"
                 >

+ 1 - 1
commandCenter/src/views/smallModule/alarmTrendAnalysis.vue

@@ -45,7 +45,7 @@ export default {
         }
     },
     created() {
-        this.getData();
+
     }
 };
 </script>

+ 8 - 8
commandCenter/src/views/smallModule/allcommunit.js

@@ -8,6 +8,7 @@ export default {
   computed: {
     //全局社区
     ...mapState(['homeCommunityAll']),
+
     resize() {
       // 通过scale值来判断窗口是变化
       return this.$store.getters['getScale'];
@@ -15,18 +16,17 @@ export default {
   },
   watch: {
     //全局社区接口调用
-    homeCommunityAll(val) {
-      try {
-        this.mixins_query.communityId = val;
-        this.getData();
-      } catch {
-
-      }
-
+    'homeCommunityAll'(n) {
+      this.mixins_query.communityId = n;
+      this.getData();
     }, resize(va) {
       // console.log(va);
     }
   },
   methods: {
+  },
+  created() {
+    this.mixins_query.communityId = this.homeCommunityAll;
+    this.getData();
   }
 }

+ 1 - 1
commandCenter/src/views/smallModule/lastMonthAlarm.vue

@@ -56,7 +56,7 @@ export default {
         }
     },
     created() {
-        this.getData();
+     
     }
 };
 </script>

+ 1 - 1
commandCenter/src/views/smallModule/passengerFlowStatistics.vue

@@ -75,7 +75,7 @@ export default {
         }
     },
     created() {
-        this.getData();
+        
     }
 };
 </script>

+ 0 - 1
commandCenter/src/views/smallModule/patrolTaskCompletionRate.vue

@@ -73,7 +73,6 @@ export default {
     },
     created() {
         this.mixins_query.date = this.$moment().format('YYYY-MM-DD');
-        this.getData();
     }
 };
 </script>

+ 26 - 2
commandCenter/src/views/smallModule/powerConsumption.vue

@@ -33,7 +33,15 @@ export default {
             },
             clientOptions: columnOptionsChart(
                 '(度)',
-                ['01-01', '01-02', '01-03', '01-04', '01-05', '01-06', '01-07'],
+                [
+                    this.$moment().subtract('days', 6).format('MM-DD'),
+                    this.$moment().subtract('days', 5).format('MM-DD'),
+                    this.$moment().subtract('days', 4).format('MM-DD'),
+                    this.$moment().subtract('days', 3).format('MM-DD'),
+                    this.$moment().subtract('days', 2).format('MM-DD'),
+                    this.$moment().subtract('days', 1).format('MM-DD'),
+                    this.$moment().format('MM-DD')
+                ],
                 [{ data: [0, 0, 0, 0, 0, 0, 0], name: '用电量' }],
                 [],
                 10
@@ -54,13 +62,29 @@ export default {
                             datas.push(item.value);
                         });
                         this.clientOptions = columnOptionsChart('(度)', times, [{ data: datas, name: '用电量' }], [], 10);
+                    } else {
+                        this.clientOptions = columnOptionsChart(
+                            '(度)',
+                            [
+                                this.$moment().subtract('days', 6).format('MM-DD'),
+                                this.$moment().subtract('days', 5).format('MM-DD'),
+                                this.$moment().subtract('days', 4).format('MM-DD'),
+                                this.$moment().subtract('days', 3).format('MM-DD'),
+                                this.$moment().subtract('days', 2).format('MM-DD'),
+                                this.$moment().subtract('days', 1).format('MM-DD'),
+                                this.$moment().format('MM-DD')
+                            ],
+                            [{ data: [0, 0, 0, 0, 0, 0, 0], name: '用电量' }],
+                            [],
+                            10
+                        );
                     }
                 })
                 .catch((err) => {});
         }
     },
     created() {
-        this.getData();
+        // this.getData();
     }
 };
 </script>

+ 0 - 1
commandCenter/src/views/smallModule/proportionOfAlarmTypes.vue

@@ -61,7 +61,6 @@ export default {
         }
     },
     created() {
-        this.getData();
     }
 };
 </script>

+ 26 - 2
commandCenter/src/views/smallModule/waterConsumption.vue

@@ -33,7 +33,15 @@ export default {
             },
             clientOptions: columnOptionsChart(
                 '(吨)',
-                ['01-01', '01-02', '01-03', '01-04', '01-05', '01-06', '01-07'],
+                [
+                    this.$moment().subtract('days', 6).format('MM-DD'),
+                    this.$moment().subtract('days', 5).format('MM-DD'),
+                    this.$moment().subtract('days', 4).format('MM-DD'),
+                    this.$moment().subtract('days', 3).format('MM-DD'),
+                    this.$moment().subtract('days', 2).format('MM-DD'),
+                    this.$moment().subtract('days', 1).format('MM-DD'),
+                    this.$moment().format('MM-DD')
+                ],
                 [{ data: [0, 0, 0, 0, 0, 0, 0], name: '用水量' }],
                 [],
                 10
@@ -54,13 +62,29 @@ export default {
                             datas.push(item.value);
                         });
                         this.clientOptions = columnOptionsChart('(吨)', times, [{ data: datas, name: '用水量' }], [], 10);
+                    } else {
+                        this.clientOptions = columnOptionsChart(
+                            '(吨)',
+                            [
+                                this.$moment().subtract('days', 6).format('MM-DD'),
+                                this.$moment().subtract('days', 5).format('MM-DD'),
+                                this.$moment().subtract('days', 4).format('MM-DD'),
+                                this.$moment().subtract('days', 3).format('MM-DD'),
+                                this.$moment().subtract('days', 2).format('MM-DD'),
+                                this.$moment().subtract('days', 1).format('MM-DD'),
+                                this.$moment().format('MM-DD')
+                            ],
+                            [{ data: [0, 0, 0, 0, 0, 0, 0], name: '用水量' }],
+                            [],
+                            10
+                        );
                     }
                 })
                 .catch((err) => {});
         }
     },
     created() {
-        this.getData();
+        // this.getData();
     }
 };
 </script>

+ 0 - 1
commandCenter/src/views/smallModule/workOrderProcessingStatus.vue

@@ -62,7 +62,6 @@ export default {
         }
     },
     created() {
-        this.getData();
     }
 };
 </script>