feat: 完善机巢任务状态展示与景区空境库入口
拍摄任务刷新时保留上次成功数据,失败状态按产品网页展示原因和不可召唤提示;新增受权限控制的景区空境库入口,使用当前景区空态。同步测试与接口说明。 验证:模拟器机巢相关 65 项测试、空境库及首页菜单相关 30 项测试通过。
This commit is contained in:
@@ -75,11 +75,14 @@ struct DroneDockShootingTaskIdentity: Decodable, Equatable, Sendable {
|
||||
let waylineStatus: Int?
|
||||
/// 服务端航线状态文案;执行失败优先于笼统的订单任务执行中。
|
||||
let waylineStatusLabel: String?
|
||||
/// 服务端实际记录的任务结果原因,空值不视为具体失败说明。
|
||||
let resultMessage: String?
|
||||
|
||||
/// 已确认嵌套任务字段映射。
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case id, orderNumber = "order_number", scenicID = "scenic_id", status, statusLabel = "status_label"
|
||||
case waylineStatus = "wayline_status", waylineStatusLabel = "wayline_status_label"
|
||||
case resultMessage = "result_message"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,6 +145,10 @@ struct DroneDockShootingPlane: Decodable, Equatable, Sendable {
|
||||
let id: Int?
|
||||
/// 当前设备序列号。
|
||||
let snNumber: String?
|
||||
/// 服务端连接状态;实测 2 为离线,不从电量推导连接状态。
|
||||
let onlineStatus: Int?
|
||||
/// 文档工作状态:0 离线、1 空闲、2 拍摄中;不据此推断返航完成。
|
||||
let workStatus: Int?
|
||||
/// 服务端工作状态文案。
|
||||
let workStatusLabel: String?
|
||||
/// 服务端完整状态文案。
|
||||
@@ -150,6 +157,7 @@ struct DroneDockShootingPlane: Decodable, Equatable, Sendable {
|
||||
/// 当前设备字段映射。
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case id, snNumber = "sn_number", workStatusLabel = "work_status_label", statusText = "status_text"
|
||||
case onlineStatus = "online_status", workStatus = "work_status"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ enum DroneDockTaskDisplayAction: Equatable, Sendable {
|
||||
case start
|
||||
/// 恢复拍摄占位动作,本轮禁用。
|
||||
case resume
|
||||
/// 失败后的重新召唤占位动作;尚未接入重新准备流程,始终禁用。
|
||||
case retry
|
||||
/// 查看已明确完成任务的订单素材。
|
||||
case materials
|
||||
/// 当前无主动作。
|
||||
@@ -54,6 +56,21 @@ struct DroneDockTaskPresentation: Equatable, Sendable {
|
||||
let action: DroneDockTaskDisplayAction
|
||||
/// 主动作名称,无动作时为 nil。
|
||||
let actionTitle: String?
|
||||
/// 是否可触发动作;未对接的开始和恢复始终为 false。
|
||||
/// 是否可触发动作;未对接的开始、恢复和重新召唤始终为 false。
|
||||
let isActionEnabled: Bool
|
||||
/// 主动作下方的真实设备限制说明,未提供时不展示。
|
||||
let actionNote: String?
|
||||
|
||||
/// 创建状态展示;动作提示默认为空,既有非失败状态保持原布局。
|
||||
init(phase: DroneDockTaskDisplayPhase, title: String, message: String, deviceStatus: String,
|
||||
action: DroneDockTaskDisplayAction, actionTitle: String?, isActionEnabled: Bool, actionNote: String? = nil) {
|
||||
self.phase = phase
|
||||
self.title = title
|
||||
self.message = message
|
||||
self.deviceStatus = deviceStatus
|
||||
self.action = action
|
||||
self.actionTitle = actionTitle
|
||||
self.isActionEnabled = isActionEnabled
|
||||
self.actionNote = actionNote
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user