From 3667807a7b7418efc090ee3fa6a6b734bc3080bf Mon Sep 17 00:00:00 2001
From: xieb <vip_xiaobin810@163.com>
Date: Wed, 13 Sep 2023 20:36:29 +0800
Subject: [PATCH] Merge branch 'develop' of http://s16s652780.51mypc.cn:49896/r/yskj/iot_drone_web into develop

---
 src/types/device-cmd.ts |  103 +++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 95 insertions(+), 8 deletions(-)

diff --git a/src/types/device-cmd.ts b/src/types/device-cmd.ts
index 1230881..c1e545d 100644
--- a/src/types/device-cmd.ts
+++ b/src/types/device-cmd.ts
@@ -1,3 +1,4 @@
+import { AlarmModeEnum, BatteryStoreModeEnum, DroneBatteryModeEnum, LinkWorkModeEnum } from '/@/types/airport-tsa'
 // 机场指令集
 export enum DeviceCmd {
   // 简单指令
@@ -19,7 +20,13 @@
   PutterClose = 'putter_close', // 推杆闭合
   ChargeOpen = 'charge_open', // 打开充电
   ChargeClose = 'charge_close', // 关闭充电
+  AlarmStateSwitch = 'alarm_state_switch', // 机场声光报警
+  BatteryStoreModeSwitch = 'battery_store_mode_switch', // 电池保养
+  DroneBatteryModeSwitch = 'battery_maintenance_switch', // 飞行器电池保养
+  SdrWorkModeSwitch = 'sdr_workmode_switch', // 增强图传
 }
+
+export type DeviceCmdItemAction = AlarmModeEnum | BatteryStoreModeEnum | DroneBatteryModeEnum | LinkWorkModeEnum
 
 export interface DeviceCmdItem{
   label: string, // 标题
@@ -27,9 +34,21 @@
   operateText: string, // 按钮文字
   cmdKey: DeviceCmd, // 请求指令
   oppositeCmdKey?: DeviceCmd, // 相反状态指令
+  action?: DeviceCmdItemAction, // 参数
   func: string, // 处理函数
   loading: boolean // 按钮loading
+  disabled?: boolean // 按钮disabled
 }
+export const noDebugCmdList: DeviceCmdItem[] = [
+  {
+    label: 'Return Home',
+    status: '--',
+    operateText: 'Return Home',
+    cmdKey: DeviceCmd.ReturnHome,
+    func: 'returnHome',
+    loading: false,
+  },
+]
 
 // 机场指令
 export const cmdList: DeviceCmdItem[] = [
@@ -82,14 +101,6 @@
     loading: false,
   },
   {
-    label: '一键返航',
-    status: '--',
-    operateText: '返航',
-    cmdKey: DeviceCmd.ReturnHome,
-    func: 'returnHome',
-    loading: false,
-  },
-  {
     label: '机场存储',
     status: '--',
     operateText: '格式化',
@@ -112,6 +123,43 @@
     cmdKey: DeviceCmd.SupplementLightOpen,
     oppositeCmdKey: DeviceCmd.SupplementLightClose,
     func: 'supplementLightStatus',
+    loading: false,
+  },
+  {
+    label: '机场声光报警',
+    status: '关',
+    operateText: '打开',
+    cmdKey: DeviceCmd.AlarmStateSwitch,
+    action: AlarmModeEnum.OPEN,
+    func: 'alarmState',
+    loading: false,
+  },
+  {
+    label: '机场电池存储模式',
+    status: '计划',
+    operateText: '应急',
+    cmdKey: DeviceCmd.BatteryStoreModeSwitch,
+    action: BatteryStoreModeEnum.BATTERY_EMERGENCY_STORE,
+    func: 'batteryStoreMode',
+    loading: false,
+  },
+  {
+    label: '飞机电池保养',
+    status: '--',
+    operateText: '保养',
+    cmdKey: DeviceCmd.DroneBatteryModeSwitch,
+    action: DroneBatteryModeEnum.OPEN,
+    func: 'droneBatteryMode',
+    loading: false,
+    disabled: true,
+  },
+  {
+    label: '4g 增强',
+    status: '--',
+    operateText: '开启',
+    cmdKey: DeviceCmd.SdrWorkModeSwitch,
+    action: LinkWorkModeEnum.FourG_FUSION_MODE,
+    func: 'sdrWorkMode',
     loading: false,
   },
 ]
@@ -176,6 +224,42 @@
   DeviceSupplementLightCloseText = '关闭中...',
   DeviceSupplementLightCloseFailedText = '开',
   DeviceSupplementLightCloseBtnText = '打开',
+
+  AlarmStateOpenNormalText = '开',
+  AlarmStateOpenText = '开启中...',
+  AlarmStateOpenFailedText = '关',
+  AlarmStateOpenBtnText = '关闭',
+
+  AlarmStateCloseNormalText = '关',
+  AlarmStateCloseText = '关闭中...',
+  AlarmStateCloseFailedText = '开',
+  AlarmStateCloseBtnText = '打开',
+
+  BatteryStoreModePlanNormalText = '计划',
+  BatteryStoreModePlanText = '切换中...',
+  BatteryStoreModePlanFailedText = '应急',
+  BatteryStoreModePlanBtnText = '应急',
+
+  BatteryStoreModeEmergencyNormalText = '应急',
+  BatteryStoreModeEmergencyText = '切换中...',
+  BatteryStoreModeEmergencyFailedText = '计划',
+  BatteryStoreModeEmergencyBtnText = '计划',
+
+  DroneBatteryModeMaintenanceInProgressText = '保养中',
+  DroneBatteryModeMaintenanceNotNeedText = '无需保养',
+  DroneBatteryModeMaintenanceNeedText = '需保养',
+  DroneBatteryModeOpenBtnText = '保养',
+  DroneBatteryModeCloseBtnText = '关闭保养',
+
+  SdrWorkModeFourGOpenNormalText = '开',
+  SdrWorkModeFourGOpenText = '开启中...',
+  SdrWorkModeFourGOpenFailedText = '--',
+  SdrWorkModeFourGOpenBtnText = '关闭',
+
+  SdrWorkModeFourGCloseNormalText = '--',
+  SdrWorkModeFourGCloseText = '关闭中...',
+  SdrWorkModeFourGCloseFailedText = '开',
+  SdrWorkModeFourCloseBtnText = '开启',
 }
 
 // cmd ws 消息状态
@@ -199,6 +283,9 @@
       percent: number,
       step_key: string,
       step_result: number
+    },
+    ext?: {
+      rate?: number
     }
   }
   result: number,

--
Gitblit v1.9.3