From 7e847adc4ff3bfbe850faeb1a951ae037670d28a Mon Sep 17 00:00:00 2001 From: "1261008090@qq.com" Date: Thu, 27 Jun 2024 14:36:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=EF=BC=9A=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D/=E5=8E=86=E5=8F=B2=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=EF=BC=8C=E4=BA=BA=E5=91=98=E5=AE=9A=E4=BD=8D=E6=A0=87=E7=82=B9?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0label?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/map/index.vue | 133 ++++++++++++++++++++++++------ src/views/map/js/ry_dragentity.js | 10 +++ 2 files changed, 120 insertions(+), 23 deletions(-) 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: {