This commit is contained in:
ywb
2026-06-08 11:42:41 +08:00
parent 696bf2ef6e
commit a4f4be4c8e
8 changed files with 141 additions and 52 deletions
+15 -7
View File
@@ -33,8 +33,8 @@ createApp({
frontPhotoEnabled: true,
backPhotoEnabled: true,
// 速度控制
agvSpeed: 0.5,
armSpeed: 500,
agvSpeed: 1.0,
armSpeed: 1000,
}
},
computed: {
@@ -63,10 +63,10 @@ createApp({
try {
const res = await fetch(API + '/api/status')
const data = await res.json()
if (!this.armCameraOpened) {
this.armPreviewUrl = ''
} else if (!this.armPreviewUrl) {
this.armPreviewUrl = API + '/api/camera/arm_preview'
const opened = data.arm_camera_opened
if (opened !== this.armCameraOpened || (opened && !this.armPreviewUrl)) {
this.armCameraOpened = opened
this.armPreviewUrl = opened ? API + '/api/camera/arm_preview' : ''
}
} catch (e) {}
},
@@ -94,6 +94,9 @@ createApp({
if (data.point_status) this.pointStatus = data.point_status
if (data.machine_status) this.machineStatus = data.machine_status
this.armCameraOpened = data.arm_camera_opened
if (this.armCameraOpened && !this.armPreviewUrl) {
this.armPreviewUrl = API + '/api/camera/arm_preview'
}
// 错误弹窗
if (data.waiting_error) {
@@ -260,7 +263,12 @@ createApp({
e.target.style.display = 'none'
},
onArmPreviewError(e) {
e.target.style.display = 'none'
// 重新加载:加时间戳避免缓存
const url = this.armPreviewUrl
if (url) {
const sep = url.includes('?') ? '&' : '?'
this.armPreviewUrl = url + sep + '_t=' + Date.now()
}
},
// ===== 网格任务显示方法 =====
getPointStatus(pr, c) {