|
|
@ -498,7 +498,7 @@ body {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.device-type {
|
.device-type {
|
||||||
width: 320px;
|
width: 93%;
|
||||||
height: 65px;
|
height: 65px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -506,7 +506,37 @@ body {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-top: 3%;
|
margin-top: 3%;
|
||||||
.txt {
|
.txt {
|
||||||
width: 150px;
|
width: 50%;
|
||||||
|
height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
|
||||||
|
.p1 {
|
||||||
|
width: 30%;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
background-color: rgba(55, 58, 70, 1);
|
||||||
|
text-align: center;
|
||||||
|
// 禁止换行
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.p2 {
|
||||||
|
width: 70%;
|
||||||
|
font-size: 12px;
|
||||||
|
padding-left: 10px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
// 禁止换行
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.txt1 {
|
||||||
|
width: 100%;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -516,6 +546,7 @@ body {
|
||||||
|
|
||||||
.p1 {
|
.p1 {
|
||||||
min-width: 58px;
|
min-width: 58px;
|
||||||
|
width: 50%;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
background-color: rgba(55, 58, 70, 1);
|
background-color: rgba(55, 58, 70, 1);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
@ -527,6 +558,7 @@ body {
|
||||||
|
|
||||||
.p2 {
|
.p2 {
|
||||||
min-width: 102px;
|
min-width: 102px;
|
||||||
|
width: 47%;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
|
|
|
||||||
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
|
@ -254,6 +254,17 @@ export default {
|
||||||
window.marsMap.removeLayer(graphicLayer);
|
window.marsMap.removeLayer(graphicLayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let graphicDevice = window.marsMap.getLayerById("devLog");
|
||||||
|
if (graphicDevice) {
|
||||||
|
let deviceGraphic = graphicDevice.getGraphicById(item.DeviceId);
|
||||||
|
if (deviceGraphic !== undefined) {
|
||||||
|
deviceGraphic.setOptions({
|
||||||
|
style: {
|
||||||
|
scale: 1.5
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleContractClick() {
|
handleContractClick() {
|
||||||
this.isContracted = !this.isContracted; // 切换状态
|
this.isContracted = !this.isContracted; // 切换状态
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
v-for="(item, index) in deviceStatus"
|
v-for="(item, index) in deviceStatus"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="device-item"
|
class="device-item"
|
||||||
|
@click="handleDeviceClick(item)"
|
||||||
>
|
>
|
||||||
<div class="device-icon">
|
<div class="device-icon">
|
||||||
<img
|
<img
|
||||||
|
|
@ -130,6 +131,29 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleDeviceClick(value) {
|
||||||
|
this.positionData.forEach((item) => {
|
||||||
|
item.devices.forEach((device) => {
|
||||||
|
if (device.icon === value.icon) {
|
||||||
|
console.log(device, "device");
|
||||||
|
|
||||||
|
let graphicLayer = window.marsMap.getLayerById("devLog");
|
||||||
|
graphicLayer.eachGraphic((graphic) => {
|
||||||
|
if (graphic.id === device.id) {
|
||||||
|
if (graphic.startBounce) {
|
||||||
|
graphic.startBounce({
|
||||||
|
autoStop: true,
|
||||||
|
step: 2,
|
||||||
|
maxHeight: 90
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
console.log(value, this.positionData, "value");
|
||||||
|
},
|
||||||
handleContractClick() {
|
handleContractClick() {
|
||||||
this.isContracted = !this.isContracted; // 切换状态
|
this.isContracted = !this.isContracted; // 切换状态
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,9 @@ export function allDevices(options, type, show) {
|
||||||
0
|
0
|
||||||
),
|
),
|
||||||
style: {
|
style: {
|
||||||
image: require(`@/assets/img/device/deviceIcon/${deviceItem.icon}.png`),
|
image: deviceItem.isOnline
|
||||||
|
? require(`@/assets/img/device/deviceIcon/${deviceItem.icon}.png`)
|
||||||
|
: require(`@/assets/img/device/deviceIcon/${deviceItem.icon}-offline.png`),
|
||||||
// visibleDepth:false,
|
// visibleDepth:false,
|
||||||
scale: 1.5,
|
scale: 1.5,
|
||||||
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
||||||
|
|
@ -173,7 +175,9 @@ export function allDevices(options, type, show) {
|
||||||
name: "设备",
|
name: "设备",
|
||||||
position: new mars3d.LngLatPoint(item.lon, item.lat, 0),
|
position: new mars3d.LngLatPoint(item.lon, item.lat, 0),
|
||||||
style: {
|
style: {
|
||||||
image: require(`@/assets/img/device/deviceIcon/${item.icon}.png`),
|
image: item.isOnline
|
||||||
|
? require(`@/assets/img/device/deviceIcon/${item.icon}.png`)
|
||||||
|
: require(`@/assets/img/device/deviceIcon/${item.icon}-offline.png`),
|
||||||
// visibleDepth:false,
|
// visibleDepth:false,
|
||||||
scale: 1.5,
|
scale: 1.5,
|
||||||
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
||||||
|
|
@ -201,7 +205,7 @@ function bindLayerPopup(graphicLayer, graphic) {
|
||||||
let attr = graphic.attr;
|
let attr = graphic.attr;
|
||||||
if (graphic.name === "无人机") {
|
if (graphic.name === "无人机") {
|
||||||
graphic.bindPopup(
|
graphic.bindPopup(
|
||||||
` <div class="mians" style="height: 410px;">
|
` <div class="mians" style="height: 435px;">
|
||||||
<div class="title">${attr.device_type}</div>
|
<div class="title">${attr.device_type}</div>
|
||||||
<div class="imgs"><img src="${imgUav}" /></div>
|
<div class="imgs"><img src="${imgUav}" /></div>
|
||||||
<div class="device-type" style="margin-top: 8%;">
|
<div class="device-type" style="margin-top: 8%;">
|
||||||
|
|
@ -226,7 +230,11 @@ function bindLayerPopup(graphicLayer, graphic) {
|
||||||
<p class="p2">${attr.serial_number}</p>
|
<p class="p2">${attr.serial_number}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="txt">
|
<div class="txt">
|
||||||
<p class="p1">速度</p>
|
<p class="p1">中心点</p>
|
||||||
|
<p class="p2" id="lblCenter">${attr.centerdistance}</p>
|
||||||
|
</div>
|
||||||
|
<div class="txt1">
|
||||||
|
<p class="p1">三维速度</p>
|
||||||
<p class="p2" id="lblSpeed">${attr.height}</p>
|
<p class="p2" id="lblSpeed">${attr.height}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -254,14 +262,24 @@ function bindLayerPopup(graphicLayer, graphic) {
|
||||||
if (lblDistance) {
|
if (lblDistance) {
|
||||||
lblDistance.innerHTML = Math.round(params.distance) + "米";
|
lblDistance.innerHTML = Math.round(params.distance) + "米";
|
||||||
}
|
}
|
||||||
|
const lblCenter = container.querySelector("#lblCenter");
|
||||||
|
if (lblCenter) {
|
||||||
|
lblCenter.innerHTML = Math.round(params.centerdistance) + "米";
|
||||||
|
}
|
||||||
|
|
||||||
const lblSpeed = container.querySelector("#lblSpeed");
|
const lblSpeed = container.querySelector("#lblSpeed");
|
||||||
if (lblSpeed) {
|
if (lblSpeed) {
|
||||||
const speeds = [params.speed_E, params.speed_N, params.speed_U].filter(
|
// const speeds = [params.speed_E, params.speed_N, params.speed_U].filter(
|
||||||
(speed) => speed !== undefined
|
// (speed) => speed !== undefined
|
||||||
);
|
// );
|
||||||
const maxSpeed = speeds.length > 0 ? Math.max(...speeds) : undefined;
|
// const maxSpeed = speeds.length > 0 ? Math.max(...speeds) : undefined;
|
||||||
lblSpeed.innerHTML = maxSpeed + "m/s";
|
lblSpeed.innerHTML =
|
||||||
|
"E:" +
|
||||||
|
params.speed_E +
|
||||||
|
" N:" +
|
||||||
|
params.speed_N +
|
||||||
|
" U:" +
|
||||||
|
params.speed_E;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (graphic.name === "飞手") {
|
} else if (graphic.name === "飞手") {
|
||||||
|
|
@ -347,7 +365,7 @@ export function mapUavFiex(options) {
|
||||||
// verticalOrigin: Cesium.VerticalOrigin.BOTTOM
|
// verticalOrigin: Cesium.VerticalOrigin.BOTTOM
|
||||||
// },
|
// },
|
||||||
model: {
|
model: {
|
||||||
scale: 1,
|
scale: 8,
|
||||||
url: "/uav/scene.gltf",
|
url: "/uav/scene.gltf",
|
||||||
// 航向
|
// 航向
|
||||||
heading: 0,
|
heading: 0,
|
||||||
|
|
@ -422,7 +440,7 @@ export function mapUavFiex(options) {
|
||||||
const point = new mars3d.LngLatPoint(
|
const point = new mars3d.LngLatPoint(
|
||||||
item.drone_lon,
|
item.drone_lon,
|
||||||
item.drone_lat,
|
item.drone_lat,
|
||||||
item.height
|
item.height || 10
|
||||||
);
|
);
|
||||||
car.addDynamicPosition(point, 0);
|
car.addDynamicPosition(point, 0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||