diff --git a/src/views/map/index.vue b/src/views/map/index.vue index ef19b57..cdfd52f 100644 --- a/src/views/map/index.vue +++ b/src/views/map/index.vue @@ -217,6 +217,18 @@ + +
+ + + + 搜索 + 重置 +
+
@@ -1175,7 +1187,9 @@ export default { linkPort: '8093', VIIDPort: '8088' }, - trajectoryEntityCollection: {} + trajectoryEntityCollection: {}, + isPeopleTrajectory:false, + peopleTrajectoryValue:'' } }, mounted() { @@ -1474,35 +1488,36 @@ export default { // var cartesian = this.getCatesian3FromPX(movement.position) }, Cesium.ScreenSpaceEventType.LEFT_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) { event.preventDefault() }) - this.handler.setInputAction(movement => { - const pick = viewer.scene.pick(movement.position) - if (Cesium.defined(pick) && (pick.id.id)) { - if (!pick.id._monitoItems) { - this.removeTrajectory() - return - } - const point_type = pick.id._monitoItems.data.point_type - const point_id = pick.id._monitoItems.data.id - const corpInfoId = pick.id._monitoItems.data.corpInfoId - if (point_type === '标记点peoplePositionOne') { - this.removeTrajectory() - this.addTrajectory(point_id, corpInfoId) - } - } else { - this.removeTrajectory() - } - }, Cesium.ScreenSpaceEventType.RIGHT_CLICK) + // this.handler.setInputAction(movement => { + // const pick = viewer.scene.pick(movement.position) + // if (Cesium.defined(pick) && (pick.id.id)) { + // if (!pick.id._monitoItems) { + // this.removeTrajectory() + // return + // } + // const point_type = pick.id._monitoItems.data.point_type + // const point_id = pick.id._monitoItems.data.id + // const corpInfoId = pick.id._monitoItems.data.corpInfoId + // if (point_type === '标记点peoplePositionOne') { + // this.removeTrajectory() + // this.addTrajectory(point_id, corpInfoId) + // } + // } else { + // this.removeTrajectory() + // } + // }, Cesium.ScreenSpaceEventType.RIGHT_CLICK) }, - addTrajectory(point_id, corpInfoId) { + addTrajectory() { + this.removeTrajectory() requestFN( '/map/getPersonTrace', { - id: point_id, - corpId: corpInfoId + id: this.peopleTrajectoryValue, + corpId: this.CORP_INFO_ID } ).then((data) => { if (data.list) { @@ -1964,6 +1979,7 @@ export default { this.bottomOptionsList[i].list[j].check = false } } + this.isPeopleTrajectory = false } }, clearAllBottomOptionsItemsEntityCollection() { @@ -2078,10 +2094,22 @@ export default { } this.carLocArr = [] } + if(urlType === 'peopleTrajectory'){ + this.isPeopleTrajectory = false + } if (this.gangkouActive === '00003' && this.CORP_INFO_ID === '035958e685cf4850bc40151c5e0617a6' && urlType === 'peoplePosition') { this.doUnSubscribe() this.clearMqttPoint('+/UwbBQ/') 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') { this.clearRYDWPoint('+/UwbBQ/') @@ -2099,6 +2127,23 @@ export default { } }) } 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 if (this.gangkouActive === '00004') { @@ -3614,9 +3659,51 @@ export default { 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; + } + } diff --git a/src/views/map/js/ry_dragentity.js b/src/views/map/js/ry_dragentity.js index f63fb12..3a65fbb 100644 --- a/src/views/map/js/ry_dragentity.js +++ b/src/views/map/js/ry_dragentity.js @@ -30,6 +30,16 @@ export default class DragEntity { heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, 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), monitoItems: {