dedsudiyu 1 month ago
parent
commit
3423ce2ad3

+ 5 - 0
src/views/components/mapComponent.vue

@@ -6,6 +6,7 @@
         getFloorId(mapData.floorId)==4?'mapComponent-map-8-10':'')))"
        class="mapComponent">
     <div class="map-for-room-box"
+         @click="checkSub(index)"
          :class="checkIndex==index&&item.status==1?'check-idle-color':(
          checkIndex!=index&&item.status==1?'idle-color':(
          checkIndex==index&&item.status==2?'check-use-color':(
@@ -103,6 +104,10 @@
       this.initialize(true)
     },
     methods: {
+      checkSub(index){
+        this.$set(this,'checkIndex',index);
+        this.getSubData({alarmType:false});
+      },
       //初始化
       initialize(type) {
         let text = window.location.href

+ 9 - 3
src/views/components/usageRateComponent.vue

@@ -49,14 +49,20 @@
     methods: {
       dashboardsFacilitiesUsageStats() {
         let self = this
+        let text = window.location.href
+        let urlList = text.split('?')[1].split('&')
+        let codeData = {}
+        urlList.forEach((item) => {
+          codeData[item.split('=')[0]] = item.split('=')[1]
+        })
         this.$set(this.config,'data',[]);
-        dashboardsFacilitiesUsageStats().then(res => {
+        dashboardsFacilitiesUsageStats({floorid:codeData.floorId}).then(res => {
           let list = []
           for (let i = 0; i < res.data.monthlyUsage.length; i++) {
             let obj = {
               name: res.data.monthlyUsage[i].equTypeName,
-              num: res.data.monthlyUsage[i].equRentingCount,
-              value: res.data.monthlyUsage[i].equRentingCount == 0 ? res.data.monthlyUsage[i].equRentingCount + '%' : self.calculatePercentage(res.data.monthlyUsage[i].equRentingCount, res.data.monthlyUsage[i].equCount, { decimal: 0 })
+              num: res.data.monthlyUsage[i].rentedCount,
+              value: this.accMul(res.data.monthlyUsage[i].rentingMonthFromYearRate,100).toFixed(0)
             }
             list.push(obj)
           }