From 5dd55a2a402cdee7babab17b61e78562a5a74709 Mon Sep 17 00:00:00 2001 From: jingna <1264204245@qq.com> Date: Tue, 5 Aug 2025 18:22:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/renderer/src/views/Detection.vue | 124 +++++++++--------- 1 file changed, 61 insertions(+), 63 deletions(-) diff --git a/frontend/src/renderer/src/views/Detection.vue b/frontend/src/renderer/src/views/Detection.vue index 0b606f3b..edaccd0d 100644 --- a/frontend/src/renderer/src/views/Detection.vue +++ b/frontend/src/renderer/src/views/Detection.vue @@ -120,7 +120,8 @@ 清零 @@ -130,35 +131,24 @@
- +
-
最大旋转角:
-
-
左:-55.2°
-
右:54.2°
-
- +
左:-55.2°
+
右:-55.2°
- +
-
最大倾斜角:
-
-
左:-7.7°
-
右:8.7°
-
- +
左:-7.7°
+
右:8.7°
- +
-
最大仰视角:
-
-
左:-10.5°
-
右:11.5°
-
+
左:-10.5°
+
右:11.5°
@@ -250,7 +240,7 @@ align-content: space-between; "> -
+
@@ -323,7 +313,7 @@
-
+
@@ -1002,11 +992,9 @@ function stopRecording() { // 保存录像 async function saveRecording() { try { - debugger if (recordedChunks.length === 0) { throw new Error('没有录制数据') } - console.log() // 验证必需的患者信息 if (!patientInfo.value.id || !patientInfo.value.name || !patientInfo.value.sessionId) { throw new Error(`缺少必需的患者信息: ID=${patientInfo.value.id}, 姓名=${patientInfo.value.name}, 会话ID=${patientInfo.value.sessionId}`) @@ -1030,8 +1018,9 @@ async function saveRecording() { try { const base64Data = reader.result + // await fetch(`${BACKEND_URL}/api/recordings/save` // 调用后端API保存录像 - const response = await fetch(`${BACKEND_URL}/api/recordings/save`, { + const response = await fetch(`${BACKEND_URL}/api/detection/${patientInfo.value.sessionId}/stop`, { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -1057,7 +1046,7 @@ async function saveRecording() { message: `录像保存成功!文件路径: ${result.filepath}`, duration: 5000 }) - dialogVisible.value = false + dialogVisible.value = true // 更新会话的视频路径 if (patientInfo.value.sessionId) { try { @@ -1188,49 +1177,49 @@ async function stopDetection() { } // 如果正在录制,停止录制 - if (isRecording.value) { - stopRecording() - } - + // if (isRecording.value) { + // stopRecording() + // } + saveRecording() isStart.value = false - // 调用后端API停止检测会话 - if (patientInfo.value.sessionId) { - const response = await fetch(`${BACKEND_URL}/api/detection/${patientInfo.value.sessionId}/stop`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ - duration: duration - }) - }) + // // 调用后端API停止检测会话 + // if (patientInfo.value.sessionId) { - if (response.ok) { - const result = await response.json() - if (result.success) { - console.log('✅ 检测会话已停止') - //停止弹出诊断信息 - dialogVisible.value = true - if (result.duration) { - console.log(`⏱️ 检测持续时间: ${result.duration}秒`) - } - } - } - } - dialogVisible.value = true - // 清除检测开始时间和会话ID - patientInfo.value.detectionStartTime = null - // patientInfo.value.sessionId = null + // const response = await fetch(`${BACKEND_URL}/api/detection/${patientInfo.value.sessionId}/stop`, { + // method: 'POST', + // headers: { + // 'Content-Type': 'application/json' + // }, + // body: JSON.stringify({ + // duration: duration + // }) + // }) + + // if (response.ok) { + // const result = await response.json() + // if (result.success) { + // console.log('✅ 检测会话已停止') + // //停止弹出诊断信息 + // dialogVisible.value = true + // if (result.duration) { + // console.log(`⏱️ 检测持续时间: ${result.duration}秒`) + // } + // } + // } + // } + // dialogVisible.value = true + // // 清除检测开始时间和会话ID + // patientInfo.value.detectionStartTime = null + // // patientInfo.value.sessionId = null - ElMessage.success('检测已停止,视频继续播放') + // ElMessage.success('检测已停止,视频继续播放') } catch (error) { console.error('❌ 停止检测失败:', error) ElMessage.error(`停止检测失败: ${error.message}`) } } - // 格式化日期方法 const formatDate = (dateString) => { if (!dateString) return '-' @@ -1427,7 +1416,7 @@ onUnmounted(() => { display: flex; padding: 10px; justify-content: space-between; - height: calc(100vh - 60px); + height: calc(100vh - 130px); /* flex: 1; display: grid; @@ -1687,9 +1676,18 @@ onUnmounted(() => { .gauge-group-box{ display: flex; align-items: center; - justify-content: center; color: #ffffff; - font-size: 12px; + font-family: 'Arial Negreta', 'Arial Normal', 'Arial', sans-serif; +} +.gauge-group-box-text1{ + font-size: 16px; + font-weight: 700; + font-style: normal; +} +.gauge-group-box-text2{ + font-size: 24px; + color: #30F3FF; + font-weight: 700; } .gauge-table-title{ padding: 10px;