控制面板,不同的设备控制,跳转到不同的控制页

This commit is contained in:
fengerli
2025-09-04 17:33:27 +08:00
parent 520d6b2b1a
commit a31318aa1a
5 changed files with 45 additions and 28 deletions

View File

@ -113,10 +113,13 @@
<div class="message-content">
<el-input type="textarea" class="textareaTFT" :rows="4" placeholder="现场危险,停止救援!紧急撤离至安全区域!"
v-model="deviceDetail.sendMsg" resize="none" />
<el-button type="primary" class="send-btn" @click="sendTextMessage"
:loading="sendTextLoading" :loading-text="sendTextLoading ? '发送中...' : '发送'"> {{
sendTextLoading ? '发送中' : '发送' }}</el-button>
<div style="text-align: end;clear: both;">
<el-button type="primary" class="send-btn" @click="sendTextMessage"
:loading="sendTextLoading" :loading-text="sendTextLoading ? '发送中...' : '发送'"> {{
sendTextLoading ? '发送中' : '发送' }}</el-button>
</div>
</div>
</div>
</el-col>
</el-row>
@ -310,9 +313,12 @@ const getList = async () => {
targetModeId = matchedMode.id;
}
setActiveLightMode(targetModeId);
const laserStatus = res.data.laserLightMode;
const laserStatus = Number(res.data.laserLightMode);
laserMode.value.active = laserStatus === 1;
laserMode.value.switchStatus = laserStatus === 1;
setTimeout(() => {
console.log('延迟检查激光状态:', laserMode.value.active, laserMode.value.switchStatus);
}, 1000);
} catch (error) {
console.error("获取设备详情失败:", error);
setActiveLightMode("strong"); // 异常时默认强光
@ -614,11 +620,11 @@ onMounted(async () => {
connect();
});
onUnmounted(() => {
// 只有当连接已建立时,才执行断开操作(避免无效调用)
if (connected.value) {
console.log('页面离开断开MQTT连接');
disconnect(); // 调用断开连接方法
}
// 只有当连接已建立时,才执行断开操作(避免无效调用)
if (connected.value) {
console.log('页面离开断开MQTT连接');
disconnect(); // 调用断开连接方法
}
});
</script>
@ -657,7 +663,7 @@ onUnmounted(() => {
background: white;
padding: 0px 20px 50px;
border: 1px solid #ebeef5;
height: 100%;
height: 250px;
position: relative;
}
@ -730,7 +736,6 @@ onUnmounted(() => {
}
.brightness-alarm {
display: flex;
justify-content: space-between;
@ -840,9 +845,9 @@ onUnmounted(() => {
}
.message-content {
display: flex;
flex-direction: column;
gap: 10px;
// display: flex;
// flex-direction: column;
// gap: 10px;
.el-textarea {
border: 1px solid rgba(29, 111, 255, 1);
@ -861,7 +866,9 @@ onUnmounted(() => {
padding: 10px 20px;
border-radius: 29px;
background: rgba(2, 124, 251, 1);
border: none
border: none;
margin: 20px 0px 30px 0;
}
}