|
|
@@ -62,12 +62,11 @@
|
|
|
</a-tooltip>
|
|
|
</a-col>
|
|
|
<a-col span="20">
|
|
|
- <span
|
|
|
- :style="deviceInfo.device.mode_code === EModeCode.Disconnected ? 'color: red; font-weight: 700;' : 'color: rgb(25,190,107)'">
|
|
|
- {{ EModeCode[deviceInfo.device.mode_code] }}
|
|
|
+ <span>
|
|
|
+ 飞行状态:
|
|
|
</span>
|
|
|
<span>
|
|
|
- 飞行状态
|
|
|
+ {{ getTextByModeCode(deviceInfo.device.mode_code) }}
|
|
|
</span>
|
|
|
<div class="openLiveButton" @click="state.deviceLiveStatus = true" v-if="!state.deviceLiveStatus">
|
|
|
开启直播
|
|
|
@@ -564,6 +563,7 @@ import FlightAreaActionIcon from './flight-area/FlightAreaActionIcon.vue'
|
|
|
import { EFlightAreaType } from '../types/flight-area'
|
|
|
import { useFlightArea } from './flight-area/use-flight-area'
|
|
|
import { useFlightAreaDroneLocationEvent } from './flight-area/use-flight-area-drone-location-event'
|
|
|
+import { getTextByModeCode } from '/@/utils/index'
|
|
|
|
|
|
export default defineComponent({
|
|
|
components: {
|
|
|
@@ -858,6 +858,8 @@ export default defineComponent({
|
|
|
(req.resource.content.geometry.coordinates as GeojsonCoordinate).push((coordinates as GeojsonCoordinate)[2])
|
|
|
await postElementsReq(shareId.value, req)
|
|
|
obj.setExtData({ id: req.id, name: req.name })
|
|
|
+ const title = coordinates.slice(0, 2);
|
|
|
+ obj.setTitle(title)
|
|
|
store.state.coverMap[req.id] = [obj]
|
|
|
const map = root.$map
|
|
|
const AMap = root.$aMap
|
|
|
@@ -866,14 +868,12 @@ export default defineComponent({
|
|
|
offset: new AMap.Pixel(30, 0),
|
|
|
text: req.name,
|
|
|
style: {
|
|
|
- fontSize: 12,
|
|
|
- padding: 0,
|
|
|
backgroundColor: 'transparent',
|
|
|
borderColor: 'transparent',
|
|
|
}
|
|
|
})
|
|
|
map.add(text);
|
|
|
- store.state.coverMap[req.id + '_text'] = [text]
|
|
|
+ store.state.coverMap[req.id + '_other'] = [text]
|
|
|
obj.on('click', function () {
|
|
|
store.commit('SET_MAP_CLICK_ELEMENT', {
|
|
|
id: req.id,
|
|
|
@@ -903,14 +903,36 @@ export default defineComponent({
|
|
|
offset: new AMap.Pixel(-30, -30),
|
|
|
text: req.name,
|
|
|
style: {
|
|
|
- fontSize: 12,
|
|
|
- padding: 0,
|
|
|
backgroundColor: 'transparent',
|
|
|
borderColor: 'transparent',
|
|
|
}
|
|
|
})
|
|
|
- map.add(text);
|
|
|
- store.state.coverMap[req.id + '_text'] = [text]
|
|
|
+ const distances = [];
|
|
|
+ const paths = [...coordinatesList]
|
|
|
+ // 计算并显示每段线的距离
|
|
|
+ for (let i = 0; i < paths.length - 1; i++) {
|
|
|
+ const distance = AMap.GeometryUtil.distance(new AMap.LngLat(paths[i][0], paths[i][1]), new AMap.LngLat(paths[i + 1][0], paths[i + 1][1]));
|
|
|
+ // 计算两个点之间的中点坐标
|
|
|
+ const midLng = (paths[i][0] + paths[i + 1][0]) / 2;
|
|
|
+ const midLat = (paths[i][1] + paths[i + 1][1]) / 2;
|
|
|
+ const midPoint = new AMap.LngLat(midLng, midLat);
|
|
|
+ // 在中点位置放置文本以显示距离
|
|
|
+ const distanceText = new AMap.Text({
|
|
|
+ position: midPoint,
|
|
|
+ offset: new AMap.Pixel(-16, 10),
|
|
|
+ text: `${distance.toFixed(1)} m`,// 距离
|
|
|
+ style: {
|
|
|
+ fontSize: '10px',
|
|
|
+ color: '#FFFFFF',
|
|
|
+ backgroundColor: 'rgba(0, 0, 0, 0.75)',
|
|
|
+ borderColor: 'transparent',
|
|
|
+ },
|
|
|
+ });
|
|
|
+ distances.push(distanceText);
|
|
|
+ }
|
|
|
+ const other = [text, ...distances]
|
|
|
+ map.add([text, ...distances]);
|
|
|
+ store.state.coverMap[req.id + '_other'] = other;
|
|
|
obj.on('click', function () {
|
|
|
store.commit('SET_MAP_CLICK_ELEMENT', {
|
|
|
id: req.id,
|
|
|
@@ -940,14 +962,37 @@ export default defineComponent({
|
|
|
offset: new AMap.Pixel(0, -30),
|
|
|
text: req.name,
|
|
|
style: {
|
|
|
- fontSize: 12,
|
|
|
- padding: 0,
|
|
|
backgroundColor: 'transparent',
|
|
|
borderColor: 'transparent',
|
|
|
}
|
|
|
})
|
|
|
- map.add(text);
|
|
|
- store.state.coverMap[req.id + '_text'] = [text]
|
|
|
+ const distances = [];
|
|
|
+ // 确保首尾相连
|
|
|
+ const paths = [...coordinatesList, coordinatesList[0]]
|
|
|
+ // 计算并显示每段线的距离
|
|
|
+ for (let i = 0; i < paths.length - 1; i++) {
|
|
|
+ const distance = AMap.GeometryUtil.distance(new AMap.LngLat(paths[i][0], paths[i][1]), new AMap.LngLat(paths[i + 1][0], paths[i + 1][1]));
|
|
|
+ // 计算两个点之间的中点坐标
|
|
|
+ const midLng = (paths[i][0] + paths[i + 1][0]) / 2;
|
|
|
+ const midLat = (paths[i][1] + paths[i + 1][1]) / 2;
|
|
|
+ const midPoint = new AMap.LngLat(midLng, midLat);
|
|
|
+ // 在中点位置放置文本以显示距离
|
|
|
+ const distanceText = new AMap.Text({
|
|
|
+ position: midPoint,
|
|
|
+ offset: new AMap.Pixel(-16, 10),
|
|
|
+ text: `${distance.toFixed(1)} m`,// 距离
|
|
|
+ style: {
|
|
|
+ fontSize: '10px',
|
|
|
+ color: '#FFFFFF',
|
|
|
+ backgroundColor: 'rgba(0, 0, 0, 0.75)',
|
|
|
+ borderColor: 'transparent',
|
|
|
+ },
|
|
|
+ });
|
|
|
+ distances.push(distanceText);
|
|
|
+ }
|
|
|
+ const other = [text, ...distances]
|
|
|
+ map.add([text, ...distances]);
|
|
|
+ store.state.coverMap[req.id + '_other'] = other;
|
|
|
obj.on('click', function () {
|
|
|
store.commit('SET_MAP_CLICK_ELEMENT', {
|
|
|
id: req.id,
|
|
|
@@ -1066,6 +1111,7 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return {
|
|
|
draw,
|
|
|
mouseMode,
|
|
|
@@ -1094,6 +1140,7 @@ export default defineComponent({
|
|
|
closeLivestreamAgora,
|
|
|
qualityStyle,
|
|
|
selectFlightAreaAction,
|
|
|
+ getTextByModeCode,
|
|
|
}
|
|
|
}
|
|
|
})
|