|
@@ -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'
|
|
|
}
|
|
|
}
|