Procházet zdrojové kódy

项目密码的改变

zhulizhen před 6 roky
rodič
revize
ecdf0937fa

+ 15 - 4
src/views/asset/index.vue

@@ -192,15 +192,26 @@ export default {
   },
 
   mounted () {
-    this.getAssetData()
+    this.getEqNameAndId()
+    this.getAssetData(this.objectId)
   },
   watch: {
 
   },
 
   methods: {
+     getEqNameAndId () {
+      let hostUrl = location.search
+      this.objectId = hostUrl.split("&")[0].toString().split("=")[1]
+      let pid = hostUrl.split("&")[1].toString().split("=")[1]
+      let secret =  hostUrl.split("&")[2].toString().split("=")[1]
+      console.log(pid, this.$store.state.projId)
+      this.$store.commit('setProId', pid)
+      this.$store.commit(`setSecret`, secret)
+      this.getAssetData(this.objectId)
+    },
     // 摄像头
-    getMoniCount () {
+    getMoniCount (objectId) {
       let params = {
         id: this.linkEq
       }
@@ -221,10 +232,10 @@ export default {
       }
     },
     // 获取去资产信息
-    getAssetData () {
+    getAssetData (objectId) {
       let params = {
         criterias: [
-          {id: this.objectId}
+          {id: objectId}
         ],
         'historyInfos': true
       }

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

@@ -229,9 +229,11 @@ export default {
       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)
+      let secret =  hostUrl.split("&")[2].toString().split("=")[1]
+      console.log(pid, this.$store.state.projId,secret)
       this.$store.commit('setProId', pid)
-      this.$store.commit(`setSecret`, '')
+      this.$store.commit(`setSecret`, secret)
+       console.log( this.$store.state.secret)
       this.initData(this.objectId)
       this.searchBuildingName(this.objectId)
       this.getCurrentData(this.objectId)

+ 39 - 22
src/views/system/index.vue

@@ -102,26 +102,43 @@ export default {
   },
 
   mounted () {
-    this.getSystem()
-    this.initData()
-    this.noRecoverAlarm()
-    this.getCurrentData()
-    this.searchBuildingName()
-    this.underwayOrder()
-    this.getMoniCount()
+    this.getEqNameAndId()
+    this.getSystem(this.objectId)
+    this.initData(this.objectId)
+    this.noRecoverAlarm(this.objectId)
+    this.getCurrentData(this.objectId)
+    this.searchBuildingName(this.objectId)
+    this.underwayOrder(this.objectId)
+    this.getMoniCount(this.objectId)
   },
 
   methods: {
+    getEqNameAndId () {
+      let hostUrl = location.search
+      this.objectId = hostUrl.split("&")[0].toString().split("=")[1]
+      let pid = hostUrl.split("&")[1].toString().split("=")[1]
+      let secret =  hostUrl.split("&")[2].toString().split("=")[1]
+      this.$store.commit('setProId', pid)
+      this.$store.commit(`setSecret`, secret)
+      console.log(pid, this.$store.state.projId,this.$store.state.secret)
+      this.getSystem(this.objectId)
+      this.initData(this.objectId)
+      this.noRecoverAlarm(this.objectId)
+      this.getCurrentData(this.objectId)
+      this.searchBuildingName(this.objectId)
+      this.underwayOrder(this.objectId)
+      this.getMoniCount(this.objectId)
+    },
     // 右侧耗电功率和累计用电量的统计
-    getCurrentData () {
+    getCurrentData (objectId) {
       let params = {
         criterias: [
           {
-            id: this.objectId,
+            id: objectId,
             code: "ElecConsumP"
           },
           {
-            id: this.objectId,
+            id: objectId,
             code: "AccElecConsum"
           }
         ]
@@ -142,10 +159,10 @@ export default {
       })
     },
     // 未恢复的报警条数
-    noRecoverAlarm () {
+    noRecoverAlarm (objectId) {
       let params = {
         criteria: {
-          objectId: this.objectId,
+          objectId: objectId,
           status: 'alalrm'
         }
       }
@@ -157,10 +174,10 @@ export default {
       })
     },
     // 右侧进行中的工单
-    underwayOrder () {
+    underwayOrder (objectId) {
       let params = {
         order_state: "5",
-        system_ids: [this.objectId],
+        system_ids: [objectId],
         user_id: "systemId",
         project_id: this.$store.state.projId,
         start_time: "20180101000000",
@@ -172,9 +189,9 @@ export default {
       })
     },
     // 摄像头
-    getMoniCount () {
+    getMoniCount (objectId) {
       let params = {
-        id: this.objectId
+        id: objectId
       }
       axios.post(`/api/front-api/monitor/list?projectId=${this.$store.state.projId}&secret=${this.$store.state.secret}`, params).then(res => {
         let data = res.data
@@ -184,10 +201,10 @@ export default {
       })
     },
     // 获取数据信息
-    initData () {
+    initData (objectId) {
       let params = {
         criterias: [
-          {id: this.objectId}
+          {id: objectId}
         ]
       }
       axios.post(`/data-platform-3/data-platform-3/object/batch_query?projectId=${this.$store.state.projId}&secret=${this.$store.state.secret}`, params).then(res => {
@@ -224,12 +241,12 @@ export default {
     },
 
     // 建筑的名称查询
-    searchBuildingName () {
+    searchBuildingName (objectId) {
       let params = {
         keywords: [],
         category: ['SyObj'],
         limit: 1,
-        ids: [this.objectId]
+        ids: [objectId]
       }
       axios.post(`/data-platform-3/data-platform-3/object/search?projectId=${this.$store.state.projId}&secret=${this.$store.state.secret}`, params).then(res => {
         let data = res.data
@@ -242,12 +259,12 @@ export default {
         }
       })
     },
-    getSystem () {
+    getSystem (objectId) {
       let params = {
         criteria: {
           graphType: 'SystemEquip',
           relType: '1',
-          fromId: this.objectId, // 空间id
+          fromId: objectId, // 空间id
           side: 'toId'
         }
       }

+ 2 - 1
src/views/vr/index.vue

@@ -206,9 +206,10 @@ export default {
       let hostUrl = location.search
       this.objectId = hostUrl.split("&")[0].toString().split("=")[1]
       let pid = hostUrl.split("&")[1].toString().split("=")[1]
+      let secret =  hostUrl.split("&")[2].toString().split("=")[1]
       console.log(pid, this.$store.state.projId)
       this.$store.commit('setProId', pid)
-      this.$store.commit(`setSecret`, '')
+      this.$store.commit(`setSecret`, secret)
       this.initData(this.objectId)
       this.searchBuildingName(this.objectId)
       this.noRecoverAlarm(this.objectId)