소스 검색

优化websocket展示数据

xiongxing 1 일 전
부모
커밋
040981959d
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      src/layout/index.vue

+ 6 - 4
src/layout/index.vue

@@ -418,7 +418,7 @@
 			// 发送确认消息
 			sendMessage({
 				type: 'SOS_ACK',
-				alertId: alert.timestamp,
+				alertId: alertData.timestamp,
 				timestamp: Date.now()
 			});
 			notification.warning({
@@ -431,8 +431,8 @@
 					<div>🚨🚨 SOS紧急预警 🚨🚨</div>
 					`
 				}),
-				duration: 10,
-				// duration: null,
+				// duration: 10,
+				duration: null,
 				class: 'my-warning-notification',
 				style: {
 					background: 'linear-gradient(135deg, #1e4184 0%, #3469e3 100%) !important',
@@ -445,7 +445,9 @@
 	         <div>院区名称: ${alert.organizationName || '未知'}</div>
 	         <div>长者姓名: ${alert.elderName || '未知'}</div>
 	         <div>长者房间: ${alert.roomName || '未知'}</div>
-	         <div>时间: ${new Date(alert.timestamp).toLocaleString()}</div>
+			 <div>设备类型: ${alert.deviceType || '未知'}</div>
+			 <div>设备电量: ${alert.batteryLevel || '0%'}</div>
+	         <div>时间: ${new Date(alertData.timestamp).toLocaleString()}</div>
 	       `
 				})
 			});