完善分发与收集任务全流程
- RestJobEx 对齐 task_id,path_file 提交目录路径 - 运行页进度仅跟接口轮询,失败态停留 page3 UI - 完成态卡位续做,USB/任务轮询生命周期优化 - 拆分 DLL 加载、任务 staging 与提交前校验 - 移除 mock 与冗余样式,补充 native 依赖 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
/** SAPI_GetUsbCopyState: task_status(0=preparing, 1=copying, 2=completed, 3=failed) */
|
||||
export const USB_TASK_PREPARING = 0
|
||||
export const USB_TASK_COPYING = 1
|
||||
export const USB_TASK_COMPLETED = 2
|
||||
export const USB_TASK_FAILED = 3
|
||||
|
||||
/** @deprecated 使用 USB_TASK_PREPARING */
|
||||
export const USB_TASK_IDLE = USB_TASK_PREPARING
|
||||
/** @deprecated 使用 USB_TASK_COMPLETED */
|
||||
export const USB_TASK_SUCCESS = USB_TASK_COMPLETED
|
||||
|
||||
export function clampUsbCopyProgress(value: number): number {
|
||||
return Math.min(100, Math.max(0, Math.round(value)))
|
||||
}
|
||||
|
||||
export function usbTaskStatusHint(status: number): string {
|
||||
switch (status) {
|
||||
case USB_TASK_PREPARING:
|
||||
return '准备读取数据卡,请确认卡片已插入读卡位'
|
||||
case USB_TASK_COPYING:
|
||||
return '正在从卡片拷贝数据'
|
||||
case USB_TASK_COMPLETED:
|
||||
return '拷贝完成'
|
||||
case USB_TASK_FAILED:
|
||||
return 'USB 收集失败:未检测到卡片存储、读卡失败或无法移动到 USB 读卡位'
|
||||
default:
|
||||
return `USB 任务状态异常 (taskStatus=${status})`
|
||||
}
|
||||
}
|
||||
|
||||
export function isUsbCopyTerminal(status: number): boolean {
|
||||
return status === USB_TASK_COMPLETED || status === USB_TASK_FAILED
|
||||
}
|
||||
Reference in New Issue
Block a user