Ver código fonte

万科链接报警子系统的空间详情的调整

zhulizhen 6 anos atrás
pai
commit
f0d07f80c2

+ 2 - 2
src/views/asset/index.vue

@@ -181,7 +181,7 @@ export default {
       flObjName: '--',
       sysObjName: "--",
       isQR: 1,
-      objctId: 'Pe00ce06da7b8c49f4b9e2012a59f1bf3d',
+      objectId: 'Pe00ce06da7b8c49f4b9e2012a59f1bf3d',
       objArr: [],
       linkEq: "", // 资产相关设备
       moniData: 0 // 摄像头
@@ -224,7 +224,7 @@ export default {
     getAssetData () {
       let params = {
         criterias: [
-          {id: this.objctId}
+          {id: this.objectId}
         ],
         'historyInfos': true
       }

+ 1 - 1
src/views/detail/index.vue

@@ -150,7 +150,7 @@ export default {
       this.changeColor = index
     },
     back () {
-      this.$router.push('/vr')
+      history.go(-1)
     },
     // 接受来自父组件路由传过来的参数
     getRouteParams () {

+ 2 - 2
src/views/main/PompBox.vue

@@ -69,8 +69,8 @@
                             </tr>
                         </table>
                    </div>
-                     <Button class="check-line" v-if="detailData.history.length>3 && showHeight" @click="getMoreDetail">查看更多</Button>
-                     <Button class="check-line" v-if="detailData.history.length>3 && !showHeight" @click="closeMoreDetail">收起</Button>
+                     <Button class="check-line" v-if="detailData.history && detailData.history.length>3 && showHeight" @click="getMoreDetail">查看更多</Button>
+                     <Button class="check-line" v-if="detailData.history && detailData.history.length>3 && !showHeight" @click="closeMoreDetail">收起</Button>
                     <p class="remarks" v-if='!recentNote && detailData' @click="showRecentAlarmNote" ><img src="/static/img/warn.png"> 查看近期其他设备的此类报警备注</p>
                    <div class="recent-detail" v-if='recentNote'>
                          <Button class="check-line"  @click="closeRecentAlarmNote">收起</Button>

+ 33 - 20
src/views/rooms/index.vue

@@ -1,9 +1,9 @@
 <template>
-  <div class="rooms">
+  <div class="rooms" v-if="show">
       <div class="eq-top">
            <img src="/static/img/backIcon.jpg" alt="" @click="back">
            <span>空间详情 / </span>
-            <strong>空间名称-空间编号报警详情</strong>
+            <strong>{{RoomName}}-{{objectId}}报警详情</strong>
       </div>
       <div class="eq-head" v-if="false">
 		<div class="f-left"></div>
@@ -29,10 +29,10 @@
                <history-table :historyTableData='historyTableData' :total='total' :Current='pageCurrent'
 		:pageSize='pageSize' @changeCurrentPage='changeCurrentPage'  @setSort='setSort'></history-table>
           </div>
-          <div  v-if="activeIndex==2">
+          <div  v-if="activeIndex==2 && show">
               <my-handle :objectId='objectId'></my-handle>
           </div>
-          <div v-if="activeIndex==3">
+          <div v-if="activeIndex==3 && show">
             <room-eq></room-eq>
           </div>
       </div>
@@ -66,6 +66,7 @@ export default {
 
   data () {
     return {
+      show: false,
       datePickerKey: 'oneMonth',
       dateLimitDays: Number.MAX_SAFE_INTEGER,
       activeIndex: 0,
@@ -91,7 +92,6 @@ export default {
         }, // 位置
         selectedDurationTime: '', // 持续时间
         selectedStartTime: { // 开始时间
-
           dStart: '',
           dEnd: ''
         },
@@ -99,6 +99,7 @@ export default {
       },
       alarmNameList: [],
       objectId: 'Sp1101080002001000007',
+      RoomName: "",
       changeAlarm: 0
     }
   },
@@ -108,17 +109,29 @@ export default {
   },
 
   mounted () {
-    this.getDataList()
-    this.saveAlarmName()
+    // this.getDataList()
+    // this.saveAlarmName()
+    this.getEqNameAndId()
   },
 
   methods: {
+    getEqNameAndId () {
+      let hostUrl = location.search
+      let pid = hostUrl.split('&')[0].toString().split('=')[1]
+      this.$store.commit('setProId', pid)
+      this.RoomName = decodeURI(hostUrl.split('&')[2])
+      this.objectId = hostUrl.split('&')[1]
+      console.log(pid, this.RoomName, this.objectId)
+      this.getDataList(this.objectId)
+      this.saveAlarmName(this.objectId)
+      this.show = true
+    },
     // 监控到如果时间改变,重新触发请求报警条目的函数
     setChangeAlarm () {
-      this.saveAlarmName()
+      this.saveAlarmName(this.objectId)
     },
     // 存储条目数
-    saveAlarmName () {
+    saveAlarmName (objectId) {
       let ctime = {}
       if (Object.values(this.selectParams.selectedStartTime).some(i => i.length)) {
         ctime = {
@@ -129,7 +142,7 @@ export default {
         ctime = null
       }
       let params = {
-        objectId: this.objectId,
+        objectId: objectId,
         ctime: ctime
       }
       axios.post(`/alarm-system/alarm-system/alarm/alarmName/list?projectId=${this.$store.state.projId}&secret=`, params).then(res => {
@@ -143,7 +156,7 @@ export default {
       })
     },
     back () {
-
+      history.go(-1)
     },
     closeBox () {
       document.querySelector('.eq-head').style.display = 'none'
@@ -152,13 +165,13 @@ export default {
     setSort (col) {
       this.order.column = col.key
       this.order.asc = col.order == 'asc'
-      this.getDataList()
+      this.getDataList(this.objectId)
     },
     // 每个下拉框值变化触发表格数据的返回值
     setSelectParams (obj) {
       this.selectParams = obj
       if (this.change == 1) {
-        this.saveAlarmName()
+        this.saveAlarmName(this.objectId)
       }
       if (this.activeIndex == 0) {
         this.status = 'alarm'
@@ -170,7 +183,7 @@ export default {
         this.status = null
         this.autoHandle = null
       }
-      this.getDataList()
+      this.getDataList(this.objectId)
     },
     // 3个按钮的点击传参数
     onClickTab (status) {
@@ -179,7 +192,7 @@ export default {
         this.status = 'alarm'
         this.autoHandle = null
         this.dateLimitDays = Number.MAX_SAFE_INTEGER
-        this.getDataList()
+        this.getDataList(this.objectId)
       } else if (status == 2) {
         this.status = 'alarm'
         this.autoHandle = false
@@ -190,12 +203,12 @@ export default {
         this.dateLimitDays = 30
         this.selectParams.selectedStartTime.dStart = dataPickerConfig[this.datePickerKey].dStart // 20181215000000
         this.selectParams.selectedStartTime.dEnd = dataPickerConfig[this.datePickerKey].dEnd
-        this.getDataList()
-        this.saveAlarmName()
+        this.getDataList(this.objectId)
+        this.saveAlarmName(this.objectId)
       }
     },
     // 默认未恢复的请求函数
-    getDataList () {
+    getDataList (objectId) {
       // 得到项目id和secret
       let params
       // 持续时间的转换
@@ -233,7 +246,7 @@ export default {
       if (this.activeIndex == 0) {
         params = {
           criteria: {
-            objectId: this.objectId,
+            objectId: objectId,
             status: this.status
           },
           order: order
@@ -242,7 +255,7 @@ export default {
         params = {
           criteria: {
             levels: this.selectParams.selectedLevel.length > 0 ? this.selectParams.selectedLevel : null, // 选填,报警等级
-            objectId: this.objectId,
+            objectId: objectId,
             ctime: ctime,
             duration: duration,
             alarmName: this.selectParams.alarmName.length > 0 ? this.selectParams.alarmName : null, // 报警条目

+ 2 - 2
src/views/spread/index.vue

@@ -208,7 +208,7 @@ export default {
   },
 
   mounted () {
-    // this.getId()
+    this.getId()
     this.getEqNameAndId()
     // this.initData(this.objectId)
     // this.getEqRepair()
@@ -216,7 +216,7 @@ export default {
 
   methods: {
     getId () {
-      // this.objectId = this.$route.query.id
+      this.objectId = this.$route.query.id
       this.initData(this.objectId)
       this.searchBuildingName(this.objectId)
       this.getCurrentData(this.objectId)

+ 2 - 2
src/views/system/index.vue

@@ -145,7 +145,7 @@ export default {
     noRecoverAlarm () {
       let params = {
         criteria: {
-          objectId: this.objctId,
+          objectId: this.objectId,
           status: 'alalrm'
         }
       }
@@ -247,7 +247,7 @@ export default {
         criteria: {
           graphType: 'SystemEquip',
           relType: '1',
-          fromId: this.objctId, // 空间id
+          fromId: this.objectId, // 空间id
           side: 'toId'
         }
       }

+ 8 - 2
src/views/vr/EqRight.vue

@@ -53,8 +53,14 @@
        </div>
        <div class="detail-info" >
          <ul>
-           <a :href="`http://47.94.89.44:8058/equipment?pid=${this.$store.state.projId}&${Info.infos.EquipID}&${Info.infos.EquipLocalName}`" target="_black">
-             <li v-if="flag!=2">
+           <a  :href="`/equipment?pid=${this.$store.state.projId}&${Info.infos.EquipID}&${Info.infos.EquipLocalName}`" target="_black">
+             <li v-if="flag==1">
+             <a><img src="/static/img/alarmAandS.png" alt="">未恢复的报警 </a>
+             <span class="type-number">{{noAlarmNum}}<img src="/static/img/left.png" alt=""></span>
+           </li>
+           </a>
+           <a  :href="`/rooms?pid=${this.$store.state.projId}&${Info.infos.RoomID}&${Info.infos.RoomLocalName}`" target="_black">
+             <li v-if="flag==3">
              <a><img src="/static/img/alarmAandS.png" alt="">未恢复的报警 </a>
              <span class="type-number">{{noAlarmNum}}<img src="/static/img/left.png" alt=""></span>
            </li>

+ 46 - 30
src/views/vr/index.vue

@@ -105,7 +105,7 @@
        </div>
      </div>
      <div class="vr-right">
-      <eq-right :envData='envData' :Info='Info' :noAlarmNum='noAlarmNum' :ElecConsumPData='ElecConsumPData'
+      <eq-right :Info='Info' :envData='envData' :noAlarmNum='noAlarmNum' :ElecConsumPData='ElecConsumPData'
       :AccElecConsumData="AccElecConsumData" :orderCount='orderCount' :moniData='moniData'></eq-right>
      </div>
      <div class="mask-bg"></div>
@@ -171,7 +171,7 @@ export default {
       bdObjName: "--",
       flObjName: "--",
       isQR: '',
-      objctId: 'Sp1101080001001003001',
+      objectId: 'Sp1101080001001003001',
       ElecConsumPData: "", // 耗电功率
       AccElecConsumData: "", // 累计用电量
       orderCount: 0, // 工单
@@ -191,26 +191,41 @@ export default {
   },
 
   mounted () {
-    this.initData()
-    this.searchBuildingName()
-    this.noRecoverAlarm()
-    this.envInfo()
-    this.getCurrentData()
-    this.underwayOrder()
-    this.getMoniCount()
+    this.getEqNameAndId()
+    // this.initData()
+    // this.searchBuildingName()
+    // this.noRecoverAlarm()
+    // this.envInfo()
+    // this.getCurrentData()
+    // this.underwayOrder()
+    // this.getMoniCount()
   },
 
   methods: {
+    getEqNameAndId () {
+      let hostUrl = location.search
+      this.objectId = hostUrl.split("&")[0].toString().split("=")[1]
+      let pid = hostUrl.split("&")[1].toString().split("=")[1]
+      console.log(pid, this.$store.state.projId)
+      this.$store.commit('setProId', pid)
+      this.initData(this.objectId)
+      this.searchBuildingName(this.objectId)
+      this.noRecoverAlarm(this.objectId)
+      this.envInfo(this.objectId)
+      this.getCurrentData(this.objectId)
+      this.underwayOrder(this.objectId)
+      this.getMoniCount(this.objectId)
+    },
     // 右侧耗电功率和累计用电量的统计
-    getCurrentData () {
+    getCurrentData (objectId) {
       let params = {
         criterias: [
           {
-            id: this.objctId,
+            id: objectId,
             code: "ElecConsumP"
           },
           {
-            id: this.objctId,
+            id: objectId,
             code: "AccElecConsum"
           }
         ]
@@ -231,10 +246,10 @@ export default {
       })
     },
     // 右侧进行中的工单
-    underwayOrder () {
+    underwayOrder (objectId) {
       let params = {
         order_state: "5",
-        space_ids: [this.objctId],
+        space_ids: [objectId],
         user_id: "systemId",
         project_id: this.$store.state.projId,
         start_time: "20180101000000",
@@ -246,9 +261,9 @@ export default {
       })
     },
     // 摄像头数量
-    getMoniCount () {
+    getMoniCount (objectId) {
       let params = {
-        id: this.objctId
+        id: objectId
       }
       axios.post(`/api/front-api/monitor/list?projectId=${this.$store.state.projId}&secret=`, params).then(res => {
         let data = res.data
@@ -258,12 +273,12 @@ export default {
       })
     },
     // 空间建筑的名称查询
-    searchBuildingName () {
+    searchBuildingName (objectId) {
       let params = {
         keywords: [],
         category: ['SpObj'],
         limit: 1,
-        ids: [this.objctId]
+        ids: [objectId]
       }
       axios.post(`/data-platform-3/data-platform-3/object/search?projectId=${this.$store.state.projId}&secret=`, params).then(res => {
         let data = res.data
@@ -279,10 +294,10 @@ export default {
       })
     },
     // 未恢复的报警条数
-    noRecoverAlarm () {
+    noRecoverAlarm (objectId) {
       let params = {
         criteria: {
-          objectId: this.objctId,
+          objectId: objectId,
           status: 'alalrm'
         }
       }
@@ -294,13 +309,13 @@ export default {
       })
     },
     // c02等信息
-    envInfo () {
+    envInfo (objectId) {
       let params = {
         criterias: [
-          { id: this.objctId, code: 'Tdb' },
-          { id: this.objctId, code: 'RH' },
-          { id: this.objctId, code: 'CO2' },
-          { id: this.objctId, code: 'PM2.5' }
+          { id: objectId, code: 'Tdb' },
+          { id: objectId, code: 'RH' },
+          { id: objectId, code: 'CO2' },
+          { id: objectId, code: 'PM2.5' }
         ]
       }
       axios.post(`/data-platform-3/data-platform-3/parameter/batch_query_param?projectId=${this.$store.state.projId}&secret=`, params).then(res => {
@@ -325,16 +340,17 @@ export default {
       })
     },
     // 获取数据信息
-    initData () {
+    initData (objectId) {
       let params = {
         criterias: [
-          {id: this.objctId}
+          {id: objectId}
         ]
       }
       axios.post(`/data-platform-3/data-platform-3/object/batch_query?projectId=${this.$store.state.projId}&secret=`, params).then(res => {
         let data = res.data
         if (data.Result == 'success') {
           this.Info = data.Content[0]
+          console.log(this.Info)
           if (this.Info.infos.Pic) {
             this.draw(this.Info.infos.Pic[0].key)
           }
@@ -378,7 +394,7 @@ export default {
         criteria: {
           graphType: 'EquipinSpace',
           relType: '1',
-          toId: this.objctId, // 空间id
+          toId: this.objectId, // 空间id
           side: 'fromId'
         }
       }
@@ -412,7 +428,7 @@ export default {
     // 服务于空间设备未恢复的报警条数
     equipInSpace () {
       let params = {
-        spaceId: this.objctId // 空间id
+        spaceId: this.objectId // 空间id
       }
       axios.post(`/alarm-system/alarm-system/alarm/equipInSpace/query?projectId=${this.$store.state.projId}&secret=`, params).then(res => {
         let data = res.data
@@ -441,7 +457,7 @@ export default {
     //
     equipForSpace () {
       let params = {
-        spaceId: this.objctId // 空间id
+        spaceId: this.objectId // 空间id
       }
       axios.post(`/alarm-system/alarm-system/alarm/equipForSpace/query?projectId=${this.$store.state.projId}&secret=`, params).then(res => {
         let data = res.data