重构实时监控界面 ,选择机器 弹出抽屉下发任务,支持筛选根据无人机和机器人分别显示 抽屉内容, 加了 mqtt断联机器ws,还未测试,基本架构完成
This commit is contained in:
@@ -609,9 +609,9 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
||||
`;
|
||||
} else {
|
||||
tooltip.innerHTML = `
|
||||
<div style="font-weight:600;margin-bottom:4px;">📍 ${t('systemSetting.longitude')}:${lonStr}</div>
|
||||
<div style="font-weight:600;">${t('systemSetting.latitude')}:${latStr}</div>
|
||||
`;
|
||||
<div style="font-weight:600;margin-bottom:4px;">📍 ${t('systemSetting.longitude')}:${lonStr}</div>
|
||||
<div style="font-weight:600;">${t('systemSetting.latitude')}:${latStr}</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1665,16 +1665,17 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
||||
handler.setInputAction((movement) => {
|
||||
const picked = viewer.scene.pick(movement.endPosition);
|
||||
const pickedRobot = (window.Cesium.defined(picked) && picked.id?.properties?.robot) ? picked.id.properties.robot.getValue() : null;
|
||||
const { lon, lat } = getCursorLngLat(viewer, movement.endPosition);
|
||||
if (window.Cesium.defined(lon) && Number.isFinite(lon)) {
|
||||
|
||||
// ✅ 只有拾取到设备实体,才显示tooltip,空白区域直接隐藏
|
||||
if (pickedRobot) {
|
||||
const { lon, lat } = getCursorLngLat(viewer, movement.endPosition);
|
||||
showCoordinateTooltip(tooltipRef.current, movement.endPosition, t, lon, lat, pickedRobot);
|
||||
} else if (pickedRobot) {
|
||||
showCoordinateTooltip(tooltipRef.current, movement.endPosition, t, NaN, NaN, pickedRobot);
|
||||
} else {
|
||||
tooltipRef.current.style.display = "none";
|
||||
}
|
||||
}, window.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
||||
|
||||
|
||||
handler.setInputAction((movement) => {
|
||||
const picked = viewer.scene.pick(movement.position);
|
||||
if (window.Cesium.defined(picked) && picked.id?.properties?.robot) {
|
||||
|
||||
@@ -606,7 +606,6 @@ export default function DeviceStatusPage() {
|
||||
longitude: lng,
|
||||
latitude: lat,
|
||||
},
|
||||
// 让地图取最新经纬度
|
||||
longitude: lng,
|
||||
latitude: lat,
|
||||
name: device?.deviceAlias || device?.callsign || device?.deviceName || t('devices.device'),
|
||||
|
||||
@@ -67,6 +67,16 @@ export default class DeviceController {
|
||||
wsManager.close();
|
||||
|
||||
}
|
||||
disconnect() {
|
||||
console.log('DeviceController disconnect: 断开 WebSocket');
|
||||
wsManager.close();
|
||||
this.connectedDeviceSn = null;
|
||||
this.currentDevice = null;
|
||||
this.wsDeviceInfo = {};
|
||||
this.locationInfo = {};
|
||||
this.isControlled = false;
|
||||
this.onControlStatusChange?.(false);
|
||||
}
|
||||
|
||||
handleVisibilityChange() {
|
||||
if (document.visibilityState === 'hidden') {
|
||||
|
||||
Reference in New Issue
Block a user