Commit 10722cc3 authored by caicaicai's avatar caicaicai

修改

parent 7d73bb27
...@@ -150,9 +150,25 @@ export default { ...@@ -150,9 +150,25 @@ export default {
that.zuobianData = data1 that.zuobianData = data1
//console.log("zuobianData",that.zuobianData); //console.log("zuobianData",that.zuobianData);
//console.log("weilanName",that.weilanName); //console.log("weilanName",that.weilanName);
this.getlishiguijiFn();
}
})
},
//后台获取数据——获取实时位置
getlishiguijiFn() {
let that = this;
HttpReq.truckDispatching.getCarTrajectoryQuery().then((res) => {
//console.log(res);
if(res.code == 200){
that.historyTrajectoryData = res.data;
this.$nextTick(()=>{ this.$nextTick(()=>{
if (this.appendToBody) { if (this.appendToBody) {
document.body.appendChild(this.$el) document.body.appendChild(this.$el)
console.log(465);
} }
if (this.mapKey) { if (this.mapKey) {
this.initMars3d(this.options) this.initMars3d(this.options)
...@@ -163,16 +179,6 @@ export default { ...@@ -163,16 +179,6 @@ export default {
} }
}) })
}
})
},
//后台获取数据——获取实时位置
getlishiguijiFn() {
let that = this;
HttpReq.truckDispatching.getCarTrajectoryQuery().then((res) => {
if(res.code == 200){
that.historyTrajectoryData = res.data;
} }
}) })
}, },
...@@ -196,7 +202,6 @@ export default { ...@@ -196,7 +202,6 @@ export default {
//围栏回显 //围栏回显
that.zuobianData.forEach(function(item,index){ that.zuobianData.forEach(function(item,index){
//console.log(item);
var graphicLayer = new mars3d.layer.GraphicLayer(); var graphicLayer = new mars3d.layer.GraphicLayer();
map.addLayer(graphicLayer); map.addLayer(graphicLayer);
initLayerManager(graphicLayer,that.weilanName[index]); initLayerManager(graphicLayer,that.weilanName[index]);
...@@ -204,10 +209,11 @@ export default { ...@@ -204,10 +209,11 @@ export default {
}) })
//实时位置 //实时位置
var graphicLayer4 = new mars3d.layer.GraphicLayer(); // that.historyTrajectoryData.forEach((item,index)=>{
map.addLayer(graphicLayer4) // var graphicLayer4 = new mars3d.layer.GraphicLayer();
//that.addDemoGraphics(graphicLayer4); // map.addLayer(graphicLayer4)
// that.addDemoGraphics(graphicLayer4,item);
// })
// 抛出事件 // 抛出事件
this.$emit('onload', map) this.$emit('onload', map)
...@@ -246,68 +252,60 @@ export default { ...@@ -246,68 +252,60 @@ export default {
return property; return property;
}, },
//实时位置 //实时位置
addDemoGraphics(graphicLayer4) { addDemoGraphics(graphicLayer4,item) {
let that = this; let that = this;
const graphic = new mars3d.graphic.ModelPrimitive({
for (let i = 0; i < 1; i++) { style: {
const graphic = new mars3d.graphic.ModelPrimitive({ url: "//data.mars3d.cn/gltf/mars/car/tufangche.glb",
style: { scale: 0.1,
url: "//data.mars3d.cn/gltf/mars/car/tufangche.glb", minimumPixelSize: 50,
scale: 0.1, // 高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用
minimumPixelSize: 50, highlight: {
type: mars3d.EventType.click,
// 高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用 silhouette: true,
highlight: { silhouetteColor: "#ff0000",
type: mars3d.EventType.click, silhouetteSize: 4
silhouette: true,
silhouetteColor: "#ff0000",
silhouetteSize: 4
},
label: {
// 不需要文字时,去掉label配置即可
text: "鲁A12345",
font_size: 16,
color: "#ffffff",
outline: true,
outlineColor: "#000000",
pixelOffsetY: -20,
distanceDisplayCondition: true,
distanceDisplayCondition_far: 50000,
distanceDisplayCondition_near: 0
}
}, },
}) label: {
graphicLayer4.addGraphic(graphic) // 不需要文字时,去掉label配置即可
} text: item.name,
font_size: 16,
color: "#ffffff",
outline: true,
outlineColor: "#000000",
pixelOffsetY: -20,
distanceDisplayCondition: true,
distanceDisplayCondition_far: 50000,
distanceDisplayCondition_near: 0
}
},
})
graphicLayer4.addGraphic(graphic)
// 设置动态位置 // 设置动态位置
graphicLayer4.eachGraphic((graphic) => { graphicLayer4.eachGraphic((graphic) => {
graphic.addDynamicPosition(that.randomPoint()) // 首次出现的位置 graphic.addDynamicPosition(Cesium.Cartesian3.fromDegrees(item.lat, item.lon, 500)) // 首次出现的位置
}) })
graphicLayer4.eachGraphic((graphic) => { graphicLayer4.eachGraphic((graphic) => {
graphic.addDynamicPosition(that.randomPoint(), 50) // 按20秒运动至指定位置 graphic.addDynamicPosition(that.randomPoint(item.name), 6) // 按6秒运动至指定位置
}) })
// 定时更新动态位置(setInterval为演示) // 定时更新动态位置(setInterval为演示)
setInterval(() => { // setInterval(() => {
graphicLayer4.eachGraphic((graphic) => { // graphicLayer4.eachGraphic((graphic) => {
graphic.addDynamicPosition(that.randomPoint(), 50) // graphic.addDynamicPosition(that.randomPoint(item.name), 6)
}) // })
}, 20000) // }, 6000)
}, },
// 取区域内的随机点 // 取区域内的随机点
randomPoint() { randomPoint(name) {
this.getlishiguijiFn() HttpReq.truckDispatching.getCarTrajectoryQuery({name:name}).then((res) => {
// const jd = this.random(117.130666 * 1000, 117.130241 * 1000) / 1000 if(res.code == 200){
// const wd = this.random(36.655207 * 1000, 36.665207 * 1000) / 1000 return Cesium.Cartesian3.fromDegrees(res.data[0].lat, res.data[0].lon, 500)
// console.log("jd",jd); }
// console.log("wd",wd); })
// return Cesium.Cartesian3.fromDegrees(jd, wd, 500)
}, },
random(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min)
}
} }
} }
</script> </script>
......
...@@ -178,7 +178,8 @@ import $ from 'jquery' ...@@ -178,7 +178,8 @@ import $ from 'jquery'
//attr.text = "围栏"; //attr.text = "围栏";
// attr["视频"] = `<video src='http://data.mars3d.cn/file/video/lukou.mp4' controls autoplay style="width: 300px;" ></video>`; // attr["视频"] = `<video src='http://data.mars3d.cn/file/video/lukou.mp4' controls autoplay style="width: 300px;" ></video>`;
return mars3d.Util.getTemplateHtml({ title: "围栏区域", template: "all", attr: attr }); //return mars3d.Util.getTemplateHtml({ title: "围栏区域", template: "all", attr: attr });
return mars3d.Util.getTemplateHtml({ title: "围栏区域", template: "all"});
}); });
} }
......
...@@ -916,9 +916,9 @@ export default { ...@@ -916,9 +916,9 @@ export default {
width: 100%; width: 100%;
height: 19vh; height: 19vh;
} }
.table-box{ /* .table-box{
margin-top: -10px; margin-top: -10px;
} } */
dl{ dl{
display:table; display:table;
width:100%; width:100%;
......
...@@ -17,8 +17,7 @@ ...@@ -17,8 +17,7 @@
<div class="voiceAppContent_2_content"> <div class="voiceAppContent_2_content">
<el-checkbox-group v-model="selectCarRadioArray"> <el-checkbox-group v-model="selectCarRadioArray">
<el-checkbox v-for="(item,index) in carsInforData" :label="item" :key="index" style="margin-top:7px;"> <el-checkbox v-for="(item,index) in carsInforData" :label="item" :key="index" style="margin-top:7px;">
<div style="width:7.5vw;margin-left:1.7vw;">{{item.name}}</div> <div style="width:12vw;margin-left:1.7vw;text-align: center;">{{item.number}}</div>
<div>{{item.number}}</div>
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
...@@ -27,7 +26,7 @@ ...@@ -27,7 +26,7 @@
<div class="voiceAppContent_2_title">已选中车辆</div> <div class="voiceAppContent_2_title">已选中车辆</div>
<div class="voiceAppContent_3_content"> <div class="voiceAppContent_3_content">
<div v-for="(item,index) in selectCarRadioArray" :key="index" class="voiceAppContent_3_content_selectCar"> <div v-for="(item,index) in selectCarRadioArray" :key="index" class="voiceAppContent_3_content_selectCar">
<div>{{item.name}}</div> <div>{{item.number}}</div>
<div style="width:20px;height:20px;background-color: rgb(4,112,171);text-align: center;font-size:30px;line-height:20px;cursor: pointer;" @click="cancelSelect(index)"> <div style="width:20px;height:20px;background-color: rgb(4,112,171);text-align: center;font-size:30px;line-height:20px;cursor: pointer;" @click="cancelSelect(index)">
<span>×</span> <span>×</span>
</div> </div>
...@@ -205,9 +204,9 @@ export default { ...@@ -205,9 +204,9 @@ export default {
//页面刚进入时开启长连接 //页面刚进入时开启长连接
this.initWebSocket(); this.initWebSocket();
this.heartbeatTimer = setInterval(() => { // this.heartbeatTimer = setInterval(() => {
this.reconnect(); // this.reconnect();
}, 10000) // }, 10000)
}else{ }else{
this.whetherShow = false; this.whetherShow = false;
...@@ -521,9 +520,9 @@ export default { ...@@ -521,9 +520,9 @@ export default {
.intelligentSchScrView_leftView_content,.intelligentSchScrView_rightView_content{ .intelligentSchScrView_leftView_content,.intelligentSchScrView_rightView_content{
width: 100%; width: 100%;
} }
.table-box{ /* .table-box{
margin-top: -10px; margin-top: -10px;
} } */
dl{ dl{
display:table; display:table;
width:100%; width:100%;
......
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