Jelajahi Sumber

分精度图以及bug的修复

zhulizhen 6 tahun lalu
induk
melakukan
fac70195b4

+ 18 - 20
src/views/detail/EneryParams.vue

@@ -14,49 +14,49 @@
                     <td class="ivu-table-cell fixed-td">逐时用电功率</td>
                     <td class="ivu-table-cell test">{{roomInfo.infos.ElecConsumP || '--'}} </td>
                     <td class="ivu-table-cell" >{{ ElecConsumPData || '--'}} kW</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.ElecConsumP)">查看</button></td>
+                    <td class="ivu-table-cell" ><button v-if="roomInfo.infos.ElecConsumP" class="look-btn" @click="getBoundData(roomInfo.infos.ElecConsumP)">查看</button></td>
                   </tr>
                   <tr class="ivu-table-row" >
                     <td class="ivu-table-cell fixed-td" >逐时用燃气量</td>
                     <td class="ivu-table-cell test">{{roomInfo.infos.GasConsumP || '--'}}</td>
                     <td class="ivu-table-cell" >{{GasConsumPData || '--'}} m³/h</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.GasConsumP)">查看</button></td>
+                    <td class="ivu-table-cell" ><button v-if="roomInfo.infos.GasConsumP" class="look-btn" @click="getBoundData(roomInfo.infos.GasConsumP)">查看</button></td>
                   </tr>
                   <tr class="ivu-table-row" >
                     <td class="ivu-table-cell fixed-td">燃气压力</td>
                     <td class="ivu-table-cell test">{{roomInfo.infos.GasPress || '--'}}</td>
                     <td class="ivu-table-cell" >{{GasPressData || '--'}} Pa</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.GasPress)">查看</button></td>
+                    <td class="ivu-table-cell" ><button v-if="roomInfo.infos.GasPress" class="look-btn" @click="getBoundData(roomInfo.infos.GasPress)">查看</button></td>
                   </tr>
                   <tr class="ivu-table-row" >
                     <td class="ivu-table-cell fixed-td" >逐时用燃油量</td>
                     <td class="ivu-table-cell test">{{roomInfo.infos.FuelConsumP || '--'}} </td>
                     <td class="ivu-table-cell" >{{FuelConsumPData || '--'}} L/h</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.FuelConsumP)">查看</button></td>
+                    <td class="ivu-table-cell" ><button v-if="roomInfo.infos.FuelConsumP" class="look-btn" @click="getBoundData(roomInfo.infos.FuelConsumP)">查看</button></td>
                   </tr>
                   <tr class="ivu-table-row" >
                     <td class="ivu-table-cell ">燃油压力</td>
                     <td class="ivu-table-cell test">{{roomInfo.infos.FuelPress || '--'}}</td>
                     <td class="ivu-table-cell" >{{FuelPressData || '--'}} MPa</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.FuelPress)">查看</button></td>
+                    <td class="ivu-table-cell" ><button v-if="roomInfo.infos.FuelPress" class="look-btn" @click="getBoundData(roomInfo.infos.FuelPress)">查看</button></td>
                   </tr>
                   <tr class="ivu-table-row" >
                     <td class="ivu-table-cell ">逐时用水量</td>
                     <td class="ivu-table-cell test">{{roomInfo.infos.WaterConsumP || '--'}}</td>
                     <td class="ivu-table-cell" >{{WaterConsumPData || '--'}} m³/h</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.WaterConsumP)">查看</button></td>
+                    <td class="ivu-table-cell" ><button v-if="roomInfo.infos.WaterConsumP" class="look-btn" @click="getBoundData(roomInfo.infos.WaterConsumP)">查看</button></td>
                   </tr>
                   <tr class="ivu-table-row" >
                     <td class="ivu-table-cell">自来水压力</td>
                     <td class="ivu-table-cell test">{{roomInfo.infos.WaterPress || '--'}}</td>
                     <td class="ivu-table-cell" >{{WaterPressData || '--'}} MPa</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.WaterPress)">查看</button></td>
