修改保存数据

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