有和机器人总览界面

This commit is contained in:
mmc
2026-11-12 09:59:37 +08:00
parent ce9f52fc52
commit 943d6138cd
14 changed files with 438 additions and 225 deletions

View File

@@ -122,7 +122,7 @@ export default class DeviceController {
let msg = null;
try { msg = JSON.parse(event.data); } catch (e) { return; }
console.log('[DeviceController] 收到全量设备状态 初始状态', msg);
//console.log('[DeviceController] 收到全量设备状态 初始状态', msg);
if (msg?.type == 'mapPush') {
const list = Array.isArray(msg?.data) && msg.data.length
? msg.data
@@ -160,7 +160,7 @@ export default class DeviceController {
console.log('task finish');
this.onIsFinished?.(msg);
}
if (msg.status == "EXECUTING" || msg.status == "CANCELLED" || msg.status == "FAILED") {
if (msg.status == "EXECUTING" || msg.status == "PAUSE" || msg.status == "CANCELLED" || msg.status == "FAILED") {
this.onIsExecuting?.(true);
}
@@ -520,7 +520,7 @@ export default class DeviceController {
console.log('task finish');
this.onIsFinished?.(true);
}
if (msg.status == "EXECUTING") {
if (msg.status == "EXECUTING" || msg.status == "PAUSE") {
this.onIsExecuting?.(true);
}
@@ -545,18 +545,6 @@ export default class DeviceController {
break;
}
case 'detectionReport':
const { isSecure, obstacle } = msg.data;
if (isSecure) return;
const type = obstacle?.type;
const distance = (obstacle?.distance || 0).toFixed(2);
const types = { 0: i18n.t('constants.locationUnknown'), 1: i18n.t('devices.obstaclePerson'), 2: i18n.t('devices.obstacleVehicle'), 3: i18n.t('devices.obstacleFence'), 4: i18n.t('devices.obstaclePothole'), 5: i18n.t('devices.obstacleGrass') };
this.messageApi.warning({
key: 'obstacle-warning',
content: i18n.t('devices.obstacleDetectedReport', { obstacle: types[type] ?? i18n.t('devices.unknownObject'), distance }),
duration: 3,
});
break;
case 'route_post':
console.log('route_post:', msg);