+                    <td  class="ivu-table-cell" ><button v-if="roomInfo.infos.WaterPress" class="look-btn" @click="getBoundData(roomInfo.infos.WaterPress)">查看</button></td>
                   </tr>
                   <tr class="ivu-table-row" >
                     <td class="ivu-table-cell " >逐时用热量</td>
                     <td class="ivu-table-cell test">{{roomInfo.infos.HeatConsumP || '--'}}</td>
                     <td class="ivu-table-cell" >{{HeatConsumPData || '--'}} kW</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.HeatConsumP)">查看</button></td>
+                    <td  class="ivu-table-cell" ><button v-if='roomInfo.infos.HeatConsumP' class="look-btn" @click="getBoundData(roomInfo.infos.HeatConsumP)">查看</button></td>
                   </tr>
                 </table>
                </div>
@@ -71,8 +71,8 @@
 
 <script>
 import axios from 'axios'
-import {formatTime} from '../../tools/formatTime.js'
 // import {currentTime} from '../../tools/currentDate.js'
+import {formatTime, amendTime, date} from '../../tools/formatTime.js'
 import alarmCharts from '../main/AlarmCharts'
 export default {
   components: {
@@ -217,19 +217,17 @@ export default {
     getBoundData (code) {
       document.querySelector(".mask-bg").style.display = 'block'
       document.querySelector(".mask-layout").style.display = 'block'
+      let period = "5min"
+      let receivetime = {
+        $gte: date(amendTime(Date.parse(new Date()) - 24 * 60 * 60 * 60 * 30)),
+        $lt: date(amendTime(Date.parse(new Date())))
+      }
       let params = {
         criteria: {
-          // id: this.roomInfo.id,
-          id: "Sp1101080001001004013",
-          // code:code,
-          code: "CO2", // 信息点编码
-          // period: period,
-          period: "5min",
-          // receivetime:receivetime,
-          receivetime: {
-            $gte: "20190110000000",
-            $lt: "20190111000000"
-          }
+          id: this.roomInfo.id,
+          code: code, // 信息点编码
+          period: period,
+          receivetime: receivetime
         }
       }
       axios.post(`/data-platform-3/data-platform-3/hisdata/query_period_data?projectId=${this.$store.state.projId}&secret=`, params).then(res => {

+ 25 - 20
src/views/detail/EnvirmentParams.vue

@@ -15,49 +15,49 @@
                     <td class="ivu-table-cell fixed-td">空气(干球)温度</td>
                    <td class="ivu-table-cell test" >{{roomInfo.infos.Tdb || '--'}}</td>
                     <td class="ivu-table-cell" >{{TdbData || '--'}} ℃</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.Tdb)">查看</button></td>
+                    <td class="ivu-table-cell" ><button v-if="roomInfo.infos.Tdb" class="look-btn" @click="getBoundData(roomInfo.infos.Tdb)">查看</button></td>
                   </tr>
                   <tr class="ivu-table-row" >
                     <td class="ivu-table-cell fixed-td" >空气相对湿度</td>
                     <td class="ivu-table-cell test" >{{roomInfo.infos.RH || '--'}}</td>
                     <td class="ivu-table-cell" >{{ RHData || '--'}} %RH</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.RH)">查看</button></td>
+                    <td class="ivu-table-cell" ><button v-if="roomInfo.infos.RH" class="look-btn" @click="getBoundData(roomInfo.infos.RH)">查看</button></td>
                   </tr>
                   <tr class="ivu-table-row">
                     <td class="ivu-table-cell fixed-td" >空气密度</td>
                     <td class="ivu-table-cell test" >{{roomInfo.infos.Rou || '--'}}</td>
                     <td class="ivu-table-cell" >{{ RouData || '--'}} kg/m³</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.Rou)">查看</button></td>
+                    <td class="ivu-table-cell" ><button v-if="roomInfo.infos.Rou" class="look-btn" @click="getBoundData(roomInfo.infos.Rou)">查看</button></td>
                   </tr>
                   <tr class="ivu-table-row" >
                     <td class="ivu-table-cell fixed-td" >空气湿球温度</td>
                     <td class="ivu-table-cell test" >{{roomInfo.infos.Twb || '--'}}</td>
                     <td class="ivu-table-cell" >{{TwbData || '--'}} ℃</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.Twb)">查看</button></td>
+                    <td class="ivu-table-cell" ><button v-if="roomInfo.infos.Twb" class="look-btn" @click="getBoundData(roomInfo.infos.Twb)">查看</button></td>
                   </tr>
                   <tr class="ivu-table-row" >
                     <td class="ivu-table-cell fixed-td" >空气CO2浓度</td>
                     <td class="ivu-table-cell test" >{{roomInfo.infos.CO2 || '--'}}</td>
                     <td class="ivu-table-cell" >{{COData || '--'}} ppm</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.CO2)">查看</button></td>
+                    <td class="ivu-table-cell" ><button v-if="roomInfo.infos.CO2" class="look-btn" @click="getBoundData(roomInfo.infos.CO2)">查看</button></td>
                   </tr>
                   <tr class="ivu-table-row" >
                     <td class="ivu-table-cell fixed-td" >空气PM2.5浓度</td>
                     <td class="ivu-table-cell test">{{roomInfo.infos['PM2.5'] || '--'}}</td>
                     <td class="ivu-table-cell" >{{PM25Data || '--'}}</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos['PM2.5'])">查看</button></td>
