diff --git a/frontend/src/renderer/src/views/Detection.vue b/frontend/src/renderer/src/views/Detection.vue index dc0d4bc0..1781b87e 100644 --- a/frontend/src/renderer/src/views/Detection.vue +++ b/frontend/src/renderer/src/views/Detection.vue @@ -51,7 +51,7 @@ -
+
@@ -572,6 +572,9 @@ const dataCollectionLoading = ref(false) const isRecording = ref(false) const cameraDialogVisible =ref(false) // 设置相机参数弹框 + +const contenGridRef =ref(null) // 实时检查整体box + const wholeBodyRef = ref(null) // 身体姿态ref const videoImgRef =ref(null) // 视频流图片ref @@ -1628,6 +1631,8 @@ async function handleDataCollection() { // 保存检测数据 async function saveDetectionData() { + console.log(tempInfo.value) + return if (screenshotLoading.value) return try { @@ -1639,18 +1644,37 @@ async function saveDetectionData() { if (!patientInfo.value.sessionId) { throw new Error('请先开始检测再进行截图') } - + const base64 = 'data:image/jpeg;base64,' + let pressure_image = "" + if(tempInfo.value.pressure_data != null + && tempInfo.value.pressure_data.foot_pressure != null + && tempInfo.value.pressure_data.foot_pressure.pressure_image != null){ + pressure_image = base64 + tempInfo.value.pressure_data.foot_pressure.pressure_image + } + // 调用后端API保存截图 const result = await sendDetectionData({ - patientId: patientInfo.value.id, - patientName: patientInfo.value.name, + // patientId: patientInfo.value.id, + // patientName: patientInfo.value.name, + // sessionId: patientInfo.value.sessionId, + // head_pose: tempInfo.value.imu_data, + // body_data: femtobolt_frame, + // foot_image: pressure_data, + + sessionId: patientInfo.value.sessionId, - head_data: imu_data, - body_data: femtobolt_frame, - foot_data: pressure_data, - camera_data: camera_frame, + patientId: patientInfo.value.id, + + body_pose:tempInfo.value.femtobolt_frame, + body_image:base64 + tempInfo.value.femtobolt_frame, + + foot_data:tempInfo.value.femtobolt_frame, + foot_data_image:base64+tempInfo.value.femtobolt_frame.image, + screen_image:null, + camera_data: base64+ tempInfo.value.camera_frame.image, }) - tempInfo.value + + // 显示成功消息和文件路径 ElMessage.success({ message: `截图保存成功!`, @@ -2024,6 +2048,9 @@ async function startDetection() { if (!patientInfo.value || !patientInfo.value.id) { throw new Error('缺少患者信息,无法开始检测') } + let screen_location = contenGridRef.value.getBoundingClientRect() + let femtobolt_location = wholeBodyRef.value.getBoundingClientRect() + let camera_location = videoImgRef.value.getBoundingClientRect() // 调用后端API开始检测 const response = await fetch(`${BACKEND_URL}/api/detection/start`, { method: 'POST', @@ -2034,6 +2061,25 @@ async function startDetection() { patient_id: patientInfo.value.id, // 可以添加其他检测参数 creator_id: creatorId.value, + screen_location:{ + x:screen_location.x, + y:screen_location.y, + w:screen_location.width, + h:screen_location.height + }, + femtobolt_location :{ + x:femtobolt_location.x, + y:femtobolt_location.y, + w:femtobolt_location.width, + h:femtobolt_location.height + }, + camera_location :{ + x:camera_location.x, + y:camera_location.y, + w:camera_location.width, + h:camera_location.height + } + // settings: JSON.stringify({ // frequency: 30, // 采样频率 // // 其他设置参数 @@ -3020,6 +3066,7 @@ onUnmounted(() => { :deep(.tsDialog.el-dialog .el-input__wrapper) { background-color: #242424; + font-size: 16px; border: none; box-shadow: none; } @@ -3032,6 +3079,7 @@ onUnmounted(() => { } :deep(.tsDialog.el-dialog .el-input__inner) { + font-size: 16px; color: #ffffff; } diff --git a/frontend/src/renderer/src/views/PatientProfile.vue b/frontend/src/renderer/src/views/PatientProfile.vue index 136e182b..cf9ba9bf 100644 --- a/frontend/src/renderer/src/views/PatientProfile.vue +++ b/frontend/src/renderer/src/views/PatientProfile.vue @@ -617,6 +617,7 @@ const loadPatientInfo = async () => { const response = await patientAPI.getById(patientId) if (response.success) { patient.value = response.data + selectedPatient.value = response.data console.log('加载患者信息成功:', response.data) } else { throw new Error(response.message)