提交 0a9c1742 作者: 温凯

feat(controlPanel): 添加主机库状态显示并优化样式

上级 c901632c
<template> <template>
<div class="stl-timed-task"> <div class="stl-timed-task">
<div class="cf m5 f12">
主机库状态:<span
:class="apronInfo.masterStatus ? 'green' : ' red'"
>{{ apronInfo.masterStatus ? '正常' : apronInfo.descText }}</span
>
</div>
<div class="timed-task-header"> <div class="timed-task-header">
<div class="header__column flex2">序号</div> <div class="header__column flex2">序号</div>
<div class="header__column flex2">机库名称</div> <div class="header__column flex2">机库名称</div>
<div class="header__column status">状态</div> <div class="header__column status">状态</div>
<div class="header__column flex2">距离(km)</div> <div class="header__column flex2">距离(km)</div>
</div> </div>
<div class="timed-task-main" v-loading="loading" element-loading-background="rgba(0, 0, 0, 0.8)"> <div
<div class="row" :class="{ single: i % 2 != 0 }" v-for="(item, i) in skipList" :key="i"> class="timed-task-main"
v-loading="loading"
element-loading-background="rgba(0, 0, 0, 0.8)"
>
<div
class="row"
:class="{ single: i % 2 != 0 }"
v-for="(item, i) in skipList"
:key="i"
>
<div class="row__column flex2"> <div class="row__column flex2">
<span class="f12"> <span class="f12">
<span class="mr10"> <span class="mr10">
<el-checkbox @change="changeFn(item)" v-model="item.active" :label="item.i" <el-checkbox
:disabled="!item.slaveStatus"></el-checkbox> </span>{{ i + 1 }} @change="changeFn(item)"
v-model="item.active"
:label="item.i"
:disabled="!item.slaveStatus"
></el-checkbox> </span
>{{ i + 1 }}
</span> </span>
</div> </div>
<div class="row__column flex2"> <div class="row__column flex2">
<el-tooltip class="item" effect="dark" :content="item.name" placement="top-start"> <el-tooltip
class="item"
effect="dark"
:content="item.name"
placement="top-start"
>
<span class="f12">{{ item.name }}</span> <span class="f12">{{ item.name }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<div class="row__column flex2"> <div class="row__column flex2">
<el-tooltip class="item" effect="dark" placement="top-start"> <el-tooltip class="item" effect="dark" placement="top-start">
<span class="f12" :class="{ <span
class="f12"
:class="{
'text-red': !item.slaveStatus, 'text-red': !item.slaveStatus,
'text-green': item.slaveStatus, 'text-green': item.slaveStatus,
}">{{ item.slaveStatus ? "空闲" : "忙碌" }}</span> }"
>{{ item.slaveStatus ? "空闲" : "忙碌" }}</span
>
</el-tooltip> </el-tooltip>
</div> </div>
<div class="row__column status" style="color: rgb(255, 189, 54)"> <div class="row__column status" style="color: rgb(255, 189, 54)">
<el-tooltip class="item" effect="dark" :content="String(item.targetDistance / 1000)" placement="top-start"> <el-tooltip
<span class="f12">{{ (item.targetDistance / 1000)?.toFixed(2) }}</span> class="item"
effect="dark"
:content="String(item.targetDistance / 1000)"
placement="top-start"
>
<span class="f12">{{
(item.targetDistance / 1000)?.toFixed(2)
}}</span>
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div>
...@@ -54,14 +91,21 @@ ...@@ -54,14 +91,21 @@
<div class="dib"> <div class="dib">
{{ uav.uav && uav.uav.name }} --- {{ activeItem.name }} {{ uav.uav && uav.uav.name }} --- {{ activeItem.name }}
</div> </div>
<span style="color: #3388ff" class="ml56 cp pr130" @click="showLine">预览</span> <span style="color: #3388ff" class="ml56 cp pr130" @click="showLine"
>预览</span
>
</div> </div>
</div> </div>
<div class="stl-timed-task-ht mt16 cf"> <div class="stl-timed-task-ht mt16 cf">
<div class="lh34 f12">飞行高度设置:</div> <div class="lh34 f12">飞行高度设置:</div>
<div class="bg"> <div class="bg">
<el-input @blur="isEditing.height = false" size="mini" v-if="isEditing.height" v-model="flightHeight" <el-input
type="number" /> @blur="isEditing.height = false"
size="mini"
v-if="isEditing.height"
v-model="flightHeight"
type="number"
/>
<span v-else class="indent">{{ flightHeight }} m</span> <span v-else class="indent">{{ flightHeight }} m</span>
</div> </div>
<div class="text ml10 cp lh34" @click="toggleEdit('height')"> <div class="text ml10 cp lh34" @click="toggleEdit('height')">
...@@ -71,17 +115,26 @@ ...@@ -71,17 +115,26 @@
<div class="stl-timed-task-ht mt16"> <div class="stl-timed-task-ht mt16">
<div class="lh34 f12">飞行速度设置:</div> <div class="lh34 f12">飞行速度设置:</div>
<div class="bg"> <div class="bg">
<el-input @blur="isEditing.speed = false" size="mini" v-if="isEditing.speed" v-model="flightSpeed" <el-input
type="number" /> @blur="isEditing.speed = false"
size="mini"
v-if="isEditing.speed"
v-model="flightSpeed"
type="number"
/>
<span class="indent" v-else>{{ flightSpeed }} m/s</span> <span class="indent" v-else>{{ flightSpeed }} m/s</span>
</div> </div>
<div class="text ml10 cp lh34" @click="toggleEdit('speed')">编辑</div> <div class="text ml10 cp lh34" @click="toggleEdit('speed')">编辑</div>
</div> </div>
<div class="mt16">飞行总距离:{{ activeItem.targetDistance?.toFixed(2) }}公里</div> <div class="mt16">
飞行总距离:{{ activeItem.targetDistance?.toFixed(2) }}公里
</div>
</div> </div>
<div class="tc mt50"> <div class="tc mt50">
<el-button size="mini" @click="handleClose">取消</el-button> <el-button size="mini" @click="handleClose">取消</el-button>
<el-button type="primary" size="mini" @click="handleConfirm">确定</el-button> <el-button type="primary" size="mini" @click="handleConfirm"
>确定</el-button
>
</div> </div>
</div> </div>
...@@ -98,7 +151,11 @@ ...@@ -98,7 +151,11 @@
<span>30s</span><span class="cred ml15"> 前往>></span> <span>30s</span><span class="cred ml15"> 前往>></span>
</div> </div>
</leapFrogFlighDialog> --> </leapFrogFlighDialog> -->
<leapFrogDialog title="蛙跳飞行" :visible.sync="leapFrogDialogVisible" @confirm="handleConfirm"></leapFrogDialog> <leapFrogDialog
title="蛙跳飞行"
:visible.sync="leapFrogDialogVisible"
@confirm="handleConfirm"
></leapFrogDialog>
</div> </div>
</template> </template>
...@@ -124,16 +181,15 @@ export default { ...@@ -124,16 +181,15 @@ export default {
return { return {
dialogVisible: false, dialogVisible: false,
// 当前选中要跳转的机 // 当前选中要跳转的机
activeItem: { activeItem: {},
},
descCodeList: { descCodeList: {
0: 'ok!', 0: "ok!",
4401: '降落点位置未设置!', 4401: "降落点位置未设置!",
4402: '目标机库有无人机在舱内!', 4402: "目标机库有无人机在舱内!",
4403: '主跳转机库无人机不在舱内!', 4403: "主跳转机库无人机不在舱内!",
4404: '当前正在执行流程,非可跳跃状态!', 4404: "当前正在执行流程,非可跳跃状态!",
4405: '天气不宜飞行!', 4405: "天气不宜飞行!",
4406: '电量不足已飞至目标机库!' 4406: "电量不足已飞至目标机库!",
}, },
apronInfo: { apronInfo: {
// chargeRemaining: 0, // chargeRemaining: 0,
...@@ -198,20 +254,22 @@ export default { ...@@ -198,20 +254,22 @@ export default {
}; };
}, },
watch: { watch: {
'uavRealTimeData.isFlying': { "uavRealTimeData.isFlying": {
handler: function (newVal, oldVal) { handler: function (newVal, oldVal) {
if (oldVal === false && newVal === true) { if (oldVal === false && newVal === true) {
console.log("飞行状态"); console.log("飞行状态");
} }
}, },
deep: true, deep: true,
immediate: true, immediate: true,
}, },
}, },
computed: { computed: {
...mapState("MMCFlightControlCenter", ["uav", "uavRealTimeData", "airwayEntities"]), ...mapState("MMCFlightControlCenter", [
"uav",
"uavRealTimeData",
"airwayEntities",
]),
...mapState("MMCFlightControlCenter/hangar", [ ...mapState("MMCFlightControlCenter/hangar", [
"hangarRealTimeData", "hangarRealTimeData",
"hangar", "hangar",
...@@ -231,9 +289,12 @@ export default { ...@@ -231,9 +289,12 @@ export default {
this.$message.warning("请先接管设备"); this.$message.warning("请先接管设备");
return; return;
} }
if(!this.apronInfo.masterStatus){
return this.$message.warning( this.apronInfo.descText);
}
// 执行前先校验主机库状态 0 未正常 // 执行前先校验主机库状态 0 未正常
if (this.apronInfo && this.apronInfo.descCode != 0) { if (this.apronInfo && this.apronInfo.descCode != 0) {
let { descCode } = this.apronInfo let { descCode } = this.apronInfo;
return this.$message.warning(this.descCodeList[descCode]); return this.$message.warning(this.descCodeList[descCode]);
} }
// 选择了调点再执行 // 选择了调点再执行
...@@ -264,20 +325,27 @@ export default { ...@@ -264,20 +325,27 @@ export default {
}, },
showLine() { showLine() {
let { height, latitude, longitude, name } = this.activeItem; let { height, latitude, longitude, name } = this.activeItem;
let apronPosition = Cesium.Cartesian3.fromDegrees(this.apronInfo.longitude, this.apronInfo.latitude, this.apronInfo.height) let apronPosition = Cesium.Cartesian3.fromDegrees(
this.apronInfo.longitude,
this.apronInfo.latitude,
this.apronInfo.height
);
// 创建一个带有图片的实体 // 创建一个带有图片的实体
const apronEntity = window.$mmc_stl.viewer.entities.add({ const apronEntity = window.$mmc_stl.viewer.entities.add({
position: apronPosition, // 设置图片的位置(经纬度和高度) position: apronPosition, // 设置图片的位置(经纬度和高度)
label: { label: {
text: this.apronInfo.name, text: this.apronInfo.name,
font: '14pt monospace', font: "14pt monospace",
style: Cesium.LabelStyle.FILL_AND_OUTLINE, style: Cesium.LabelStyle.FILL_AND_OUTLINE,
outlineWidth: 2, outlineWidth: 2,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM, verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffset: new Cesium.Cartesian3(0.0, 32, 0.0), pixelOffset: new Cesium.Cartesian3(0.0, 32, 0.0),
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0.0, 5000), distanceDisplayCondition: new Cesium.DistanceDisplayCondition(
0.0,
5000
),
disableDepthTestDistance: Number.POSITIVE_INFINITY, disableDepthTestDistance: Number.POSITIVE_INFINITY,
zIndex: 5000 zIndex: 5000,
}, },
billboard: { billboard: {
image: require("../../assets/images/无人机库.png"), // 图片资源路径 image: require("../../assets/images/无人机库.png"), // 图片资源路径
...@@ -285,23 +353,30 @@ export default { ...@@ -285,23 +353,30 @@ export default {
height: 60, // 图片高度(可选,单位为像素) height: 60, // 图片高度(可选,单位为像素)
eyeOffset: new Cesium.Cartesian3(0, 0, -10), // 图片与位置坐标的偏移量(可选) eyeOffset: new Cesium.Cartesian3(0, 0, -10), // 图片与位置坐标的偏移量(可选)
scale: 1, // 图片缩放比例(可选) scale: 1, // 图片缩放比例(可选)
} },
}); });
EntityList.push(apronEntity); EntityList.push(apronEntity);
let imageEntityPosition = Cesium.Cartesian3.fromDegrees(longitude, latitude, height) let imageEntityPosition = Cesium.Cartesian3.fromDegrees(
longitude,
latitude,
height
);
// 创建一个带有图片的实体 // 创建一个带有图片的实体
const imageEntity = window.$mmc_stl.viewer.entities.add({ const imageEntity = window.$mmc_stl.viewer.entities.add({
position: imageEntityPosition, // 设置图片的位置(经纬度和高度) position: imageEntityPosition, // 设置图片的位置(经纬度和高度)
label: { label: {
text: name, text: name,
font: '14pt monospace', font: "14pt monospace",
style: Cesium.LabelStyle.FILL_AND_OUTLINE, style: Cesium.LabelStyle.FILL_AND_OUTLINE,
outlineWidth: 2, outlineWidth: 2,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM, verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffset: new Cesium.Cartesian3(0.0, 32, 0.0), pixelOffset: new Cesium.Cartesian3(0.0, 32, 0.0),
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0.0, 10000), distanceDisplayCondition: new Cesium.DistanceDisplayCondition(
0.0,
10000
),
disableDepthTestDistance: Number.POSITIVE_INFINITY, disableDepthTestDistance: Number.POSITIVE_INFINITY,
zIndex: 5000 zIndex: 5000,
}, },
polyline: new Cesium.PolylineGraphics({ polyline: new Cesium.PolylineGraphics({
positions: [apronPosition, imageEntityPosition], positions: [apronPosition, imageEntityPosition],
...@@ -316,30 +391,32 @@ export default { ...@@ -316,30 +391,32 @@ export default {
height: 60, // 图片高度(可选,单位为像素) height: 60, // 图片高度(可选,单位为像素)
eyeOffset: new Cesium.Cartesian3(0, 0, -10), // 图片与位置坐标的偏移量(可选) eyeOffset: new Cesium.Cartesian3(0, 0, -10), // 图片与位置坐标的偏移量(可选)
scale: 1, // 图片缩放比例(可选) scale: 1, // 图片缩放比例(可选)
} },
}); });
EntityList.push(imageEntity); EntityList.push(imageEntity);
const polyCenter = Cesium.BoundingSphere.fromPoints([apronPosition, imageEntityPosition]).center; const polyCenter = Cesium.BoundingSphere.fromPoints([
apronPosition,
imageEntityPosition,
]).center;
console.log("PolyCenter:", polyCenter); // 调试信息 console.log("PolyCenter:", polyCenter); // 调试信息
let entityLabel = window.$mmc_stl.viewer.entities.add({ let entityLabel = window.$mmc_stl.viewer.entities.add({
position: polyCenter, position: polyCenter,
label: { label: {
text: this.activeItem.targetDistance + 'km', text: this.activeItem.targetDistance + "km",
font: '14pt monospace', font: "14pt monospace",
style: Cesium.LabelStyle.FILL_AND_OUTLINE, style: Cesium.LabelStyle.FILL_AND_OUTLINE,
outlineWidth: 4, outlineWidth: 4,
eyeOffset: new Cesium.Cartesian3(0.0, 0.0, -10), eyeOffset: new Cesium.Cartesian3(0.0, 0.0, -10),
verticalOrigin: Cesium.VerticalOrigin.BOTTOM, verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffset: new Cesium.Cartesian2(0, 0) pixelOffset: new Cesium.Cartesian2(0, 0),
}, },
}); });
EntityList.push(entityLabel); EntityList.push(entityLabel);
// 飞入到该实体位置 // 飞入到该实体位置
window.$mmc_stl.viewer.camera.flyTo({ window.$mmc_stl.viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(longitude, latitude, 20000), // 设置相机目标位置 destination: Cesium.Cartesian3.fromDegrees(longitude, latitude, 20000), // 设置相机目标位置
duration: 2 // 飞行动画持续时间(秒) duration: 2, // 飞行动画持续时间(秒)
}); });
}, },
changeFn(item) { changeFn(item) {
...@@ -384,21 +461,21 @@ export default { ...@@ -384,21 +461,21 @@ export default {
let data = this.skipList.filter((item) => item.active); let data = this.skipList.filter((item) => item.active);
if (data.length > 0) { if (data.length > 0) {
this.activeItem = data[0]; this.activeItem = data[0];
this.changeflyLogStatus(true) this.changeflyLogStatus(true);
this.dialogVisible = true; this.dialogVisible = true;
} else { } else {
this.$message.warning("请选择跳点"); this.$message.warning("请选择跳点");
} }
}, },
handleConfirm() { handleConfirm() {
this.clearEntity() this.clearEntity();
this.dialogVisible = false; this.dialogVisible = false;
}, },
handleClose() { handleClose() {
this.dialogVisible = false; this.dialogVisible = false;
this.flightHeight = 100 this.flightHeight = 100;
this.flightSpeed = 5 this.flightSpeed = 5;
this.clearEntity() this.clearEntity();
}, },
clearEntity() { clearEntity() {
if (EntityList.length > 0) { if (EntityList.length > 0) {
...@@ -406,7 +483,7 @@ export default { ...@@ -406,7 +483,7 @@ export default {
window.$mmc_stl.viewer.entities.remove(item); window.$mmc_stl.viewer.entities.remove(item);
}); });
} }
} },
}, },
created() { created() {
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
...@@ -415,7 +492,7 @@ export default { ...@@ -415,7 +492,7 @@ export default {
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.intervalId); // 清除定时器 clearInterval(this.intervalId); // 清除定时器
this.clearEntity() this.clearEntity();
}, },
}; };
</script> </script>
...@@ -429,7 +506,12 @@ export default { ...@@ -429,7 +506,12 @@ export default {
gap: 0px; gap: 0px;
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
.green {
color: green;
}
.red {
color: red;
}
.overlay { .overlay {
position: fixed; position: fixed;
top: 20%; top: 20%;
...@@ -453,12 +535,14 @@ export default { ...@@ -453,12 +535,14 @@ export default {
color: #14faff; color: #14faff;
line-height: 40px; line-height: 40px;
text-shadow: 0px 1px 1px rgba(2, 32, 56, 0.2); text-shadow: 0px 1px 1px rgba(2, 32, 56, 0.2);
background: linear-gradient(135deg, background: linear-gradient(
135deg,
#e3aa77 0%, #e3aa77 0%,
#f5cda9 38%, #f5cda9 38%,
#f9ecd3 58%, #f9ecd3 58%,
#fcdbb1 79%, #fcdbb1 79%,
#edb07a 100%); #edb07a 100%
);
-webkit-background-clip: text; -webkit-background-clip: text;
-webkit-text-fill-color: transparent; -webkit-text-fill-color: transparent;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论