修改保存数据

This commit is contained in:
jingna 2025-08-05 17:47:04 +08:00
parent 6d299008f6
commit 830a5520cb

View File

@ -40,7 +40,7 @@
</el-button> </el-button>
<el-button <el-button
v-if="isStart && isConnected" v-if="isStart && isConnected"
@click="handleDataCollection" @click="handleScreenshot"
type="primary" type="primary"
class="start-btn" class="start-btn"
style="background-image: linear-gradient(to right, #FBB106, #A817C6); style="background-image: linear-gradient(to right, #FBB106, #A817C6);
@ -358,7 +358,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div style="display: flex;justify-content: flex-end;">测试医生李四</div> <div style="display: flex;justify-content: flex-end;color: #ffffff;">测试医生李四</div>
</div> </div>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
@ -740,7 +740,10 @@ async function handleScreenshot() {
patientId: patientInfo.value.id, patientId: patientInfo.value.id,
patientName: patientInfo.value.name, patientName: patientInfo.value.name,
sessionId: patientInfo.value.sessionId, sessionId: patientInfo.value.sessionId,
imageData: base64Image imageData: base64Image,
head_pose:{},
body_pose:{},
foot_data:{}
}) })
// //
@ -792,7 +795,8 @@ function generateSessionId() {
// API // API
async function saveScreenshot(data) { async function saveScreenshot(data) {
try { try {
const response = await fetch(`${BACKEND_URL}/api/screenshots/save`, { const response = await fetch(`${BACKEND_URL}/api/detection/${patientInfo.value.sessionId}/collect`
, {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
@ -998,6 +1002,7 @@ function stopRecording() {
// //
async function saveRecording() { async function saveRecording() {
try { try {
debugger
if (recordedChunks.length === 0) { if (recordedChunks.length === 0) {
throw new Error('没有录制数据') throw new Error('没有录制数据')
} }
@ -1105,7 +1110,6 @@ async function saveRecording() {
// / // /
async function handleStartStop() { async function handleStartStop() {
patientInfo.value.sessionId = null
if (!isConnected.value) { if (!isConnected.value) {
ElMessage.warning('WebSocket未连接无法操作') ElMessage.warning('WebSocket未连接无法操作')
return return
@ -1115,6 +1119,7 @@ async function handleStartStop() {
// //
await stopDetection() await stopDetection()
} else { } else {
patientInfo.value.sessionId = null
// //
await startDetection() await startDetection()
} }
@ -1737,10 +1742,25 @@ onUnmounted(() => {
display: flex; display: flex;
justify-content:space-between ; justify-content:space-between ;
margin-bottom: 20px; margin-bottom: 20px;
color: #ffffff;
} }
.dialog-title-item{ .dialog-title-item{
display: flex; display: flex;
width: 200px; width: 200px;
color: #ffffff;
}
:deep(.el-dialog){
background-color: #1D1b26;
}
:deep(.el-dialog__title){
color: #ffffff;
}
:deep(.el-form-item__label){
color: #ffffff;
}
:deep(.el-textarea__inner){
background: #1D1b26;
color: #ffffff;
} }
</style> </style>
<style> <style>