Commit e9eb04be authored by caicaicai's avatar caicaicai

修改

parent 3b5f6f50
......@@ -2,10 +2,10 @@ ENV = 'development'
# 接口地址
#VUE_APP_BASE_API = 'http://localhost:8000'
VUE_APP_BASE_API = 'http://192.168.0.110:8001'
VUE_APP_BASE_API = 'http://192.168.0.111:8001'
VUE_APP_WS_API = 'ws://localhost:8000'
VUE_APP_LOCAL_API = 'http://192.168.0.110:8001'
VUE_APP_LOCAL_API2 = 'http://192.168.0.110:8001'
VUE_APP_LOCAL_API = 'http://192.168.0.111:8001'
VUE_APP_LOCAL_API2 = 'http://192.168.0.111:8001'
# 是否启用 babel-plugin-dynamic-import-node插件
VUE_CLI_BABEL_TRANSPILE_MODULES = true
......@@ -1888,6 +1888,38 @@ var HttpReq = function(){
data:data,
})
},
//获取地图车辆轨迹——获取所有实时坐标
getCarTrajectoryQuery: function(param){
return request({
url: '/gps/all',
method: 'get',
params:param,
})
},
//获取地图车辆轨迹——获取所有实时坐标
getAllNewTimeCarTrajectoryQuery: function(param){
return request({
url: '/gps/all',
method: 'get',
params:param,
})
},
//获取地图车辆轨迹——获取历史轨迹
getAllHistroyCarTrajectoryQuery: function(param){
return request({
url: '/gps/line',
method: 'get',
params:param,
})
},
//获取地图车辆轨迹——获取历史一个设备坐标
getOneHistroyCarTrajectoryQuery: function(param){
return request({
url: '/gps',
method: 'get',
params:param,
})
},
......
......@@ -138,7 +138,7 @@ export default {
let that = this;
HttpReq.truckDispatching.screenMapSetUpQuery({size:9999}).then((res) => {
if(true){;
console.log(res);
//console.log(res);
let data1 = [];
for(let key in res){
that.weilanName.push(key);
......@@ -153,8 +153,8 @@ export default {
data1.push(arrays)
}
that.zuobianData = data1
console.log("zuobianData",that.zuobianData);
console.log("weilanName",that.weilanName);
//console.log("zuobianData",that.zuobianData);
//console.log("weilanName",that.weilanName);
if (this.appendToBody) {
document.body.appendChild(this.$el)
......
......@@ -42,6 +42,7 @@ export default {
data(){
return{
historyTrajectoryData:[],
persons:[
["122.128833", "37.526448", "500"],
["122.128638", "37.522818", "500"],
......@@ -89,6 +90,7 @@ export default {
["122.127833", "37.525448", "500"],
],
deviceId:'DESKTOP-L56LKGM',
zuobianData:[],
toJavaCoordinates:[],
weilanName:[],
......@@ -136,6 +138,7 @@ export default {
//后台获取数据
getCoordinate() {
let that = this;
//获取电子围栏
HttpReq.truckDispatching.screenMapSetUpQuery({size:9999}).then((res) => {
if(true){;
//console.log(res);
......@@ -153,22 +156,48 @@ export default {
data1.push(arrays)
}
that.zuobianData = data1
console.log("zuobianData",that.zuobianData);
console.log("weilanName",that.weilanName);
if (this.appendToBody) {
document.body.appendChild(this.$el)
}
if (this.mapKey) {
this.initMars3d(this.options)
} else {
mars3d.Resource.fetchJson({ url: this.url }).then((data) => {
this.initMars3d(data.map3d)// 构建地图
})
}
//console.log("zuobianData",that.zuobianData);
//console.log("weilanName",that.weilanName);
}
})
//获取历史轨迹
HttpReq.truckDispatching.getAllHistroyCarTrajectoryQuery({id:that.deviceId}).then((res) => {
console.log('获取历史轨迹',res);
if(res.code == 200){
let obj1 = {};
let array1 = [];
res.data.line.forEach((item,index)=>{
let array2 = [];
array2.push(item.location.x);
array2.push(item.location.y);
array2.push('500');
array1.push(array2);
})
obj1.name = res.data.devId;
obj1.arrays = array1;
that.historyTrajectoryData.push(obj1);
console.log(that.historyTrajectoryData);
}
})
this.$nextTick(()=>{
if (this.appendToBody) {
document.body.appendChild(this.$el)
}
if (this.mapKey) {
this.initMars3d(this.options)
} else {
mars3d.Resource.fetchJson({ url: this.url }).then((data) => {
this.initMars3d(data.map3d)// 构建地图
})
}
})
},
//上传围栏数据
uploaded(){
......
......@@ -358,19 +358,19 @@ import $ from 'jquery'
//绑定Popup
graphic.bindPopup(item);
//绑定右键菜单
graphic.bindContextMenu([
{
text: "删除对象[graphic绑定的]",
iconCls: "fa fa-trash-o",
callback: function (e) {
let graphic = e.graphic;
if (graphic) {
graphic.remove();
}
},
},
]);
// 绑定右键菜单
// graphic.bindContextMenu([
// {
// text: "删除对象[graphic绑定的]",
// iconCls: "fa fa-trash-o",
// callback: function (e) {
// let graphic = e.graphic;
// if (graphic) {
// graphic.remove();
// }
// },
// },
// ]);
//测试 颜色闪烁
if (graphic.startFlicker) {
......
......@@ -135,6 +135,7 @@ import * as echarts from 'echarts';
export default {
data() {
return {
websocket: null,
whetherShow:false,
selectCarFleet:'', //搜索对应车队
carFleetData:[], //车队信息
......@@ -146,6 +147,10 @@ export default {
dispatchDetailsList:[], //智能调度情况表
}
},
created(){
//页面刚进入时开启长连接
this.initWebSocket();
},
mounted() { },
methods: {
//获取总数据
......@@ -349,8 +354,45 @@ export default {
},
//初始化weosocket
initWebSocket(){
//const wsuri = "ws://114.116.108.246:81/websocket/socketServer?userId="+userId;//连接地址,可加参数
const wsuri = "ws://192.168.0.111:8001/webSocket?userId=7";
this.websocket = new WebSocket(wsuri);
this.websocket.onopen = this.websocketonopen;
this.websocket.onerror = this.websocketonerror;
this.websocket.onmessage = this.websocketonmessage;
this.websocket.onclose = this.websocketclose;
},
//WebSocket连接成功
websocketonopen() {
console.log("WebSocket连接成功");
},
//WebSocket连接错误
websocketonerror(e) {
console.log("WebSocket连接发生错误");
},
//WebSocket数据接收
websocketonmessage(e){
console.log("ee",e);
console.log("eeee",e.data);
const redata = JSON.parse(e.data);
console.log("eeee---",redata);
},
//WebSocket数据发送
websocketsend(agentData){
this.websock.send(agentData);
},
//WebSocket关闭
websocketclose(e){
console.log("connection closed (" + e.code + ")");
},
},
destroyed: function() {
//页面销毁时关闭长连接
this.websocketclose();
},
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment