Compare commits
2 Commits
fdeff5bf9a
...
5137554171
| Author | SHA1 | Date |
|---|---|---|
|
|
5137554171 | |
|
|
98b1464b76 |
14
.env.dev
14
.env.dev
|
|
@ -18,15 +18,19 @@ VUE_APP_OIDC_SILENTREDIRECTURI = http://112.233.241.108:1803/silent-renew-oidc.h
|
|||
#VUE_APP_BASE_IMG_URL =http://223.99.16.253:9001
|
||||
|
||||
|
||||
#VUE_APP_BASE_API = http://123.132.248.154:9231/api
|
||||
#VUE_APP_BASE_IMG_URL = http://123.132.248.154:9231
|
||||
#VUE_APP_WEBSOCKET_URL = ws://123.132.248.154:9225/ws
|
||||
|
||||
# 1240服务器http接口
|
||||
VUE_APP_BASE_API = http://123.132.248.154:9231/api
|
||||
VUE_APP_BASE_IMG_URL = http://123.132.248.154:9231
|
||||
VUE_APP_WEBSOCKET_URL = ws://123.132.248.154:9225/ws
|
||||
|
||||
|
||||
|
||||
#VUE_APP_BASE_API = https://fx.hopetrytech.com:7001/api
|
||||
#VUE_APP_BASE_IMG_URL = https://fx.hopetrytech.com:7001
|
||||
#VUE_APP_WEBSOCKET_URL = ws://221.2.83.254:9002/ws
|
||||
# 费县服务器https接口
|
||||
VUE_APP_BASE_API = https://fx.hopetrytech.com:7001/api
|
||||
VUE_APP_BASE_IMG_URL = https://fx.hopetrytech.com:7001
|
||||
VUE_APP_WEBSOCKET_URL = wss://fx.hopetrytech.com:7002/ws
|
||||
|
||||
#VUE_APP_BASE_API = http://123.132.248.154:9224/api
|
||||
#VUE_APP_BASE_IMG_URL = http://123.132.248.154:9224
|
||||
|
|
|
|||
|
|
@ -15,9 +15,15 @@ VUE_APP_OIDC_SILENTREDIRECTURI = http://demo.openauth.me:1803/silent-renew-oidc.
|
|||
#VUE_APP_BASE_API = http://123.132.248.154:9224/api
|
||||
#VUE_APP_BASE_IMG_URL = http://123.132.248.154:9224
|
||||
|
||||
# 1240服务器http接口
|
||||
VUE_APP_BASE_API = http://123.132.248.154:9231/api
|
||||
VUE_APP_BASE_IMG_URL = http://123.132.248.154:9231
|
||||
VUE_APP_WEBSOCKET_URL = ws://123.132.248.154:9225/ws
|
||||
|
||||
# 费县服务器https接口
|
||||
#VUE_APP_BASE_API = https://fx.hopetrytech.com:7001/api
|
||||
#VUE_APP_BASE_IMG_URL = https://fx.hopetrytech.com:7001
|
||||
#VUE_APP_WEBSOCKET_URL = wss://fx.hopetrytech.com:7002/ws
|
||||
|
||||
#VUE_APP_BASE_API = http://221.2.83.254:7001/api
|
||||
#VUE_APP_BASE_IMG_URL = http://221.2.83.254:7001
|
||||
|
|
@ -94,7 +94,6 @@ export default {
|
|||
}, 5000);
|
||||
},
|
||||
async setOnmessageMessage(event) {
|
||||
console.log(event.data, "获得消息");
|
||||
this.reset();
|
||||
// 自定义全局监听事件
|
||||
window.dispatchEvent(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,15 @@
|
|||
const currentUsers = []
|
||||
|
||||
let currentUsers = []
|
||||
|
||||
/*
|
||||
{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.641188",
|
||||
"lat": "35.5059383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db2",
|
||||
"name": "汪键波",
|
||||
"phone": "18263982658"
|
||||
}
|
||||
*/
|
||||
export function handlerData(newUsers){
|
||||
// 判断是否是第一次传入
|
||||
if(currentUsers.length == 0){
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ export default {
|
|||
startPoint:null,
|
||||
endPoint:null,
|
||||
pathPointGraphicLayer:null,
|
||||
currentUsers:[],
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
|
|
@ -63,15 +64,15 @@ export default {
|
|||
},
|
||||
created(){
|
||||
this.getOnLineInfo()
|
||||
this.initWebSocket()
|
||||
// this.initWebSocket()
|
||||
window.addEventListener("onmessageWS", this.getSocketData);
|
||||
setInterval(()=>{
|
||||
this.pointData = []
|
||||
let arr = ['人员信息','对讲机信息']
|
||||
arr.forEach(item =>{
|
||||
this.getPointer(item)
|
||||
})
|
||||
},120000)
|
||||
// setInterval(()=>{
|
||||
// this.pointData = []
|
||||
// let arr = ['人员信息','对讲机信息']
|
||||
// arr.forEach(item =>{
|
||||
// this.getPointer(item)
|
||||
// })
|
||||
// },120000)
|
||||
},
|
||||
mounted(){
|
||||
window.videoCall = this.videoCall
|
||||
|
|
@ -79,8 +80,8 @@ export default {
|
|||
window.deleteRoute = this.deleteRoute;
|
||||
|
||||
let _this = this;
|
||||
|
||||
_this.getPointer();
|
||||
// this.TestSport();
|
||||
// _this.getPointer();
|
||||
|
||||
setInterval(function(){
|
||||
_this.pointData = []
|
||||
|
|
@ -97,7 +98,7 @@ export default {
|
|||
if(obj.Module){
|
||||
_this.pointData = []
|
||||
if(obj.Module == '人员信息' || obj.Module == '对讲机信息'){
|
||||
//_this.getPointer(obj.Module)
|
||||
_this.getPointer(obj.Module)
|
||||
}
|
||||
if(obj.Module == '上线' || obj.Module == '下线'){
|
||||
_this.getOnLineInfo()
|
||||
|
|
@ -152,23 +153,312 @@ export default {
|
|||
this.listDataInfo = res.data
|
||||
})
|
||||
},
|
||||
TestSport(){
|
||||
let testData = [
|
||||
[
|
||||
{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.641188",
|
||||
"lat": "35.5059383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db2",
|
||||
"name": "汪键波",
|
||||
"phone": "18263982658"
|
||||
}
|
||||
],[
|
||||
{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.651188",
|
||||
"lat": "35.5159383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db2",
|
||||
"name": "汪键波",
|
||||
"phone": "18263982658"
|
||||
}
|
||||
],[
|
||||
{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.661188",
|
||||
"lat": "35.5259383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db2",
|
||||
"name": "汪键波",
|
||||
"phone": "18263982658"
|
||||
}
|
||||
],[
|
||||
{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.671188",
|
||||
"lat": "35.5359383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db2",
|
||||
"name": "汪键波",
|
||||
"phone": "18263982658"
|
||||
}
|
||||
],[
|
||||
{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.681188",
|
||||
"lat": "35.5459383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db2",
|
||||
"name": "汪键波",
|
||||
"phone": "18263982658"
|
||||
},
|
||||
{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.641188",
|
||||
"lat": "35.5059383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db3",
|
||||
"name": "徐景亮",
|
||||
"phone": "18263982658"
|
||||
}
|
||||
],[
|
||||
{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.691188",
|
||||
"lat": "35.5359383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db2",
|
||||
"name": "汪键波",
|
||||
"phone": "18263982658"
|
||||
},
|
||||
{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.631188",
|
||||
"lat": "35.4959383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db3",
|
||||
"name": "徐景亮",
|
||||
"phone": "18263982658"
|
||||
},{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.621188",
|
||||
"lat": "35.5059383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db4",
|
||||
"name": "徐景良",
|
||||
"phone": "18263982658"
|
||||
}
|
||||
],[
|
||||
{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.621188",
|
||||
"lat": "35.4859383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db3",
|
||||
"name": "徐景亮",
|
||||
"phone": "18263982658"
|
||||
},{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.611188",
|
||||
"lat": "35.5059383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db4",
|
||||
"name": "徐景良",
|
||||
"phone": "18263982658"
|
||||
}
|
||||
],[
|
||||
{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.611188",
|
||||
"lat": "35.4759383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db3",
|
||||
"name": "徐景亮",
|
||||
"phone": "18263982658"
|
||||
},{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.601188",
|
||||
"lat": "35.5059383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db4",
|
||||
"name": "徐景良",
|
||||
"phone": "18263982658"
|
||||
}
|
||||
],[
|
||||
{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.621188",
|
||||
"lat": "35.4859383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db3",
|
||||
"name": "徐景亮",
|
||||
"phone": "18263982658"
|
||||
},{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.601188",
|
||||
"lat": "35.5259383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db4",
|
||||
"name": "徐景良",
|
||||
"phone": "18263982658"
|
||||
},{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.631188",
|
||||
"lat": "35.4959383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db2",
|
||||
"name": "汪键波",
|
||||
"phone": "18263982658"
|
||||
}
|
||||
],[
|
||||
{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.621188",
|
||||
"lat": "35.4759383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db3",
|
||||
"name": "徐景亮",
|
||||
"phone": "18263982658"
|
||||
},{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.611188",
|
||||
"lat": "35.5359383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db4",
|
||||
"name": "徐景良",
|
||||
"phone": "18263982658"
|
||||
},{
|
||||
"createTime": "2023-09-27 14:15:06",
|
||||
"lng": "117.621188",
|
||||
"lat": "35.4859383",
|
||||
"createId": "a33cdcc8-24aa-4d72-92bb-2399ec831db2",
|
||||
"name": "汪键波",
|
||||
"phone": "18263982658"
|
||||
}
|
||||
],[],[],[],[]
|
||||
]
|
||||
let i=0;
|
||||
let _this = this;
|
||||
setInterval(function(){
|
||||
i++;
|
||||
_this.currentUsers = testData[i];
|
||||
_this.updateLayerPoint();
|
||||
},5000)
|
||||
},
|
||||
getPointer(type){
|
||||
getMethodCommon("/FireManagement/GetPointByType",{type:type}).then(res =>{
|
||||
res.data.forEach(item =>{
|
||||
this.pointData.push(item)
|
||||
})
|
||||
// let currentUsers = handlerData(this.pointData);
|
||||
|
||||
// console.log("currentUsers",currentUsers);
|
||||
this.addLayerPoint()
|
||||
console.log('this.markGraphicLayerArr',this.markGraphicLayerArr)
|
||||
this.currentUsers = this.pointData;
|
||||
this.updateLayerPoint();
|
||||
|
||||
// this.addLayerPoint()
|
||||
})
|
||||
},
|
||||
updateLayerPoint(){
|
||||
if(this.markGraphicLayer == null){
|
||||
this.markGraphicLayer = new mars3d.layer.GraphicLayer();
|
||||
this.globalmap.addLayer(this.markGraphicLayer);
|
||||
}
|
||||
// 删除数据
|
||||
console.log("currentUsers",this.currentUsers);
|
||||
this.markGraphicLayer.eachGraphic((graphicEvent)=>{
|
||||
let obj = null;
|
||||
obj = this.currentUsers.find((item,index)=>{
|
||||
return item.createId == graphicEvent.options.userId
|
||||
})
|
||||
if(obj){
|
||||
|
||||
}else{
|
||||
for(let i=0;i<this.markGraphicLayerArr.length;i++){
|
||||
if(this.markGraphicLayerArr[i].createId == graphicEvent.options.userId){
|
||||
this.markGraphicLayerArr.splice(i,1);
|
||||
}
|
||||
}
|
||||
this.markGraphicLayer.removeGraphic(graphicEvent);
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
console.log("markGraphicLayerArr",this.markGraphicLayerArr);
|
||||
// 添加和更新数据
|
||||
this.currentUsers.forEach((item,index)=>{
|
||||
let obj = this.markGraphicLayerArr.find((it,idx)=>{
|
||||
return it.createId == item.createId;
|
||||
})
|
||||
// 如果obj为空则添加
|
||||
if(!obj){
|
||||
console.log("------------添加数据");
|
||||
let graphic = new mars3d.graphic.BillboardEntity({
|
||||
// position: [item.lng,item.lat],
|
||||
position:Cesium.Cartesian3.fromDegrees(parseFloat(item.lng),parseFloat(item.lat)),
|
||||
userId:item.createId,
|
||||
style: {
|
||||
image: "/img/jiuyuanrenyuan.png",
|
||||
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
||||
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
||||
clampToGround:true,
|
||||
scale:0.4,
|
||||
label: {
|
||||
text: "",
|
||||
font_size: 14,
|
||||
color: "#ffffff",
|
||||
pixelOffsetY: 10,
|
||||
distanceDisplayCondition: true,
|
||||
distanceDisplayCondition_far: 500000,
|
||||
distanceDisplayCondition_near: 0
|
||||
}
|
||||
},
|
||||
popup: `<div class="marsTiltPanel marsTiltPanel-theme-blue" style="font-size:12px;">
|
||||
<div class="marsTiltPanel-wrap">
|
||||
<div class="area">
|
||||
<div class="arrow-lt"></div>
|
||||
<div class="b-t"></div>
|
||||
<div class="b-r"></div>
|
||||
<div class="b-b"></div>
|
||||
<div class="b-l"></div>
|
||||
<div class="arrow-rb"></div>
|
||||
<div class="label-wrap">
|
||||
<div class="title">人员信息</div>
|
||||
<div class="label-content">
|
||||
<div class="data-li">
|
||||
<div class="data-label">人员名称:${item.name}</div>
|
||||
</div>
|
||||
<div class="data-li">
|
||||
<div class="data-label">电话号码:${item.phone}</div>
|
||||
<div class="data-value"><span id="lablYeWei" class="label-num"></span><span class="label-unit"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-li">
|
||||
<div class="data-value">
|
||||
<span class="label-tag data-value-status-2" title="视频通话" onclick="videoCall('${item.phone}')">视频通话</span></div>
|
||||
<span id="lablSBZT1" onclick="designRoute('${item.createId}');" class="label-tag data-value-status-1" title="人员动态">路线高亮</span>
|
||||
<span id="lablSBZT1" onclick="deleteRoute('${item.createId}');" class="label-tag data-value-status-2" title="清除路线">路线隐藏</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="b-t-l"></div>
|
||||
<div class="b-b-r"></div>
|
||||
</div>
|
||||
<div class="arrow" ></div>
|
||||
</div>`,
|
||||
popupOptions: {
|
||||
offsetY: -30,
|
||||
template: "{content}",
|
||||
horizontalOrigin: "Cesium.HorizontalOrigin.LEFT",
|
||||
verticalOrigin: "Cesium.VerticalOrigin.CENTER",
|
||||
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 200000), // 按视距距离显示
|
||||
scaleByDistance: new Cesium.NearFarScalar(1000, 0.8, 8000, 0.3),
|
||||
},
|
||||
pointerEvents: true
|
||||
})
|
||||
let graphicItem = {
|
||||
createId:item.createId,
|
||||
graphic:graphic
|
||||
}
|
||||
this.markGraphicLayerArr.push(graphicItem);
|
||||
this.markGraphicLayer.addGraphic(graphic);
|
||||
graphic.addDynamicPosition(Cesium.Cartesian3.fromDegrees(parseFloat(item.lng),parseFloat(item.lat)),0);
|
||||
}else{
|
||||
// 如果已经存在则更新位置
|
||||
console.log("------------更新数据");
|
||||
this.markGraphicLayer.eachGraphic((graphicEvent) => {
|
||||
if (graphicEvent.isPrivate) {
|
||||
return
|
||||
}
|
||||
console.log("graphicEvent",graphicEvent);
|
||||
if(graphicEvent.options.userId == obj.createId){
|
||||
graphicEvent.addDynamicPosition(Cesium.Cartesian3.fromDegrees(parseFloat(item.lng),parseFloat(item.lat)),5);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
addLayerPoint(){
|
||||
if(this.markGraphicLayer == null){
|
||||
this.markGraphicLayer = new mars3d.layer.GraphicLayer();
|
||||
this.globalmap.addLayer(this.markGraphicLayer);
|
||||
}
|
||||
|
||||
this.markGraphicLayerArr.forEach(item =>{
|
||||
this.markGraphicLayer.removeGraphic(item)
|
||||
})
|
||||
|
|
@ -179,6 +469,7 @@ export default {
|
|||
this.pointData.forEach((item,index)=>{
|
||||
let graphic = new mars3d.graphic.BillboardEntity({
|
||||
position: [item.lng,item.lat],
|
||||
userId:item.createId,
|
||||
style: {
|
||||
image: "/img/jiuyuanrenyuan.png",
|
||||
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
||||
|
|
@ -247,7 +538,7 @@ export default {
|
|||
pointerEvents: true // false时不允许拾取和触发任意鼠标事件,但可以穿透div缩放地球
|
||||
})
|
||||
this.markGraphicLayerArr.push(graphicWinodw)
|
||||
this.markGraphicLayer.addGraphic(graphicWinodw);
|
||||
this.markGraphicLayer.addGraphic(graphicWinodw);
|
||||
})
|
||||
},
|
||||
deleteRoute(){
|
||||
|
|
|
|||
Loading…
Reference in New Issue