From 4fb0c56fe4c98ef38bc4cfee497ff10301121d5d Mon Sep 17 00:00:00 2001
From: husq <931347610@qq.com>
Date: Mon, 09 Oct 2023 14:13:20 +0800
Subject: [PATCH] Merge branch 'demo' of http://s16s652780.51mypc.cn:49896/r/yskj/iot_drone_web into demo
---
src/types/task.ts | 4 +-
src/pages/page-web/projects/wayline.vue | 2
src/pages/page-web/projects/Firmwares.vue | 20 +++++-----
src/pages/page-web/projects/devices.vue | 4 +-
src/api/http/request.ts | 4 +-
src/components/g-map/use-drone-control-ws-event.ts | 4 +-
src/pages/page-pilot/pilot-home.vue | 6 +-
src/components/task/CreatePlan.vue | 7 +++
src/pages/page-pilot/pilot-index.vue | 4 +-
src/api/wayline.ts | 6 +++
src/components/livestream-agora.vue | 8 ++--
src/components/livestream-others.vue | 4 +-
src/pages/page-pilot/pilot-bind.vue | 2
13 files changed, 43 insertions(+), 32 deletions(-)
diff --git a/src/api/http/request.ts b/src/api/http/request.ts
index 04a9e20..773175d 100644
--- a/src/api/http/request.ts
+++ b/src/api/http/request.ts
@@ -65,11 +65,11 @@
}
// @See: https://github.com/axios/axios/issues/383
if (!err.response || !err.response.status) {
- message.error('The network is abnormal, please check the backend service and try again')
+ message.error('网络异常,请检查后端服务后重试')
return
}
if (err.response?.status !== 200) {
- message.error(`ERROR_CODE: ${err.response?.status}`)
+ message.error(`错误码: ${err.response?.status}`)
}
// if (err.response?.status === 403) {
// // window.location.href = '/'
diff --git a/src/api/wayline.ts b/src/api/wayline.ts
index 8021fa3..b6170f4 100644
--- a/src/api/wayline.ts
+++ b/src/api/wayline.ts
@@ -76,8 +76,14 @@
rth_altitude: number // 相对机场返航高度 20 - 500
out_of_control_action: OutOfControlAction // 失控动作
+
+ //重复频率类型
+ rep_fre_type?:number
+ //重复频率值
+ rep_fre_val?:number
// 重复规则值
rep_rule_val?:[]
+ rep_rule_type?:number
}
// 新增计划
export const createPlan = async function (workspaceId: string, plan: CreatePlan): Promise<IWorkspaceResponse<any>> {
diff --git a/src/components/g-map/use-drone-control-ws-event.ts b/src/components/g-map/use-drone-control-ws-event.ts
index cfcb1d3..b6282ef 100644
--- a/src/components/g-map/use-drone-control-ws-event.ts
+++ b/src/components/g-map/use-drone-control-ws-event.ts
@@ -14,12 +14,12 @@
function onControlSourceChange (data: ControlSourceChangeInfo) {
if (data.type === ControlSourceChangeType.Flight && data.sn === sn) {
droneControlSource.value = data.control_source
- message.info(`Flight control is changed to ${droneControlSource.value}`)
+ message.info(`飞行控制改为 ${droneControlSource.value}`)
return
}
if (data.type === ControlSourceChangeType.Payload && data.sn === payloadSn) {
payloadControlSource.value = data.control_source
- message.info(`Payload control is changed to ${payloadControlSource.value}.`)
+ message.info(`负载控制改为 ${payloadControlSource.value}.`)
}
}
diff --git a/src/components/livestream-agora.vue b/src/components/livestream-agora.vue
index b6ea030..63b40bc 100644
--- a/src/components/livestream-agora.vue
+++ b/src/components/livestream-agora.vue
@@ -209,7 +209,7 @@
}
// Subscribe when a remote user publishes a stream
agoraClient.on('user-joined', async (user: IAgoraRTCRemoteUser) => {
- message.info('user[' + user.uid + '] join')
+ message.info('用户[' + user.uid + '] 加入')
})
agoraClient.on('user-published', async (user: IAgoraRTCRemoteUser, mediaType: 'audio' | 'video') => {
await agoraClient.subscribe(user, mediaType)
@@ -223,7 +223,7 @@
})
agoraClient.on('user-unpublished', async (user: any) => {
console.log('unpublish live:', user)
- message.info('unpublish live')
+ message.info('取消发布')
})
agoraClient.on('exception', async (e: any) => {
console.log(e)
@@ -364,7 +364,7 @@
}
const onUpdateQuality = () => {
if (!livePara.liveState) {
- message.info('Please turn on the livestream first.')
+ message.info('请先打开直播')
return
}
setLivestreamQuality({
@@ -379,7 +379,7 @@
const onSwitch = () => {
if (dronePara.lensSelected === undefined || dronePara.lensSelected === nonSwitchable) {
- message.info('The ' + nonSwitchable + ' lens cannot be switched, please select the lens to be switched.', 8)
+ message.info('当前 ' + nonSwitchable + ' 镜头无法切换,请选择要切换的镜头', 8)
return
}
changeLivestreamLens({
diff --git a/src/components/livestream-others.vue b/src/components/livestream-others.vue
index d8b240e..771fb42 100644
--- a/src/components/livestream-others.vue
+++ b/src/components/livestream-others.vue
@@ -335,7 +335,7 @@
const onUpdateQuality = () => {
if (!liveState.value) {
- message.info('Please turn on the livestream first.')
+ message.info('请先打开直播')
return
}
setLivestreamQuality({
@@ -400,7 +400,7 @@
}
const onSwitch = () => {
if (lensSelected.value === undefined || lensSelected.value === nonSwitchable) {
- message.info('The ' + nonSwitchable + ' lens cannot be switched, please select the lens to be switched.', 8)
+ message.info('当前 ' + nonSwitchable + ' 镜头无法切换,请选择要切换的镜头', 8)
return
}
changeLivestreamLens({
diff --git a/src/components/task/CreatePlan.vue b/src/components/task/CreatePlan.vue
index 963df79..b53d588 100644
--- a/src/components/task/CreatePlan.vue
+++ b/src/components/task/CreatePlan.vue
@@ -283,6 +283,7 @@
} from '/@/types/task'
import moment, { Moment } from 'moment'
import { RuleObject } from 'ant-design-vue/es/form/interface'
+import { getFlyTimeList } from '/@/utils/jobTime'
const root = getRoot()
const store = useMyStore()
@@ -317,7 +318,6 @@
rep_fre_val: 1,
rep_fre_type: 3,
rep_rule_type: 1,
-
})
const executeTimeRepeatArr = ref([
@@ -379,6 +379,8 @@
validator: async (rule: RuleObject, value: string) => {
if (!/^[0-9]{1,}$/.test(value)) {
throw new Error('相对机场返航高度需为数字类型')
+ } else if (Number(value) < 20 || Number(value) > 500) {
+ throw new Error('返航高度需在20-500米之间')
}
},
}
@@ -496,6 +498,9 @@
if (wayline.value && wayline.value.template_types && wayline.value.template_types.length > 0) {
createPlanBody.wayline_type = wayline.value.template_types[0]
}
+
+ // getFlyTimeList(createPlanBody)
+
createPlan(workspaceId, createPlanBody)
.then(res => {
disabled.value = false
diff --git a/src/pages/page-pilot/pilot-bind.vue b/src/pages/page-pilot/pilot-bind.vue
index 0f3e9e8..4c848c2 100644
--- a/src/pages/page-pilot/pilot-bind.vue
+++ b/src/pages/page-pilot/pilot-bind.vue
@@ -43,7 +43,7 @@
}
bindDevice(bindParam).then(bindRes => {
if (bindRes.code !== 0) {
- message.error('bind failed:' + bindRes.message)
+ message.error('绑定失败:' + bindRes.message)
console.error(bindRes.message)
return
}
diff --git a/src/pages/page-pilot/pilot-home.vue b/src/pages/page-pilot/pilot-home.vue
index 0b86139..1a6c79a 100644
--- a/src/pages/page-pilot/pilot-home.vue
+++ b/src/pages/page-pilot/pilot-home.vue
@@ -264,7 +264,7 @@
}
device.data.gateway_sn = apiPilot.getRemoteControllerSN()
if (device.data.gateway_sn === EStatusValue.DISCONNECT.toString()) {
- message.warn('Data is not available, please restart the remote control.')
+ message.warn('数据不可用,请重新启动遥控器')
return
}
@@ -389,7 +389,7 @@
if (isInstalled) {
window.open('https://www.dji.com')
} else {
- message.error(packageName + ' is not installed.')
+ message.error(packageName + ' 未安装.')
}
}
@@ -481,7 +481,7 @@
}
function moduleUninstall (m: any) {
- message.info('uninstall ' + m.module)
+ message.info('卸载 ' + m.module)
apiPilot.unloadComponent(m.module)
refreshStatus()
}
diff --git a/src/pages/page-pilot/pilot-index.vue b/src/pages/page-pilot/pilot-index.vue
index d6930a0..bb1dbc9 100644
--- a/src/pages/page-pilot/pilot-index.vue
+++ b/src/pages/page-pilot/pilot-index.vue
@@ -81,7 +81,7 @@
})
const jsres = apiPilot.loadComponent(EComponentName.Api, apiPilot.getComponentParam(EComponentName.Api))
if (!jsres) {
- message.error('Failed to load api module.')
+ message.error('加载api模块失败')
return
}
apiPilot.setToken(res.data.access_token)
@@ -97,7 +97,7 @@
await login(formState)
.then(res => {
if (!isVerified.value) {
- message.error('Please verify the license firstly.')
+ message.error('请先核实许可证.')
return
}
console.log('login res:', res)
diff --git a/src/pages/page-web/projects/Firmwares.vue b/src/pages/page-web/projects/Firmwares.vue
index 54fd590..9389975 100644
--- a/src/pages/page-web/projects/Firmwares.vue
+++ b/src/pages/page-web/projects/Firmwares.vue
@@ -202,8 +202,8 @@
const rules = {
status: [{ required: true }],
- release_note: [{ required: true, message: 'Please input release note.' }],
- device_name: [{ required: true, message: 'Please select which models this firmware belongs to.' }]
+ release_note: [{ required: true, message: '请输入发行说明' }],
+ device_name: [{ required: true, message: '请选择该固件属于哪个型号' }]
}
interface FileItem {
uid: string;
@@ -221,7 +221,7 @@
function beforeUpload (file: FileItem) {
if (!file.name || !file.name?.endsWith('.zip')) {
- message.error('Format error. Please select zip file.')
+ message.error('格式错误。请选择zip文件')
return false
}
fileList.value = [file]
@@ -240,7 +240,7 @@
const uploadFile = async () => {
if (fileList.value.length === 0) {
- message.error('Please select at least one file.')
+ message.error('请选择至少一个文件')
}
let uploading: string
formRef.value.validate().then(async () => {
@@ -261,22 +261,22 @@
uploading = (file.name ?? 'uploding') + timestamp
notification.open({
key: uploading,
- message: `Uploading ${moment().format()}`,
- description: `[${file.name}] is uploading... `,
+ message: `上传中 ${moment().format()}`,
+ description: `[${file.name}] 正在上传... `,
duration: null
})
importFirmareFile(workspaceId, fileData).then((res) => {
if (res.code === 0) {
notification.success({
- message: `Uploaded ${moment().format()}`,
- description: `[${file.name}] file uploaded successfully. Duration: ${moment.duration(new Date().getTime() - timestamp).asSeconds()}`,
+ message: `上传完毕 ${moment().format()}`,
+ description: `[${file.name}] 文件上传完毕. 用时: ${moment.duration(new Date().getTime() - timestamp).asSeconds()}`,
duration: null
})
getAllFirmwares(pageParam)
} else {
notification.error({
- message: `Failed to upload [${file.name}]. Check and try again.`,
- description: `Error message: ${res.message} ${moment().format()}`,
+ message: `上传失败 [${file.name}]. 检查并重新上传`,
+ description: `错误信息: ${res.message} ${moment().format()}`,
style: { color: commonColor.FAIL },
duration: null,
})
diff --git a/src/pages/page-web/projects/devices.vue b/src/pages/page-web/projects/devices.vue
index cde515a..758ed5f 100644
--- a/src/pages/page-web/projects/devices.vue
+++ b/src/pages/page-web/projects/devices.vue
@@ -314,8 +314,8 @@
} else { // 终态:成功,失败,超时
if (status === DeviceCmdExecuteStatus.Failed || status === DeviceCmdExecuteStatus.Timeout) {
notification.error({
- message: `(${payload.sn}) Upgrade failed`,
- description: `Error Code: ${payload.result}`,
+ message: `(${payload.sn}) 升级失败`,
+ description: `错误码: ${payload.result}`,
duration: null
})
}
diff --git a/src/pages/page-web/projects/wayline.vue b/src/pages/page-web/projects/wayline.vue
index 4c773d5..77d0775 100644
--- a/src/pages/page-web/projects/wayline.vue
+++ b/src/pages/page-web/projects/wayline.vue
@@ -166,7 +166,7 @@
function deleteWayline () {
deleteWaylineFile(workspaceId.value, deleteWaylineId.value).then(res => {
if (res.code === 0) {
- message.success('Wayline file deleted')
+ message.success('文件删除成功')
}
deleteWaylineId.value = ''
deleteTip.value = false
diff --git a/src/types/task.ts b/src/types/task.ts
index 4639db0..fd0ff1a 100644
--- a/src/types/task.ts
+++ b/src/types/task.ts
@@ -18,8 +18,8 @@
export const TaskTypeOptions = [
{ value: TaskType.Immediate, label: TaskTypeMap[TaskType.Immediate] },
{ value: TaskType.Timed, label: TaskTypeMap[TaskType.Timed] },
- { value: TaskType.Repeat, label: TaskTypeMap[TaskType.Repeat] },
- { value: TaskType.Continuous, label: TaskTypeMap[TaskType.Continuous] },
+ // { value: TaskType.Repeat, label: TaskTypeMap[TaskType.Repeat] },
+ // { value: TaskType.Continuous, label: TaskTypeMap[TaskType.Continuous] },
]
// 频率类型
--
Gitblit v1.9.3