实时检测修改样式

This commit is contained in:
limengnan 2025-09-10 18:55:00 +08:00
parent 2d852d43dd
commit 84e18180a4

View File

@ -24,19 +24,20 @@
</div> </div>
<el-button v-if="!isRecording" @click="handleStartStop" :disabled="!isConnected" type="primary" <el-button v-if="!isRecording" @click="handleStartStop" :disabled="!isConnected" type="primary"
class="start-title-btn" style="background-image: linear-gradient(to right, rgb(236, 50, 166), rgb(160, 5, 216)); class="start-title-btn" style="background-image: linear-gradient(to right, rgb(236, 50, 166), rgb(160, 5, 216));
--el-button-border-color: #409EFF; --el-button-border-color: #409EFF;border:0px;
--el-button-border-color: transparent;width: 120px;height: 30px;font-size: 20px;"> --el-button-border-color: transparent;width: 110px;height: 30px;font-size: 18px;">
{{ isConnected ? '开始录像' : '录像中...' }} {{ isConnected ? '开始录像' : '录像中...' }}
</el-button> </el-button>
<!-- handleStartStop --> <!-- handleStartStop -->
<el-button v-if="isRecording" @click="handleStartStop" type="primary" class="start-title-btn" style="background-image: linear-gradient(to right, rgb(236, 50, 166), rgb(160, 5, 216)); <el-button v-if="isRecording" @click="handleStartStop" type="primary" class="start-title-btn" style="background-image: linear-gradient(to right, rgb(236, 50, 166), rgb(160, 5, 216));
--el-button-border-color: #409EFF; --el-button-border-color: #409EFF;border:0px;
--el-button-border-color: transparent;width: 120px;height: 30px;font-size: 20px;"> --el-button-border-color: transparent;width: 110px;height: 30px;font-size: 18px;">
结束录像 结束录像
</el-button> </el-button>
<el-button @click="saveDetectionData" type="primary" class="start-title-btn" style="background-image: linear-gradient(to right, #FBB106, #A817C6); <el-button @click="saveDetectionData" type="primary" class="start-title-btn" style="
--el-button-border-color: #409EFF; background-image: linear-gradient(to right, rgb(236, 50, 166), rgb(160, 5, 216));
--el-button-border-color: transparent;width: 120px;height: 30px;font-size: 20px;"> --el-button-border-color: #409EFF;border:0px;
--el-button-border-color: transparent;width: 110px;height: 30px;font-size: 18px;">
保存数据 保存数据
</el-button> </el-button>
</div> </div>
@ -102,7 +103,7 @@
<el-button type="primary" class="start-btn" @click="clearAndStartTracking" :disabled="isRecording" <el-button type="primary" class="start-btn" @click="clearAndStartTracking" :disabled="isRecording"
style="background-color: #0099ff;font-size: 14px;margin-left: 15px; style="background-color: #0099ff;font-size: 14px;margin-left: 15px;
--el-button-border-color: transparent !important;border-radius: 20px;height:26px;border:none;width: 100px;"> --el-button-border-color: transparent !important;border-radius: 20px;height:26px;border:none;width: 100px;">
清零并保存 清零
</el-button> </el-button>
</div> </div>
@ -1228,8 +1229,6 @@ const IMU_MIN_INTERVAL_MS = 33 // 约30Hz
let lastIMUValues = { rotation: null, tilt: null, pitch: null } let lastIMUValues = { rotation: null, tilt: null, pitch: null }
const IMU_CHANGE_EPS = 0.1 // 0.1° const IMU_CHANGE_EPS = 0.1 // 0.1°
//
const isTrackingMaxValues = ref(false)
// IMU姿 // IMU姿
function handleIMUData(data) { function handleIMUData(data) {
@ -1358,8 +1357,6 @@ function updateHeadPoseMaxValues(headPose) {
// //
function clearAndStartTracking() { function clearAndStartTracking() {
try { try {
saveMaxValuesToHistory()
// 0 // 0
headPoseMaxValues.value = { headPoseMaxValues.value = {
rotationLeftMax: 0, rotationLeftMax: 0,
@ -1369,14 +1366,7 @@ function clearAndStartTracking() {
pitchUpMax: 0, pitchUpMax: 0,
pitchDownMax: 0 pitchDownMax: 0
} }
//
isTrackingMaxValues.value = true
// console.log('🔄 姿')
// ElMessage.success('姿')
} catch (error) { } catch (error) {
// console.error(' :', error)
ElMessage.error('清零失败') ElMessage.error('清零失败')
} }
} }
@ -1399,8 +1389,6 @@ function saveMaxValuesToHistory() {
// //
headPoseHistory.value.push(currentMaxValues) headPoseHistory.value.push(currentMaxValues)
//
isTrackingMaxValues.value = false
// console.log('💾 姿:', currentMaxValues) // console.log('💾 姿:', currentMaxValues)
// ElMessage.success(`姿${currentMaxValues.id}`) // ElMessage.success(`姿${currentMaxValues.id}`)
@ -1701,9 +1689,7 @@ async function startDetection() {
if (!response.ok) { if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`) throw new Error(`HTTP ${response.status}: ${response.statusText}`)
} }
const result = await response.json() const result = await response.json()
debugger
if (result.success) { if (result.success) {
console.log('✅ 检测开始成功') console.log('✅ 检测开始成功')
// ID // ID
@ -1885,6 +1871,7 @@ const calibrationClick = async () => {
}, },
body: JSON.stringify({}) body: JSON.stringify({})
}) })
clearAndStartTracking()
if (response.ok) { if (response.ok) {
const result = await response.json() const result = await response.json()
if (result.success) { if (result.success) {
@ -2003,7 +1990,6 @@ onUnmounted(() => {
const startRecord = async () => { // const startRecord = async () => { //
try { try {
console.log('🚀 正在开始录屏...') console.log('🚀 正在开始录屏...')
debugger
// //
if (!patientInfo.value || !patientInfo.value.sessionId) { if (!patientInfo.value || !patientInfo.value.sessionId) {
throw new Error('缺少患者信息,无法开始录屏') throw new Error('缺少患者信息,无法开始录屏')
@ -2285,6 +2271,7 @@ function routerClick(){
height: 100%; height: 100%;
background-image: linear-gradient(to right, #333333 1px, transparent 1px), linear-gradient(to bottom, #333333 1px, transparent 1px); background-image: linear-gradient(to right, #333333 1px, transparent 1px), linear-gradient(to bottom, #333333 1px, transparent 1px);
background-size: 50px 50px; background-size: 50px 50px;
border:0px;
} }
.posture-heatmap { .posture-heatmap {