修改保存数据
This commit is contained in:
parent
6d299008f6
commit
830a5520cb
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user