重构实时监控界面 ,选择机器 弹出抽屉下发任务,支持筛选根据无人机和机器人分别显示 抽屉内容, 加了 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') {
|
||||
|
||||
@@ -93,6 +93,10 @@ const en = {
|
||||
requestError: 'Request Error',
|
||||
settings: 'Settings',
|
||||
storeValue: 'Store Value',
|
||||
action: 'Action',
|
||||
locate: 'Locate',
|
||||
minutes: 'min',
|
||||
totalCount: 'Total {{count}}',
|
||||
submitFail: 'Submit Fail',
|
||||
timeRange: 'Time Range',
|
||||
working: 'Working',
|
||||
@@ -170,6 +174,9 @@ const en = {
|
||||
ambientTemperature: 'Ambient Temperature',
|
||||
current: 'Current',
|
||||
currentIrradiance: 'Current Irradiance',
|
||||
charge: 'Battery',
|
||||
model: 'Model',
|
||||
ratPower: 'Rated Power',
|
||||
frequency: 'Frequency',
|
||||
gridConnected: 'Grid Connected',
|
||||
gridConnection: 'Grid Connection',
|
||||
@@ -371,6 +378,36 @@ const en = {
|
||||
networkLatency: 'Network Latency',
|
||||
waterRiskWarning: 'Warning: Water accumulation risk in Area B, avoid it',
|
||||
presetRoutes: 'Preset Routes',
|
||||
all: 'All',
|
||||
stop: 'Stop',
|
||||
currentTask: 'Current Task',
|
||||
realtimePosition: 'Real-time Position',
|
||||
taskCompleted: 'Task completed',
|
||||
deviceSerialNumberMissing: 'Device serial number missing',
|
||||
confirmExecuteRoute: 'Confirm to execute this route?',
|
||||
targetDevice: 'Target Device',
|
||||
routePointCount: 'Route points',
|
||||
taskExecuteFailed: 'Task execution failed',
|
||||
taskPauseAbnormal: 'Task pause abnormal',
|
||||
areYouSureCancelTask: 'Are you sure to cancel the task?',
|
||||
taskCancelled: 'Task cancelled',
|
||||
taskCancelAbnormal: 'Failed to cancel the task',
|
||||
taskStatusNew: 'Pending',
|
||||
taskStatusExecuting: 'Executing',
|
||||
taskStatusPause: 'Paused',
|
||||
taskStatusFinish: 'Finished',
|
||||
taskStatusCancel: 'Cancelled',
|
||||
unnamedTask: 'Unnamed Task',
|
||||
planId: 'Plan ID',
|
||||
expectedComplete: 'Expected completion',
|
||||
noCurrentTask: 'No current task',
|
||||
searchRoute: 'Search route',
|
||||
noRouteTip: 'No preset routes',
|
||||
pointCount: 'Point count',
|
||||
deviceInfo: 'Device Info',
|
||||
deviceCode: 'Device Code',
|
||||
siteBelonging: 'Site',
|
||||
deviceLocation: 'Device location',
|
||||
searchPlaceholder: 'Search...',
|
||||
unnamedRoute: 'Unnamed Route',
|
||||
deleteRoute: 'Delete Route',
|
||||
@@ -3604,6 +3641,13 @@ const en = {
|
||||
fixed2Offline3: ' Offline 3',
|
||||
|
||||
powerCurveFixed2: 'Real-time power curve',
|
||||
viewDeviceDetailAndTask: 'View device detail and task',
|
||||
showAllDevices: 'Show All Devices',
|
||||
showOnlySelected: 'Show Selected Only',
|
||||
clickDeviceOnMapTip: 'Click a device on the map to locate and view details',
|
||||
focusingDevice: 'Locating device: {{name}}',
|
||||
foundDevices: 'Found {{count}} devices',
|
||||
gridNorm: 'Grid Normal',
|
||||
|
||||
s11: 'today',
|
||||
|
||||
|
||||
@@ -97,6 +97,10 @@ const zh = {
|
||||
requestError: '请求错误',
|
||||
settings: '设置',
|
||||
storeValue: '存储值',
|
||||
action: '操作',
|
||||
locate: '定位',
|
||||
minutes: '分钟',
|
||||
totalCount: '共 {{count}} 台',
|
||||
submitFail: '提交失败',
|
||||
timeRange: '时间范围',
|
||||
working: '作业中',
|
||||
@@ -174,6 +178,9 @@ const zh = {
|
||||
ambientTemperature: '环境温度',
|
||||
current: '当前',
|
||||
currentIrradiance: '当前辐照度',
|
||||
charge: '电量',
|
||||
model: '型号',
|
||||
ratPower: '额定功率',
|
||||
frequency: '频率',
|
||||
gridConnected: '电网已连接',
|
||||
gridConnection: '电网连接',
|
||||
@@ -386,6 +393,36 @@ const zh = {
|
||||
networkLatency: '网络延迟',
|
||||
waterRiskWarning: '注意:区域 B 存在积水风险,建议避开',
|
||||
presetRoutes: '预设路线',
|
||||
all: '全部',
|
||||
stop: '停止',
|
||||
currentTask: '当前任务',
|
||||
realtimePosition: '实时位置',
|
||||
taskCompleted: '任务已完成',
|
||||
deviceSerialNumberMissing: '设备序列号缺失',
|
||||
confirmExecuteRoute: '确认执行该路线?',
|
||||
targetDevice: '目标设备',
|
||||
routePointCount: '路径点数',
|
||||
taskExecuteFailed: '任务执行失败',
|
||||
taskPauseAbnormal: '任务暂停异常',
|
||||
areYouSureCancelTask: '确定要取消任务?',
|
||||
taskCancelled: '任务已取消',
|
||||
taskCancelAbnormal: '任务取消失败',
|
||||
taskStatusNew: '待执行',
|
||||
taskStatusExecuting: '执行中',
|
||||
taskStatusPause: '已暂停',
|
||||
taskStatusFinish: '已完成',
|
||||
taskStatusCancel: '已取消',
|
||||
unnamedTask: '未命名任务',
|
||||
planId: '任务ID',
|
||||
expectedComplete: '预计完成',
|
||||
noCurrentTask: '暂无当前任务',
|
||||
searchRoute: '搜索路径',
|
||||
noRouteTip: '暂无预设路径',
|
||||
pointCount: '路径点数',
|
||||
deviceInfo: '设备信息',
|
||||
deviceCode: '设备编码',
|
||||
siteBelonging: '所属场站',
|
||||
deviceLocation: '设备位置',
|
||||
searchPlaceholder: '搜索...',
|
||||
unnamedRoute: '未命名路线',
|
||||
deleteRoute: '删除航线',
|
||||
@@ -555,7 +592,7 @@ const zh = {
|
||||
equipmentSituationMap: '设备态势地图',
|
||||
execTimePoint: '执行时间点',
|
||||
executeDeviceColon: '执行设备',
|
||||
executeNow: '执行现在',
|
||||
executeNow: '执行',
|
||||
executeWayline: '执行航线',
|
||||
executeWaylineTask: '执行航线任务',
|
||||
executingTasks: '执行中任务',
|
||||
@@ -3653,6 +3690,13 @@ const zh = {
|
||||
fixed2Offline3: '离线 3',
|
||||
|
||||
powerCurveFixed2: '实时功率曲线',
|
||||
viewDeviceDetailAndTask: '查看设备详情与任务',
|
||||
showAllDevices: '显示全部设备',
|
||||
showOnlySelected: '仅显示选中设备',
|
||||
clickDeviceOnMapTip: '点击地图上的设备可定位并查看详情',
|
||||
focusingDevice: '正在定位设备:{{name}}',
|
||||
foundDevices: '已找到 {{count}} 台设备',
|
||||
gridNorm: '并网正常',
|
||||
|
||||
s11: '今天',
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user