Browse Source

Merge remote-tracking branch 'origin/master'

S0025136190 1 year ago
parent
commit
0003f6d320

+ 2 - 0
Backend/sample/src/main/java/com/dji/sample/manage/model/dto/UpstreamDeviceDTO.java

@@ -39,4 +39,6 @@ public class UpstreamDeviceDTO {
 
     private String statusText;
 
+    private String childSn;
+
 }

+ 1 - 1
Backend/sample/src/main/java/com/dji/sample/manage/service/impl/DeviceServiceImpl.java

@@ -804,7 +804,7 @@ public class DeviceServiceImpl implements IDeviceService {
                 upstreamDeviceDTO.setNickName(device.getNickname());
                 upstreamDeviceDTO.setDeviceName(device.getDeviceName());
                 upstreamDeviceDTO.setPayload(device.getDomain()+"-"+device.getDeviceType()+"-"+device.getSubType());
-
+                upstreamDeviceDTO.setChildSn(device.getChildSn());
                 DeviceDTO deviceDTO = new DeviceDTO();
                 deviceDTO.setDeviceSn(device.getDeviceSn());
                 getDeviceStatus(deviceDTO);

+ 0 - 4
Web/src/components/GMap.vue

@@ -77,7 +77,6 @@ import satelliteSrc from '/@/assets/icons/satellite.png'
 import { EDeviceTypeName, ELocalStorageKey } from '../types'
 import { EFlightAreaType } from '../types/flight-area'
 import { useFlightArea } from './flight-area/use-flight-area'
-import { useConnectMqtt } from './g-map/use-connect-mqtt'
 import { useFlightAreaDroneLocationEvent } from './flight-area/use-flight-area-drone-location-event'
 import { DeviceOsd, DeviceStatus, DockOsd, EModeCode, GatewayOsd } from '/@/types/device'
 
@@ -276,9 +275,6 @@ export default defineComponent({
       useMouseToolHook.mouseTool(type, getDrawCallback, flightAreaType)
     }
 
-    // 连接或断开drc
-    useConnectMqtt()
-
     onMounted(() => {
       const app = getApp()
       useGMapManageHook.globalPropertiesConfig(app)

+ 2 - 2
Web/src/components/airport/components/InfoModal.vue

@@ -429,7 +429,7 @@ const airworthiness = computed(() => {
   const info = props.deviceInfo?.dock?.basic_osd;
   if (info) {
     const { rainfall, wind_speed } = info;
-    if (rainfall === 3) {
+    if ([2, 3].includes(rainfall)) {
       return false;
     }
     if (wind_speed > 8) {
@@ -526,7 +526,7 @@ const windSpeed = computed(() => {
     if (info.wind_speed === '--') {
       return info.wind_speed;
     } else {
-      return (info.wind_speed / 10).toFixed(2) + ' m/s';
+      return info.wind_speed.toFixed(2) + ' m/s';
     }
   } else {
     return 0 + ' m/s';

+ 13 - 0
Web/src/components/g-map/DroneControlPanel.vue

@@ -356,6 +356,12 @@ function onShowFlyToPopover() {
   flyToPointPopoverData.latitude = null
   flyToPointPopoverData.longitude = null
   flyToPointPopoverData.height = null
+
+  const info = props.deviceInfo?.dock?.basic_osd;
+  if (info) {
+    flyToPointPopoverData.latitude = info.latitude;
+    flyToPointPopoverData.longitude = info.longitude;
+  }
 }
 
 async function onFlyToConfirm(confirm: boolean) {
@@ -407,6 +413,7 @@ function onShowTakeoffToPointPopover() {
   takeoffToPointPopoverData.loading = false
   takeoffToPointPopoverData.latitude = null
   takeoffToPointPopoverData.longitude = null
+  takeoffToPointPopoverData.height = null
   takeoffToPointPopoverData.securityTakeoffHeight = null
   takeoffToPointPopoverData.rthAltitude = null
   takeoffToPointPopoverData.rcLostAction = LostControlActionInCommandFLight.RETURN_HOME
@@ -415,6 +422,12 @@ function onShowTakeoffToPointPopover() {
   takeoffToPointPopoverData.commanderModeLostAction = ECommanderModeLostAction.CONTINUE
   takeoffToPointPopoverData.commanderFlightMode = ECommanderFlightMode.SETTING
   takeoffToPointPopoverData.commanderFlightHeight = null
+
+  const info = props.deviceInfo?.dock?.basic_osd;
+  if (info) {
+    takeoffToPointPopoverData.latitude = info.latitude;
+    takeoffToPointPopoverData.longitude = info.longitude;
+  }
 }
 
 async function onTakeoffToPointConfirm(confirm: boolean) {

+ 1 - 1
Web/src/components/onLineDevice/components/InfoModal.vue

@@ -305,7 +305,7 @@ const windSpeed = computed(() => {
     if (info.wind_speed === '--') {
       return info.wind_speed;
     } else {
-      return (info.wind_speed / 10).toFixed(2) + ' m/s';
+      return info.wind_speed.toFixed(2) + ' m/s';
     }
   } else {
     return 0 + ' m/s';

+ 16 - 2
Web/src/pages/page-web/projects/media/detail/components/FileInfo.vue

@@ -140,7 +140,7 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, reactive, onMounted } from 'vue';
+import { ref, reactive, onMounted, nextTick } from 'vue';
 import { message } from 'ant-design-vue';
 import { CloseOutlined, EnvironmentOutlined, DownloadOutlined, AimOutlined, VerticalRightOutlined, VerticalLeftOutlined } from '@ant-design/icons-vue';
 import Panoramic from '/@/components/panoramic/index.vue';
@@ -191,6 +191,19 @@ const contentRef = ref();
 // 高德地图Hook
 const AmapHook = useGMapManage();
 
+const scrollToSelected = () => {
+  nextTick(() => {
+    const selectedElement = contentRef.value.querySelector('.fileInfo-previewList-content-item-selected');
+    if (selectedElement) {
+      const container = contentRef.value;
+      const containerRect = container.getBoundingClientRect();
+      const selectedRect = selectedElement.getBoundingClientRect();
+      const scrollLeft = selectedRect.left - containerRect.left - container.offsetWidth / 2 + selectedRect.width / 2;
+      container.scrollLeft = scrollLeft;
+    }
+  });
+};
+
 const init = async () => {
   try {
     const res = await apis.fetchFileDetail(getWorkspaceId(), state.currentId);
@@ -232,7 +245,8 @@ const init = async () => {
 }
 
 onMounted(async () => {
-  await init()
+  await init();
+  scrollToSelected()
 })
 
 // 点击下载

+ 1 - 1
Web/src/pages/page-web/projects/media/detail/index.vue

@@ -133,7 +133,7 @@ const paginationConfig = reactive({
   pageSizeOptions: ['20', '50', '100'],
   showQuickJumper: true,
   showSizeChanger: true,
-  pageSize: 20,
+  pageSize: 100,
   current: 1,
   total: 0,
   onChange: async (current: number) => {

+ 4 - 0
Web/src/pages/page-web/projects/workspace.vue

@@ -20,6 +20,10 @@ import { EBizCode } from '/@/types'
 import { useMyStore } from '/@/store'
 import { useConnectWebSocket } from '/@/hooks/use-connect-websocket'
 import EventBus from '/@/event-bus'
+import { useConnectMqtt } from '/@/components/g-map/use-connect-mqtt'
+
+// 连接或断开drc
+useConnectMqtt()
 
 const store = useMyStore()
 

+ 5 - 5
Web/src/utils/download.ts

@@ -3,7 +3,7 @@
  * @param url
  * @returns
  */
-export function urlToImage (url: string) {
+export function urlToImage(url: string) {
   return new Promise<HTMLImageElement>((resolve, reject) => {
     const image = new Image()
     image.src = url
@@ -16,8 +16,8 @@ export interface CompressImageData {
   blob: Blob | null;
   imageData: ImageData;
 }
-export function compressImage (imgToCompress: HTMLImageElement, targetWidth: number, targetHeight: number): Promise<CompressImageData> | undefined {
-  // resizing the image
+
+export function compressImage(imgToCompress: HTMLImageElement, targetWidth: number, targetHeight: number): Promise<CompressImageData> | undefined {
   const canvas = document.createElement('canvas')
   const context = canvas.getContext('2d')
   if (context) {
@@ -68,7 +68,7 @@ export function compressImage (imgToCompress: HTMLImageElement, targetWidth: num
  * @param url
  * @param fileName
  */
-export function download (url: string, fileName = ''): void {
+export function download(url: string, fileName = ''): void {
   const aLink = document.createElement('a')
   aLink.style.display = 'none'
   aLink.download = fileName
@@ -79,4 +79,4 @@ export function download (url: string, fileName = ''): void {
   aLink.click()
   document.body.removeChild(aLink)
   // aLink.remove()
-}
+}