开始录屏方法修改
This commit is contained in:
parent
a5e9ee749c
commit
13be9337b9
@ -51,7 +51,7 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<!-- 核心内容区(网格布局) -->
|
<!-- 核心内容区(网格布局) -->
|
||||||
<div id="detectare" class="content-grid">
|
<div id="detectare" ref="contenGridRef" class="content-grid">
|
||||||
<!-- 身体姿态模块 -->
|
<!-- 身体姿态模块 -->
|
||||||
<div class="module-card body-posture" style="width: 25%;margin-right: 1px; ">
|
<div class="module-card body-posture" style="width: 25%;margin-right: 1px; ">
|
||||||
<div class="module-header">
|
<div class="module-header">
|
||||||
@ -572,6 +572,9 @@ const dataCollectionLoading = ref(false)
|
|||||||
const isRecording = ref(false)
|
const isRecording = ref(false)
|
||||||
const cameraDialogVisible =ref(false) // 设置相机参数弹框
|
const cameraDialogVisible =ref(false) // 设置相机参数弹框
|
||||||
|
|
||||||
|
|
||||||
|
const contenGridRef =ref(null) // 实时检查整体box
|
||||||
|
|
||||||
const wholeBodyRef = ref(null) // 身体姿态ref
|
const wholeBodyRef = ref(null) // 身体姿态ref
|
||||||
const videoImgRef =ref(null) // 视频流图片ref
|
const videoImgRef =ref(null) // 视频流图片ref
|
||||||
|
|
||||||
@ -1628,6 +1631,8 @@ async function handleDataCollection() {
|
|||||||
// 保存检测数据
|
// 保存检测数据
|
||||||
|
|
||||||
async function saveDetectionData() {
|
async function saveDetectionData() {
|
||||||
|
console.log(tempInfo.value)
|
||||||
|
return
|
||||||
if (screenshotLoading.value) return
|
if (screenshotLoading.value) return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -1639,18 +1644,37 @@ async function saveDetectionData() {
|
|||||||
if (!patientInfo.value.sessionId) {
|
if (!patientInfo.value.sessionId) {
|
||||||
throw new Error('请先开始检测再进行截图')
|
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保存截图
|
// 调用后端API保存截图
|
||||||
const result = await sendDetectionData({
|
const result = await sendDetectionData({
|
||||||
patientId: patientInfo.value.id,
|
// patientId: patientInfo.value.id,
|
||||||
patientName: patientInfo.value.name,
|
// 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,
|
sessionId: patientInfo.value.sessionId,
|
||||||
head_data: imu_data,
|
patientId: patientInfo.value.id,
|
||||||
body_data: femtobolt_frame,
|
|
||||||
foot_data: pressure_data,
|
body_pose:tempInfo.value.femtobolt_frame,
|
||||||
camera_data: camera_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({
|
ElMessage.success({
|
||||||
message: `截图保存成功!`,
|
message: `截图保存成功!`,
|
||||||
@ -2024,6 +2048,9 @@ async function startDetection() {
|
|||||||
if (!patientInfo.value || !patientInfo.value.id) {
|
if (!patientInfo.value || !patientInfo.value.id) {
|
||||||
throw new Error('缺少患者信息,无法开始检测')
|
throw new Error('缺少患者信息,无法开始检测')
|
||||||
}
|
}
|
||||||
|
let screen_location = contenGridRef.value.getBoundingClientRect()
|
||||||
|
let femtobolt_location = wholeBodyRef.value.getBoundingClientRect()
|
||||||
|
let camera_location = videoImgRef.value.getBoundingClientRect()
|
||||||
// 调用后端API开始检测
|
// 调用后端API开始检测
|
||||||
const response = await fetch(`${BACKEND_URL}/api/detection/start`, {
|
const response = await fetch(`${BACKEND_URL}/api/detection/start`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -2034,6 +2061,25 @@ async function startDetection() {
|
|||||||
patient_id: patientInfo.value.id,
|
patient_id: patientInfo.value.id,
|
||||||
// 可以添加其他检测参数
|
// 可以添加其他检测参数
|
||||||
creator_id: creatorId.value,
|
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({
|
// settings: JSON.stringify({
|
||||||
// frequency: 30, // 采样频率
|
// frequency: 30, // 采样频率
|
||||||
// // 其他设置参数
|
// // 其他设置参数
|
||||||
@ -3020,6 +3066,7 @@ onUnmounted(() => {
|
|||||||
|
|
||||||
:deep(.tsDialog.el-dialog .el-input__wrapper) {
|
:deep(.tsDialog.el-dialog .el-input__wrapper) {
|
||||||
background-color: #242424;
|
background-color: #242424;
|
||||||
|
font-size: 16px;
|
||||||
border: none;
|
border: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
@ -3032,6 +3079,7 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
:deep(.tsDialog.el-dialog .el-input__inner) {
|
:deep(.tsDialog.el-dialog .el-input__inner) {
|
||||||
|
font-size: 16px;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,6 +617,7 @@ const loadPatientInfo = async () => {
|
|||||||
const response = await patientAPI.getById(patientId)
|
const response = await patientAPI.getById(patientId)
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
patient.value = response.data
|
patient.value = response.data
|
||||||
|
selectedPatient.value = response.data
|
||||||
console.log('加载患者信息成功:', response.data)
|
console.log('加载患者信息成功:', response.data)
|
||||||
} else {
|
} else {
|
||||||
throw new Error(response.message)
|
throw new Error(response.message)
|
||||||
|
Loading…
Reference in New Issue
Block a user