diff --git a/env.js b/env.js index cac3477..9fd367d 100644 --- a/env.js +++ b/env.js @@ -9,17 +9,17 @@ const currentEnv = import.meta.env?.MODE || process.env.NODE_ENV; // 环境配置映射 const envConfig = { [ENV.DEV]: { - baseURL: 'http://192.168.2.59:8081',//http://192.168.2.56:8081 - //baseURL: 'http://1.95.137.212:59015',//http://192.168.2.56:8081 - WS_URL: 'ws://192.168.2.59:9002/ws/', - mqtt_url: "ws://1.95.137.212:8083/mqtt", - geoserver_url: "http://192.168.2.59:7000/geoserver" - - //baseURL: 'http://1.95.137.212:8081',//http://192.168.2.56:8081 - ////baseURL: 'https://serviceri.satabot.com', - //WS_URL: 'ws://1.95.137.212:9002/ws/', + //baseURL: 'http://192.168.2.59:8081',//http://192.168.2.56:8081 + ////baseURL: 'http://1.95.137.212:59015',//http://192.168.2.56:8081 + //WS_URL: 'ws://192.168.2.59:9002/ws/', //mqtt_url: "ws://1.95.137.212:8083/mqtt", - //geoserver_url: "http://1.95.137.212:59018/geoserver" + //geoserver_url: "http://192.168.2.59:7000/geoserver" + + baseURL: 'http://1.95.137.212:8081',//http://192.168.2.56:8081 + //baseURL: 'https://serviceri.satabot.com', + WS_URL: 'ws://1.95.137.212:9002/ws/', + mqtt_url: "ws://1.95.137.212:8083/mqtt", + geoserver_url: "http://1.95.137.212:59018/geoserver" //baseURL: 'http://1.95.137.212:59015',//http://192.168.2.56:8081 ////baseURL: 'https://serviceri.satabot.com', diff --git a/src/api/alarmApi.js b/src/api/alarmApi.js index f5884d2..f39459c 100644 --- a/src/api/alarmApi.js +++ b/src/api/alarmApi.js @@ -39,7 +39,7 @@ export function updateAlarm(data) { export function handleAlarm(data) { return request({ url: '/iot/alarm/handle', - method: 'put', + method: 'post', data }); } diff --git a/src/components/Draggable.tsx b/src/components/Draggable.tsx index f5aecce..3879e25 100644 --- a/src/components/Draggable.tsx +++ b/src/components/Draggable.tsx @@ -51,7 +51,8 @@ const DraggableBox: React.FC = ({ {/* 传入的视频内容 */} -
{children}
+
+ {children}
); diff --git a/src/components/Map.jsx b/src/components/Map.jsx index 2fe1d97..01098a1 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -915,7 +915,12 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine, } viewer.scene.requestRender(); } + } else { + tracePointRef.current.setMode(TPMode.LOCATION); + isNavigationModeRef.current = false; + lastFinishPointRef.current = null; } + }, [drawRealTime]); // 处理完成点 diff --git a/src/components/SystemSetting/DeviceManagement.tsx b/src/components/SystemSetting/DeviceManagement.tsx index 7d64fd7..b65b18b 100644 --- a/src/components/SystemSetting/DeviceManagement.tsx +++ b/src/components/SystemSetting/DeviceManagement.tsx @@ -18,6 +18,7 @@ import { Col, App, Typography, + Slider, } from 'antd'; const { Text } = Typography; @@ -767,6 +768,19 @@ export default function DeviceManagementPage() { + + +
+ +
+
+ + +
+ {/**/} + +
+
@@ -921,7 +935,8 @@ export default function DeviceManagementPage() { }} /> - )} - + ) + } + ); } diff --git a/src/components/alerts/AlarmHistory.tsx b/src/components/alerts/AlarmHistory.tsx index c21a7b8..0cfa33b 100644 --- a/src/components/alerts/AlarmHistory.tsx +++ b/src/components/alerts/AlarmHistory.tsx @@ -11,19 +11,11 @@ import { getAlarmList, getAlarmDetail } from '../../api/alarmApi.js'; +import { alarmTypeMap } from '@/constants.js'; const { Option } = Select; const { RangePicker } = DatePicker; -// ====================== 枚举配置 ====================== -const alarmTypeMap = { - 1: '设备故障', - 2: '数据异常', - 3: '通信中断', - 4: '性能告警', - 5: '安全告警', - 6: '环境告警' -}; const alarmLevelConfig = { 1: { description: '严重', color: '#FF4D4F' }, @@ -120,6 +112,7 @@ const AlarmHistory = () => { setQueryParams({ deviceId: values.deviceId || '', alarmLevel: values.alarmLevel || '', + alarmType: values.alarmType || '', handleStatus: values.handleStatus || '', startTime, endTime, @@ -142,6 +135,12 @@ const AlarmHistory = () => { }, { title: '设备ID', dataIndex: 'deviceId', width: 160 }, { title: '设备名称', dataIndex: 'deviceName', ellipsis: true }, + { + title: '告警类型', + dataIndex: 'alarmType', + width: 130, + render: (t) => alarmTypeMap[t] || '-' + }, { title: '告警级别', width: 100, @@ -201,6 +200,16 @@ const AlarmHistory = () => { + + + + + + + + + + + + + + + + + {/* 底部按钮 */} + + @@ -922,12 +964,11 @@ export default function AlarmCenterPage() { rules={[{ required: true, message: '请选择告警类型' }]} > diff --git a/src/components/devices/RobotTaskPage.tsx b/src/components/devices/RobotTaskPage.tsx index 23df8d8..a8e2cfc 100644 --- a/src/components/devices/RobotTaskPage.tsx +++ b/src/components/devices/RobotTaskPage.tsx @@ -304,7 +304,7 @@ export default function RobotTaskPage() { const data = { lon: robotRealtimePosition?.longitude || 0, lat: robotRealtimePosition?.latitude || 0, - //heading: robotRealtimePosition?.yaw || 0, + heading: robotRealtimePosition?.yaw || 0, } return data; }, [robotRealtimePosition]) @@ -1772,7 +1772,7 @@ export default function RobotTaskPage() { title={`机器人全景视频 - ${executingRobot.deviceAlias || executingRobot.serialNumber}`} onClose={() => setShowVideo(false)} > -
+
俯仰角: {statusData.pitch !== undefined ? `${Number(statusData.pitch).toFixed(1)}°` : '-'} 航向角状态: - {runningStatus.headingStatus !== undefined ? `${runningStatus.headingStatus == 1 ? '初始化' : '未初始化'}` : '-'} + {statusData.headingStatus !== undefined ? `${statusData.headingStatus == 1 ? '初始化' : '未初始化'}` : '-'} 定位: {statusData.qual == 0 ? '无效' : diff --git a/src/constants.ts b/src/constants.ts index 13b6e18..a5ab171 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -18,12 +18,11 @@ export const sourceTypeMap = { }; export const alarmTypeMap = { - 1: '设备故障', - 2: '数据异常', - 3: '通信中断', - 4: '性能告警', - 5: '安全告警', - 6: '环境告警' + 'UAV_FAULT': '无人机故障', + 'MOWER_FAULT': '割草机故障', + 'OTHER_DEVICE_FAULT': '其他设备故障', + 'SERVER_FAILURE': '服务器故障', + 'SYSTEM_ERROR': '系统错误' }; export const alarmLevelConfig = { diff --git a/src/pages/WorkOrder.tsx b/src/pages/WorkOrder.tsx index 38b6503..820da15 100644 --- a/src/pages/WorkOrder.tsx +++ b/src/pages/WorkOrder.tsx @@ -423,7 +423,8 @@ const WorkOrderPage = () => { const submitComplete = async (values) => { try { const now = dayjs().format('YYYY-MM-DDTHH:mm:ss'); - const params = { + // 1. 组装后端需要的 IOTWorkOrder JSON 对象 + const workOrderObj = { ...currentDetail, id: values.id, orderNo: currentDetail?.orderNo, @@ -433,7 +434,24 @@ const WorkOrderPage = () => { handleResult: values.handleResult, handleRemark: values.handleRemark, }; - await completeWorkOrder(params); + + // 2. 新建 FormData,适配 @RequestPart 混合参数 + const formData = new FormData(); + // workOrder 字段:转JSON字符串 + formData.append( + "workOrder", + new Blob([JSON.stringify(workOrderObj)], { + type: "application/json" + }) + ); + + //formData.append('workOrder', JSON.stringify(workOrderObj)); + + + + // 4. 请求方法 completeWorkOrder 必须修改:传 formData,删除 headers 的 Content-Type + await completeWorkOrder(formData); + messageApi.success('工单已完成'); setCompleteModalVisible(false); getWorkOrderList(); @@ -444,6 +462,7 @@ const WorkOrderPage = () => { } }; + // 获取工单详情 const getWorkOrderDetail = async (id) => { try {