Browse Source

Merge branch 'v1.8.0'

pull/22/head
sean.zhou 1 year ago
parent
commit
42854e4db7
  1. 3
      README.md
  2. 17
      src/components/GMap.vue
  3. 4
      src/components/devices/device-log/DeviceLogUploadRecordDrawer.vue
  4. 6
      src/components/task/CreatePlan.vue
  5. 2
      src/pages/page-web/projects/dock.vue
  6. 6
      src/pages/page-web/projects/wayline.vue
  7. 5
      src/types/device-firmware.ts
  8. 47
      src/types/device.ts

3
README.md

@ -14,9 +14,8 @@ For more documentation, please visit the [DJI Developer Documentation](https://d
## Latest Release ## Latest Release
Cloud API 1.1.0 was released on 22 July 2022. For more information, please visit the [Release Note](https://developer.dji.com/doc/cloud-api-tutorial/cn/). Cloud API 1.8.0 was released on 11 Dec 2023. For more information, please visit the [Release Note](https://developer.dji.com/doc/cloud-api-tutorial/cn/).
## License ## License
Cloud API is MIT-licensed. Please refer to the LICENSE file for more information. Cloud API is MIT-licensed. Please refer to the LICENSE file for more information.

17
src/components/GMap.vue

@ -185,8 +185,7 @@
<a-row> <a-row>
<a-col span="6"> <a-col span="6">
<a-tooltip title="Network State"> <a-tooltip title="Network State">
<span :style="deviceInfo.dock.basic_osd?.network_state?.type === NetworkStateTypeEnum.ETHERNET || deviceInfo.dock.basic_osd?.network_state?.quality === NetworkStateQualityEnum.GOOD ? <span :style="qualityStyle">
'color: #00ee8b' : deviceInfo.dock.basic_osd?.network_state?.quality === NetworkStateQualityEnum.MEDIUM ? 'color: yellow' : 'color: red'">
<span v-if="deviceInfo.dock.basic_osd?.network_state?.type === NetworkStateTypeEnum.FOUR_G"><SignalFilled /></span> <span v-if="deviceInfo.dock.basic_osd?.network_state?.type === NetworkStateTypeEnum.FOUR_G"><SignalFilled /></span>
<span v-else><GlobalOutlined /></span> <span v-else><GlobalOutlined /></span>
</span> </span>
@ -558,7 +557,16 @@ export default defineComponent({
const osdVisible = computed(() => { const osdVisible = computed(() => {
return store.state.osdVisible return store.state.osdVisible
}) })
const qualityStyle = computed(() => {
if (deviceInfo.dock.basic_osd?.network_state?.type === NetworkStateTypeEnum.ETHERNET ||
(deviceInfo.dock.basic_osd?.network_state?.quality || 0) > NetworkStateQualityEnum.FAIR) {
return 'color: #00ee8b'
}
if ((deviceInfo.dock.basic_osd?.network_state?.quality || 0) === NetworkStateQualityEnum.FAIR) {
return 'color: yellow'
}
return 'color: red'
})
watch(() => store.state.deviceStatusEvent, watch(() => store.state.deviceStatusEvent,
data => { data => {
if (Object.keys(data.deviceOnline).length !== 0) { if (Object.keys(data.deviceOnline).length !== 0) {
@ -872,7 +880,8 @@ export default defineComponent({
RainfallEnum, RainfallEnum,
DroneInDockEnum, DroneInDockEnum,
closeLivestreamOthers, closeLivestreamOthers,
closeLivestreamAgora closeLivestreamAgora,
qualityStyle,
} }
} }
}) })

4
src/components/devices/device-log/DeviceLogUploadRecordDrawer.vue

@ -21,8 +21,8 @@
<!-- 设备类型 --> <!-- 设备类型 -->
<template #device_type="{ record }"> <template #device_type="{ record }">
<div> <div>
<div v-if="getDeviceInfo(record).parents && getDeviceInfo(record).parents.length > 0">{{ DEVICE_NAME[getDeviceInfo(record).parents[0].device_model.key]}}</div> <div v-if="getDeviceInfo(record).parents && getDeviceInfo(record).parents.length > 0">{{ DEVICE_NAME[getDeviceInfo(record).parents[0].device_model.device_model_key]}}</div>
<div v-if="getDeviceInfo(record).hosts && getDeviceInfo(record).hosts.length > 0">{{ DEVICE_NAME[getDeviceInfo(record).hosts[0].device_model.key]}}</div> <div v-if="getDeviceInfo(record).hosts && getDeviceInfo(record).hosts.length > 0">{{ DEVICE_NAME[getDeviceInfo(record).hosts[0].device_model.device_model_key]}}</div>
</div> </div>
</template> </template>
<!-- 设备sn --> <!-- 设备sn -->

6
src/components/task/CreatePlan.vue

@ -30,10 +30,10 @@
</div> </div>
<div class="ml10 mt5" style="color: hsla(0,0%,100%,0.65);"> <div class="ml10 mt5" style="color: hsla(0,0%,100%,0.65);">
<span><RocketOutlined /></span> <span><RocketOutlined /></span>
<span class="ml5">{{ Object.keys(EDeviceType)[Object.values(EDeviceType).indexOf(wayline.drone_model_key)] }}</span> <span class="ml5">{{ DEVICE_NAME[wayline.drone_model_key] }}</span>
<span class="ml10"><CameraFilled style="border-top: 1px solid; padding-top: -3px;" /></span> <span class="ml10"><CameraFilled style="border-top: 1px solid; padding-top: -3px;" /></span>
<span class="ml5" v-for="payload in wayline.payload_model_keys" :key="payload.id"> <span class="ml5" v-for="payload in wayline.payload_model_keys" :key="payload.id">
{{ Object.keys(EDeviceType)[Object.values(EDeviceType).indexOf(payload)] }} {{ DEVICE_NAME[payload] }}
</span> </span>
</div> </div>
<div class="mt5 ml10" style="color: hsla(0,0%,100%,0.35);"> <div class="mt5 ml10" style="color: hsla(0,0%,100%,0.35);">
@ -162,7 +162,7 @@ import { CloseOutlined, RocketOutlined, CameraFilled, UserOutlined, PlusCircleOu
import { ELocalStorageKey, ERouterName } from '/@/types' import { ELocalStorageKey, ERouterName } from '/@/types'
import { useMyStore } from '/@/store' import { useMyStore } from '/@/store'
import { WaylineType, WaylineFile } from '/@/types/wayline' import { WaylineType, WaylineFile } from '/@/types/wayline'
import { Device, EDeviceType } from '/@/types/device' import { Device, DEVICE_NAME } from '/@/types/device'
import { createPlan, CreatePlan } from '/@/api/wayline' import { createPlan, CreatePlan } from '/@/api/wayline'
import { getRoot } from '/@/root' import { getRoot } from '/@/root'
import { TaskType, OutOfControlActionOptions, OutOfControlAction, TaskTypeOptions } from '/@/types/task' import { TaskType, OutOfControlActionOptions, OutOfControlAction, TaskTypeOptions } from '/@/types/task'

2
src/pages/page-web/projects/dock.vue

@ -37,7 +37,7 @@ import { onMounted, ref } from 'vue'
import { deleteWaylineFile, downloadWaylineFile, getWaylineFiles } from '/@/api/wayline' import { deleteWaylineFile, downloadWaylineFile, getWaylineFiles } from '/@/api/wayline'
import { EDeviceTypeName, ELocalStorageKey } from '/@/types' import { EDeviceTypeName, ELocalStorageKey } from '/@/types'
import { EllipsisOutlined, RocketOutlined, CameraFilled, UserOutlined } from '@ant-design/icons-vue' import { EllipsisOutlined, RocketOutlined, CameraFilled, UserOutlined } from '@ant-design/icons-vue'
import { Device, EDeviceType } from '/@/types/device' import { Device } from '/@/types/device'
import { useMyStore } from '/@/store' import { useMyStore } from '/@/store'
import { getBindingDevices } from '/@/api/manage' import { getBindingDevices } from '/@/api/manage'
import { IPage } from '/@/api/http/type' import { IPage } from '/@/api/http/type'

6
src/pages/page-web/projects/wayline.vue

@ -52,10 +52,10 @@
</div> </div>
<div class="ml10 mt5" style="color: hsla(0,0%,100%,0.65);"> <div class="ml10 mt5" style="color: hsla(0,0%,100%,0.65);">
<span><RocketOutlined /></span> <span><RocketOutlined /></span>
<span class="ml5">{{ Object.keys(EDeviceType)[Object.values(EDeviceType).indexOf(wayline.drone_model_key)] }}</span> <span class="ml5">{{ DEVICE_NAME[wayline.drone_model_key] }}</span>
<span class="ml10"><CameraFilled style="border-top: 1px solid; padding-top: -3px;" /></span> <span class="ml10"><CameraFilled style="border-top: 1px solid; padding-top: -3px;" /></span>
<span class="ml5" v-for="payload in wayline.payload_model_keys" :key="payload.id"> <span class="ml5" v-for="payload in wayline.payload_model_keys" :key="payload.id">
{{ Object.keys(EDeviceType)[Object.values(EDeviceType).indexOf(payload)] }} {{ DEVICE_NAME[payload] }}
</span> </span>
</div> </div>
<div class="mt5 ml10" style="color: hsla(0,0%,100%,0.35);"> <div class="mt5 ml10" style="color: hsla(0,0%,100%,0.35);">
@ -87,7 +87,7 @@ import { onMounted, onUpdated, ref } from 'vue'
import { deleteWaylineFile, downloadWaylineFile, getWaylineFiles, importKmzFile } from '/@/api/wayline' import { deleteWaylineFile, downloadWaylineFile, getWaylineFiles, importKmzFile } from '/@/api/wayline'
import { ELocalStorageKey, ERouterName } from '/@/types' import { ELocalStorageKey, ERouterName } from '/@/types'
import { EllipsisOutlined, RocketOutlined, CameraFilled, UserOutlined, SelectOutlined } from '@ant-design/icons-vue' import { EllipsisOutlined, RocketOutlined, CameraFilled, UserOutlined, SelectOutlined } from '@ant-design/icons-vue'
import { EDeviceType } from '/@/types/device' import { DEVICE_NAME } from '/@/types/device'
import { useMyStore } from '/@/store' import { useMyStore } from '/@/store'
import { WaylineFile } from '/@/types/wayline' import { WaylineFile } from '/@/types/wayline'
import { downloadFile } from '/@/utils/common' import { downloadFile } from '/@/utils/common'

5
src/types/device-firmware.ts

@ -30,6 +30,9 @@ export interface FirmwareUploadParam {
export enum DeviceNameEnum { export enum DeviceNameEnum {
DJI_DOCK = 'DJI Dock', DJI_DOCK = 'DJI Dock',
DJI_DOCK2 = 'DJI Dock2',
MATRICE_30 = 'Matrice 30', MATRICE_30 = 'Matrice 30',
MATRICE_30T = 'Matrice 30T' MATRICE_30T = 'Matrice 30T',
M3D = 'M3D',
M3TD = 'M3TD',
} }

47
src/types/device.ts

@ -24,6 +24,7 @@ export enum DRONE_TYPE {
M300 = 60, M300 = 60,
Mavic3EnterpriseAdvanced = 77, Mavic3EnterpriseAdvanced = 77,
M350 = 89, M350 = 89,
M3D = 91,
} }
// DJI负载类型枚举值 // DJI负载类型枚举值
@ -43,6 +44,8 @@ export enum PAYLOAD_TYPE {
M3E = 66, M3E = 66,
M3T = 67, M3T = 67,
M3D = 80,
M3TD = 81,
// UNKNOWN = 65535 // UNKNOWN = 65535
} }
@ -56,6 +59,7 @@ export enum RC_TYPE {
// DOCK type // DOCK type
export enum DOCK_TYPE { export enum DOCK_TYPE {
Dock = 1, Dock = 1,
Dock2 = 2,
} }
// 设备sub_type 从0升序 // 设备sub_type 从0升序
@ -77,6 +81,9 @@ export const DEVICE_MODEL_KEY = {
M300: `${DOMAIN.DRONE}-${DRONE_TYPE.M300}-${DEVICE_SUB_TYPE.ZERO}`, M300: `${DOMAIN.DRONE}-${DRONE_TYPE.M300}-${DEVICE_SUB_TYPE.ZERO}`,
M350: `${DOMAIN.DRONE}-${DRONE_TYPE.M350}-${DEVICE_SUB_TYPE.ZERO}`, M350: `${DOMAIN.DRONE}-${DRONE_TYPE.M350}-${DEVICE_SUB_TYPE.ZERO}`,
M3D: `${DOMAIN.DRONE}-${DRONE_TYPE.M3D}-${DEVICE_SUB_TYPE.ZERO}`,
M3TD: `${DOMAIN.DRONE}-${DRONE_TYPE.M3D}-${DEVICE_SUB_TYPE.ONE}`,
FPV: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.FPV}-${DEVICE_SUB_TYPE.ZERO}`, FPV: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.FPV}-${DEVICE_SUB_TYPE.ZERO}`,
H20: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.H20}-${DEVICE_SUB_TYPE.ZERO}`, H20: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.H20}-${DEVICE_SUB_TYPE.ZERO}`,
H20T: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.H20T}-${DEVICE_SUB_TYPE.ZERO}`, H20T: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.H20T}-${DEVICE_SUB_TYPE.ZERO}`,
@ -88,6 +95,8 @@ export const DEVICE_MODEL_KEY = {
M3ECamera: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.M3E}-${DEVICE_SUB_TYPE.ZERO}`, M3ECamera: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.M3E}-${DEVICE_SUB_TYPE.ZERO}`,
M3TCamera: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.M3T}-${DEVICE_SUB_TYPE.ZERO}`, M3TCamera: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.M3T}-${DEVICE_SUB_TYPE.ZERO}`,
M3DCamera: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.M3D}-${DEVICE_SUB_TYPE.ZERO}`,
M3TDCamera: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.M3TD}-${DEVICE_SUB_TYPE.ZERO}`,
// M3MCamera: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.M3M}-${DEVICE_SUB_TYPE.ZERO}`, // M3MCamera: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.M3M}-${DEVICE_SUB_TYPE.ZERO}`,
XT2: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.XT2}-${DEVICE_SUB_TYPE.ZERO}`, XT2: `${DOMAIN.PAYLOAD}-${PAYLOAD_TYPE.XT2}-${DEVICE_SUB_TYPE.ZERO}`,
@ -99,6 +108,7 @@ export const DEVICE_MODEL_KEY = {
RCPlus: `${DOMAIN.RC}-${RC_TYPE.RCPlus}-${DEVICE_SUB_TYPE.ZERO}`, RCPlus: `${DOMAIN.RC}-${RC_TYPE.RCPlus}-${DEVICE_SUB_TYPE.ZERO}`,
Dock: `${DOMAIN.DOCK}-${DOCK_TYPE.Dock}-${DEVICE_SUB_TYPE.ZERO}`, Dock: `${DOMAIN.DOCK}-${DOCK_TYPE.Dock}-${DEVICE_SUB_TYPE.ZERO}`,
Dock2: `${DOMAIN.DOCK}-${DOCK_TYPE.Dock2}-${DEVICE_SUB_TYPE.ZERO}`,
} }
export const DEVICE_NAME = { export const DEVICE_NAME = {
@ -110,6 +120,8 @@ export const DEVICE_NAME = {
// [DEVICE_MODEL_KEY.M3M]: 'Mavic 3M', // [DEVICE_MODEL_KEY.M3M]: 'Mavic 3M',
[DEVICE_MODEL_KEY.M300]: 'M300 RTK', [DEVICE_MODEL_KEY.M300]: 'M300 RTK',
[DEVICE_MODEL_KEY.M350]: 'M350 RTK', [DEVICE_MODEL_KEY.M350]: 'M350 RTK',
[DEVICE_MODEL_KEY.M3D]: 'M3D',
[DEVICE_MODEL_KEY.M3TD]: 'M3TD',
// payload // payload
[DEVICE_MODEL_KEY.FPV]: 'FPV', [DEVICE_MODEL_KEY.FPV]: 'FPV',
@ -127,6 +139,8 @@ export const DEVICE_NAME = {
[DEVICE_MODEL_KEY.XTS]: 'XTS', [DEVICE_MODEL_KEY.XTS]: 'XTS',
[DEVICE_MODEL_KEY.Z30]: 'Z30', [DEVICE_MODEL_KEY.Z30]: 'Z30',
[DEVICE_MODEL_KEY.DockTopCamera]: 'Dock Camera', [DEVICE_MODEL_KEY.DockTopCamera]: 'Dock Camera',
[DEVICE_MODEL_KEY.M3DCamera]: 'M3D Camera',
[DEVICE_MODEL_KEY.M3TDCamera]: 'M3TD Camera',
// rc // rc
[DEVICE_MODEL_KEY.RC]: 'RC', [DEVICE_MODEL_KEY.RC]: 'RC',
@ -134,6 +148,7 @@ export const DEVICE_NAME = {
// dock // dock
[DEVICE_MODEL_KEY.Dock]: 'Dock', [DEVICE_MODEL_KEY.Dock]: 'Dock',
[DEVICE_MODEL_KEY.Dock2]: 'Dock2',
} }
// 控制权 // 控制权
@ -293,9 +308,12 @@ export enum NetworkStateTypeEnum {
} }
export enum NetworkStateQualityEnum { export enum NetworkStateQualityEnum {
BAD = 0, NO_SIGNAL = 0,
MEDIUM = 1, BAD = 1,
GOOD = 2 POOR = 2,
FAIR = 3,
GOOD = 4,
EXCELLENT = 5,
} }
export enum RainfallEnum { export enum RainfallEnum {
@ -463,29 +481,6 @@ export enum EGear {
T T
} }
export enum EDeviceType {
M30 = '0-67-0' as any,
M30T = '0-67-1' as any,
M300 = '0-60-0' as any,
M350 = DEVICE_MODEL_KEY.M350 as any,
Z30 = '1-20-0' as any,
XT2 = '1-26-0' as any,
FPV = '1-39-0' as any,
XTS = '1-41-0' as any,
H20 = '1-42-0' as any,
H20T = '1-43-0' as any,
P1 = '1-50-65535' as any,
M30_Camera = '1-52-0' as any,
M30T_Camera = '1-53-0' as any,
H20N = '1-61-0' as any,
DJI_Dock_Camera = '1-165-0' as any,
L1 = '1-90742-0' as any,
M3E = '0-77-0' as any,
M3D = '0-77-1' as any,
M3E_Camera = '1-66-0' as any,
M3T_Camera = '1-67-0' as any,
}
export enum EDockModeCode { export enum EDockModeCode {
Disconnected = -1, Disconnected = -1,
Idle, Idle,

Loading…
Cancel
Save