This commit is contained in:
ywb
2026-05-29 15:09:34 +08:00
parent f64068475f
commit a009fe9bb5
3 changed files with 53 additions and 23 deletions
+21 -12
View File
@@ -134,19 +134,28 @@ createApp({
this.progress = 0
this.report = null
this.showQrModal = false
await fetch(API + '/api/mission/start', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
agv_move: this.agvMoveEnabled,
qr_scan: this.qrScanEnabled,
front_photo: this.frontPhotoEnabled,
back_photo: this.backPhotoEnabled,
agv_speed: this.agvSpeed,
arm_speed: this.armSpeed,
try {
const res = await fetch(API + '/api/mission/start', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
agv_move: this.agvMoveEnabled,
qr_scan: this.qrScanEnabled,
front_photo: this.frontPhotoEnabled,
back_photo: this.backPhotoEnabled,
agv_speed: this.agvSpeed,
arm_speed: this.armSpeed,
})
})
})
this.missionState = 'running'
const data = await res.json()
if (!data.ok) {
alert('❌ 启动失败: ' + (data.error || '未知错误'))
return
}
this.missionState = 'running'
} catch (e) {
alert('❌ 启动请求失败: ' + e.message)
}
},
async startSingleStep() {
if (this.missionState !== 'idle') return