地图:人员定位/历史轨迹,人员定位标点增加label

liujun-2024-06-13-一公司人员定位新需求^2
1261008090@qq.com 2024-06-27 14:36:31 +08:00
parent f42d56a7c0
commit 7e847adc4f
2 changed files with 120 additions and 23 deletions

View File

@ -217,6 +217,18 @@
</template> </template>
</template> </template>
</template> </template>
<transition
enter-active-class="animate__animated animate__fadeInDown"
leave-active-class="animate__animated animate__fadeOutUp"
>
<div class="people_trajectory" v-if="isPeopleTrajectory">
<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>
<el-button class="search_btn" @click="addTrajectory"></el-button>
<el-button class="reset_btn" @click="()=>{removeTrajectory();peopleTrajectoryValue = ''}">重置</el-button>
</div>
</transition>
</div> </div>
</transition> </transition>
<div class="right_options"> <div class="right_options">
@ -1175,7 +1187,9 @@ export default {
linkPort: '8093', linkPort: '8093',
VIIDPort: '8088' VIIDPort: '8088'
}, },
trajectoryEntityCollection: {} trajectoryEntityCollection: {},
isPeopleTrajectory:false,
peopleTrajectoryValue:''
} }
}, },
mounted() { mounted() {
@ -1474,35 +1488,36 @@ export default {
// var cartesian = this.getCatesian3FromPX(movement.position) // var cartesian = this.getCatesian3FromPX(movement.position)
}, Cesium.ScreenSpaceEventType.LEFT_CLICK) }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_DOUBLE_CLICK) viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_DOUBLE_CLICK)
viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK) // viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK)
document.addEventListener('contextmenu', function(event) { document.addEventListener('contextmenu', function(event) {
event.preventDefault() event.preventDefault()
}) })
this.handler.setInputAction(movement => { // this.handler.setInputAction(movement => {
const pick = viewer.scene.pick(movement.position) // const pick = viewer.scene.pick(movement.position)
if (Cesium.defined(pick) && (pick.id.id)) { // if (Cesium.defined(pick) && (pick.id.id)) {
if (!pick.id._monitoItems) { // if (!pick.id._monitoItems) {
this.removeTrajectory() // this.removeTrajectory()
return // return
} // }
const point_type = pick.id._monitoItems.data.point_type // const point_type = pick.id._monitoItems.data.point_type
const point_id = pick.id._monitoItems.data.id // const point_id = pick.id._monitoItems.data.id
const corpInfoId = pick.id._monitoItems.data.corpInfoId // const corpInfoId = pick.id._monitoItems.data.corpInfoId
if (point_type === '标记点peoplePositionOne') { // if (point_type === 'peoplePositionOne') {
this.removeTrajectory() // this.removeTrajectory()
this.addTrajectory(point_id, corpInfoId) // this.addTrajectory(point_id, corpInfoId)
} // }
} else { // } else {
this.removeTrajectory() // this.removeTrajectory()
} // }
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK) // }, Cesium.ScreenSpaceEventType.RIGHT_CLICK)
}, },
addTrajectory(point_id, corpInfoId) { addTrajectory() {
this.removeTrajectory()
requestFN( requestFN(
'/map/getPersonTrace', '/map/getPersonTrace',
{ {
id: point_id, id: this.peopleTrajectoryValue,
corpId: corpInfoId corpId: this.CORP_INFO_ID
} }
).then((data) => { ).then((data) => {
if (data.list) { if (data.list) {
@ -1964,6 +1979,7 @@ export default {
this.bottomOptionsList[i].list[j].check = false this.bottomOptionsList[i].list[j].check = false
} }
} }
this.isPeopleTrajectory = false
} }
}, },
clearAllBottomOptionsItemsEntityCollection() { clearAllBottomOptionsItemsEntityCollection() {
@ -2078,10 +2094,22 @@ export default {
} }
this.carLocArr = [] this.carLocArr = []
} }
if(urlType === 'peopleTrajectory'){
this.isPeopleTrajectory = false
}
if (this.gangkouActive === '00003' && this.CORP_INFO_ID === '035958e685cf4850bc40151c5e0617a6' && urlType === 'peoplePosition') { if (this.gangkouActive === '00003' && this.CORP_INFO_ID === '035958e685cf4850bc40151c5e0617a6' && urlType === 'peoplePosition') {
this.doUnSubscribe() this.doUnSubscribe()
this.clearMqttPoint('+/UwbBQ/') this.clearMqttPoint('+/UwbBQ/')
this.removeTrajectory() this.removeTrajectory()
for (let i = 0; i < this.bottomOptionsList[pindex].list.length; i++) {
if(this.bottomOptionsList[pindex].list[i].type === 'peopleTrajectory'){
if(this.bottomOptionsList[pindex].list[i].check){
this.bottomOptionsList[pindex].list[i].check = false
this.isPeopleTrajectory = false
break
}
}
}
} }
if (this.gangkouActive === '00003' && this.CORP_INFO_ID === '21590a00ea5e462e9ee44dd332dddc26' && urlType === 'peoplePosition') { if (this.gangkouActive === '00003' && this.CORP_INFO_ID === '21590a00ea5e462e9ee44dd332dddc26' && urlType === 'peoplePosition') {
this.clearRYDWPoint('+/UwbBQ/') this.clearRYDWPoint('+/UwbBQ/')
@ -2099,6 +2127,23 @@ export default {
} }
}) })
} else { } else {
if(urlType === 'peopleTrajectory'){
let flag = false
for (let i = 0; i < this.bottomOptionsList[pindex].list.length; i++) {
if(this.bottomOptionsList[pindex].list[i].type === 'peoplePosition'){
if(!this.bottomOptionsList[pindex].list[i].check){
flag = true
break
}
}
}
if(flag){
this.$message.warning('请先选择人员定位!!!')
return
}else{
this.isPeopleTrajectory = true
}
}
// //
this.bottomOptionsList[pindex].list[index].check = true this.bottomOptionsList[pindex].list[index].check = true
if (this.gangkouActive === '00004') { if (this.gangkouActive === '00004') {
@ -3614,9 +3659,51 @@ export default {
transform: translateY(0); transform: translateY(0);
} }
} }
.people_trajectory{
position: absolute;
top: -60px;
left: 0;
width: 400px;
padding: 10px;
background-image: linear-gradient(to right, rgb(31 62 129 / 57%) 0%, rgb(17 93 255 / 40%) 50%, rgb(31 62 129 / 57%) 100%);
.search_btn{
background-color: #1563e3;
color: #fff;
border-color: #1563e3;
}
.reset_btn{
background-color: #558be5;
color: #fff;
border-color: #558be5;
}
}
</style> </style>
<style> <style>
.cesium-viewer-toolbar, .cesium-viewer-fullscreenContainer, .cesium-infoBox-visible { .cesium-viewer-toolbar, .cesium-viewer-fullscreenContainer, .cesium-infoBox-visible {
display: none !important; display: none !important;
}
.people_trajectory .el-input__inner{
background-color: #100693 !important;
border-color: #100693 !important;
color: #fff !important;
}
.people_trajectory_select{
background-color: #100693 !important;
border-color: #100693 !important;
}
.people_trajectory_select .el-select-dropdown__item, .el-select-dropdown__item{
color: #fff !important;
}
.people_trajectory_select .el-select-dropdown__item.hover, .el-select-dropdown__item:hover{
background-color: #2111ec !important;
color: #fff !important;
}
.people_trajectory_select .popper__arrow{
border-top-color: #100693 !important;
border-bottom-color: #100693 !important;
}
.people_trajectory_select .popper__arrow::after{
border-top-color: #100693 !important;
border-bottom-color: #100693 !important;
} }
</style> </style>

View File

@ -30,6 +30,16 @@ export default class DragEntity {
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
disableDepthTestDistance: Number.POSITIVE_INFINITY disableDepthTestDistance: Number.POSITIVE_INFINITY
}, },
label: {
text: point.id,
font: '13px sans-serif',
pixelOffset: new Cesium.Cartesian2(0, -55),
showBackground: true,
// eslint-disable-next-line new-cap
backgroundColor: new Cesium.Color.fromCssColorString('rgba(20, 58, 142, 1)'),
backgroundPadding: new Cesium.Cartesian2(7, 5),
disableDepthTestDistance: Number.POSITIVE_INFINITY
},
orientation: new Cesium.VelocityOrientationProperty(point.property), orientation: new Cesium.VelocityOrientationProperty(point.property),
monitoItems: { monitoItems: {