+                    <td class="ivu-table-cell" ><button v-if="roomInfo.infos['PM2.5']" class="look-btn" @click="getBoundData(roomInfo.infos['PM2.5'])">查看</button></td>
                   </tr>
                   <tr class="ivu-table-row">
                     <td class="ivu-table-cell fixed-td" >空气PM10浓度</td>
                     <td class="ivu-table-cell test">{{roomInfo.infos.PM10 || '--'}}</td>
                     <td class="ivu-table-cell" >{{PM10Data || '--'}} mg/m³</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.PM10)">查看</button></td>
+                    <td class="ivu-table-cell" ><button v-if="roomInfo.infos.PM10" class="look-btn" @click="getBoundData(roomInfo.infos.PM10)">查看</button></td>
                   </tr>
                   <tr class="ivu-table-row">
                     <td class="ivu-table-cell fixed-td" >空气甲烷浓度</td>
                     <td class="ivu-table-cell test">{{roomInfo.infos.CH4 || '--'}}</td>
                     <td class="ivu-table-cell" >{{ CHData || '--'}} ppm</td>
-                    <td class="ivu-table-cell" ><button class="look-btn" @click="getBoundData(roomInfo.infos.CH4)">查看</button></td>
+                    <td class="ivu-table-cell" ><button v-if="roomInfo.infos.CH4" class="look-btn" @click="getBoundData(roomInfo.infos.CH4)">查看</button></td>
                   </tr>
                 </table>
                </div>
@@ -72,7 +72,7 @@
 
 <script>
 import axios from 'axios'
-import {formatTime} from '../../tools/formatTime.js'
+import {formatTime, amendTime, date} from '../../tools/formatTime.js'
 // import {currentTime} from '../../tools/currentDate.js'
 import alarmCharts from '../main/AlarmCharts'
 export default {
@@ -223,19 +223,24 @@ export default {
     getBoundData (code) {
       document.querySelector(".mask-bg").style.display = 'block'
       document.querySelector(".mask-layout").style.display = 'block'
+      let period = "5min"
+      let receivetime = {
+        $gte: date(amendTime(Date.parse(new Date()) - 24 * 60 * 60 * 60 * 30)),
+        $lt: date(amendTime(Date.parse(new Date())))
+      }
       let params = {
         criteria: {
-          // id: this.roomInfo.id,
-          id: "Sp1101080001001004013",
-          // code:code,
-          code: "CO2", // 信息点编码
-          // period: period,
-          period: "5min",
-          // receivetime:receivetime,
-          receivetime: {
-            $gte: "20190110000000",
-            $lt: "20190111000000"
-          }
+          id: this.roomInfo.id,
+          // id: "Sp1101080001001004013",
+          code: code, // 信息点编码
+          // code: "CO2"
+          period: period,
+          // period: "5min",
+          receivetime: receivetime
+          // receivetime: {
+          //   $gte: "20190110000000",
+          //   $lt: "20190111000000"
+          // }
         }
       }
       axios.post(`/data-platform-3/data-platform-3/hisdata/query_period_data?projectId=${this.$store.state.projId}&secret=`, params).then(res => {

+ 38 - 22
src/views/spread/index.vue

@@ -118,7 +118,7 @@
      </div>
      <div class="vr-right">
       <eq-right :Info='Info' :ElecConsumPData='ElecConsumPData' :subsetCount='subsetCount' :repairRadio='repairRadio'
-      :AccElecConsumData="AccElecConsumData" :orderCount='orderCount' :RunStatusData='RunStatusData' :moniData='moniData'></eq-right>
+      :AccElecConsumData="AccElecConsumData" :noAlarmNum='noAlarmNum' :orderCount='orderCount' :RunStatusData='RunStatusData' :moniData='moniData'></eq-right>
      </div>
      <div class="mask-bg"></div>
      <div class="mask">
@@ -186,6 +186,7 @@ export default {
       tableData: [],
       isQR: 1,
       objectId: 'Eq1101080001001ACCCOP014',
+      noAlarmNum: 0, // 未恢复的报警数
       ElecConsumPData: "", // 耗电
       AccElecConsumData: "", // 累计
       orderCount: 0, // 工单
@@ -233,6 +234,21 @@ export default {
       this.getCurrentData(this.objectId)
       this.underwayOrder(this.objectId)
       this.getMoniCount(this.objectId)
+      this.getNoAlarmNum(this.objectId)
+      this.getEqRepair()
+    },
+    // 右侧未恢复报警数
+    getNoAlarmNum (objectId) {
+      let params = {
+        "criteria": {
+          "objectId": objectId, // 空间id
+          "status": "alarm"
+        }
+      }
+      axios.post(`/alarm-system/alarm-system/alarm/list?projectId=${this.$store.state.projId}&secret=`, params).then(res => {
+        let data = res.data
+        this.noAlarmNum = data.Count
+      })
     },
     // 右侧进行中的工单
     underwayOrder (objectId) {
@@ -341,28 +357,28 @@ export default {
         }
       })
     },
-    // 资产
+    // 资产 (目前没有)
     getTableData (key) {
-      let params = {
-        criteria: {
-          graphType: 'EquipinSpace',
-          relType: '1',
-          toId: this.objctId, // 空间id
-          side: 'fromId'
-        }
-      }
-      axios.post(`/data-platform-3/data-platform-3/property/id_query?projectId=${this.$store.state.projId}&secret=`, params).then(res => {
-        let data = res.data
-        if (data.Result == 'success') {
-          this.tableData = data.Content
-          this.tableData.forEach(el => {
-            el.eqName = el.infos.EquipLocalName || '--'
-            el.eqId = el.infos.EquipLocalID || '--'
-            el.category = el.category // 记得翻译
-            el.location = el.location ? el.location.building : '--' // 拼接
-          })
-        }
-      })
+      // let params = {
+      //   criterias: {
+      //     graphType: 'EquipinSpace',
+      //     relType: '1',
+      //     toId: this.objectId, // 空间id
+      //     side: 'fromId'
+      //   }
+      // }
+      // axios.post(`/data-platform-3/data-platform-3/property/id_query?projectId=${this.$store.state.projId}&secret=`, params).then(res => {
+      //   let data = res.data
+      //   if (data.Result == 'success') {
+      //     this.tableData = data.Content
+      //     this.tableData.forEach(el => {
+      //       el.eqName = el.infos.EquipLocalName || '--'
+      //       el.eqId = el.infos.EquipLocalID || '--'
+      //       el.category = el.category // 记得翻译
+      //       el.location = el.location ? el.location.building : '--' // 拼接
+      //     })
+      //   }
+      // })
     },
     initData (objectId) {
       let params = {