优化人员定位标记点
parent
d140f7b27b
commit
c85d5a5466
|
@ -93,11 +93,11 @@
|
|||
:corp-info-id="CORP_INFO_ID"
|
||||
:area="area"
|
||||
:gangkou="gangkouActive"/>
|
||||
<renyuan
|
||||
v-if="gangkouActive && gangkouActive !== '00004' && gangkouActive !== '00002' && gangkouActive !== '00005' && bottomOptionsIndex === 4"
|
||||
:corp-info-id="CORP_INFO_ID"
|
||||
:area="area"
|
||||
:gangkou="gangkouActive"/>
|
||||
<!-- <renyuan-->
|
||||
<!-- v-if="gangkouActive && gangkouActive !== '00004' && gangkouActive !== '00002' && gangkouActive !== '00005' && bottomOptionsIndex === 4"-->
|
||||
<!-- :corp-info-id="CORP_INFO_ID"-->
|
||||
<!-- :area="area"-->
|
||||
<!-- :gangkou="gangkouActive"/>-->
|
||||
<renyuan-cfd
|
||||
v-if="gangkouActive && gangkouActive === '00004' && bottomOptionsIndex === 1"
|
||||
:corp-info-id="CORP_INFO_ID"
|
||||
|
@ -226,8 +226,8 @@
|
|||
leave-active-class="animate__animated animate__fadeOutUp"
|
||||
>
|
||||
<div v-if="isPeopleTrajectory" class="people_trajectory">
|
||||
<el-select v-model="peopleTrajectoryValue" popper-class="people_trajectory_select">
|
||||
<el-option v-for="item in onePerLocArr" :key="item.id" :value="item.id" :label="item.id"/>
|
||||
<el-select v-model="peopleTrajectoryValue" popper-class="people_trajectory_select" filterable>
|
||||
<el-option v-for="item in onePerLocArr" :key="item.id" :value="item.id" :label="item.name || item.id"/>
|
||||
</el-select>
|
||||
<el-button class="search_btn" @click="addTrajectory">搜索</el-button>
|
||||
<el-button class="reset_btn" @click="()=>{removeTrajectory();peopleTrajectoryValue = ''}">重置</el-button>
|
||||
|
@ -326,6 +326,8 @@ var PI = 3.1415926535897932384626
|
|||
var a = 6378245.0 // 卫星椭球坐标投影到平面地图坐标系的投影因子。
|
||||
var ee = 0.00669342162296594323 // 椭球的偏心率。//判断是否在国内,在中国国内的经纬度才需要做偏移
|
||||
const iframeObj = null
|
||||
const mqttPoint = {}
|
||||
let trajectoryEntityCollection = {}
|
||||
export default {
|
||||
components: {
|
||||
AnquanCfd,
|
||||
|
@ -478,7 +480,7 @@ export default {
|
|||
],
|
||||
myEntityCollection: {},
|
||||
poinEntity: {},
|
||||
mqttPoint: {},
|
||||
// mqttPoint: {},
|
||||
allOrientationPoint: [],
|
||||
gangkouActive: '',
|
||||
centerOptionsList: [
|
||||
|
@ -1247,7 +1249,7 @@ export default {
|
|||
linkPort: '8093',
|
||||
VIIDPort: '8088'
|
||||
},
|
||||
trajectoryEntityCollection: {},
|
||||
// trajectoryEntityCollection: {},
|
||||
isPeopleTrajectory: false,
|
||||
peopleTrajectoryValue: ''
|
||||
}
|
||||
|
@ -1595,14 +1597,14 @@ export default {
|
|||
const collection = new Cesium.CustomDataSource('trajectoryEntityCollection')
|
||||
collection.entities.add(entity)
|
||||
viewer.dataSources.add(collection)
|
||||
this.trajectoryEntityCollection = collection
|
||||
trajectoryEntityCollection = collection
|
||||
}
|
||||
})
|
||||
},
|
||||
removeTrajectory() {
|
||||
if (Object.keys(this.trajectoryEntityCollection).length === 0) return
|
||||
viewer.dataSources.remove(this.trajectoryEntityCollection)
|
||||
this.trajectoryEntityCollection = {}
|
||||
if (Object.keys(trajectoryEntityCollection).length === 0) return
|
||||
viewer.dataSources.remove(trajectoryEntityCollection)
|
||||
trajectoryEntityCollection = {}
|
||||
},
|
||||
|
||||
getCatesian3FromPX: function(px) {
|
||||
|
@ -2361,7 +2363,7 @@ export default {
|
|||
} else {
|
||||
ry_drag.addEntity(this.perLocArr[i])
|
||||
|
||||
this.mqttPoint['cfdrydw' + this.perLocArr[i].cardNo] = this.perLocArr[i].cardNo
|
||||
mqttPoint['cfdrydw' + this.perLocArr[i].cardNo] = this.perLocArr[i].cardNo
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -2715,7 +2717,7 @@ export default {
|
|||
czksPerLoc.push(perLoc)
|
||||
ry_drag.addEntity(perLoc)
|
||||
var qianzhui = 'czksperson'
|
||||
_this.mqttPoint[qianzhui + item.cardId] = item.cardId
|
||||
mqttPoint[qianzhui + item.cardId] = item.cardId
|
||||
}
|
||||
}
|
||||
// 最后更新ninePerLocArr
|
||||
|
@ -2788,7 +2790,7 @@ export default {
|
|||
}
|
||||
this.onePerLocArr.push(perLoc)
|
||||
ry_drag.addEntity(perLoc)
|
||||
this.mqttPoint[this.subscription.topic.substring(0, this.subscription.topic.lastIndexOf('+')) + item.deviceCode] = item.deviceCode
|
||||
mqttPoint[this.subscription.topic.substring(0, this.subscription.topic.lastIndexOf('+')) + item.deviceCode] = item.deviceCode
|
||||
}
|
||||
}
|
||||
} else if (topic.indexOf('alarm') !== -1) {
|
||||
|
@ -2803,20 +2805,20 @@ export default {
|
|||
})
|
||||
},
|
||||
clearMqttPoint(prefix) {
|
||||
for (const mqttPointKey in this.mqttPoint) {
|
||||
const key = prefix ? prefix + this.mqttPoint[mqttPointKey] : mqttPointKey
|
||||
viewer.entities.removeById(this.mqttPoint[key])
|
||||
this.onePerLocArr = this.onePerLocArr.filter(item => item.data_id !== this.mqttPoint[key])
|
||||
delete this.mqttPoint[key]
|
||||
for (const mqttPointKey in mqttPoint) {
|
||||
const key = prefix ? prefix + mqttPoint[mqttPointKey] : mqttPointKey
|
||||
viewer.entities.removeById(mqttPoint[key])
|
||||
this.onePerLocArr = this.onePerLocArr.filter(item => item.data_id !== mqttPoint[key])
|
||||
delete mqttPoint[key]
|
||||
}
|
||||
},
|
||||
clearRYDWPoint(prefix) {
|
||||
this.fwebsocket.close()
|
||||
for (const mqttPointKey in this.mqttPoint) {
|
||||
const key = prefix ? prefix + this.mqttPoint[mqttPointKey] : mqttPointKey
|
||||
viewer.entities.removeById(this.mqttPoint[key])
|
||||
this.onePerLocArr = this.onePerLocArr.filter(item => item.data_id !== this.mqttPoint[key])
|
||||
delete this.mqttPoint[key]
|
||||
for (const mqttPointKey in mqttPoint) {
|
||||
const key = prefix ? prefix + mqttPoint[mqttPointKey] : mqttPointKey
|
||||
viewer.entities.removeById(mqttPoint[key])
|
||||
this.onePerLocArr = this.onePerLocArr.filter(item => item.data_id !== mqttPoint[key])
|
||||
delete mqttPoint[key]
|
||||
}
|
||||
},
|
||||
// 删除人员定位点
|
||||
|
@ -2999,8 +3001,9 @@ export default {
|
|||
_this.fwebsocket = new WebSocket(encodeURI(wsUrl))
|
||||
_this.fwebsocket.onmessage = function(message) {
|
||||
console.info('接收消息')
|
||||
const peopleList = JSON.parse(message.data).data.data
|
||||
const peopleList = JSON.parse(message.data)
|
||||
console.log(peopleList)
|
||||
viewer.entities.suspendEvents()
|
||||
for (let i = 0; i < peopleList.length; i++) {
|
||||
const item = peopleList[i]
|
||||
if ((!item)) continue
|
||||
|
@ -3019,6 +3022,7 @@ export default {
|
|||
} else {
|
||||
const perLoc = {
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
x: x,
|
||||
y: y,
|
||||
icon_type: 'img4_0' + pointColor,
|
||||
|
@ -3029,9 +3033,10 @@ export default {
|
|||
}
|
||||
_this.onePerLocArr.push(perLoc)
|
||||
ry_drag.addEntity(perLoc)
|
||||
_this.mqttPoint[_this.subscription.topic.substring(0, _this.subscription.topic.lastIndexOf('+')) + item.id] = item.id
|
||||
mqttPoint[_this.subscription.topic.substring(0, _this.subscription.topic.lastIndexOf('+')) + item.id] = item.id
|
||||
}
|
||||
}
|
||||
viewer.entities.resumeEvents()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue