From a31318aa1a0442624abb966a6de0866a0d5feb71 Mon Sep 17 00:00:00 2001 From: fengerli <528575642@qq.com> Date: Thu, 4 Sep 2025 17:33:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E9=9D=A2=E6=9D=BF=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=90=8C=E7=9A=84=E8=AE=BE=E5=A4=87=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=EF=BC=8C=E8=B7=B3=E8=BD=AC=E5=88=B0=E4=B8=8D=E5=90=8C=E7=9A=84?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- src/api/controlCenter/controlPanel/types.ts | 2 +- src/views/controlCenter/210/index.vue | 7 ++++ src/views/controlCenter/6170/index.vue | 37 +++++++++++-------- .../controlCenter/controlPanel/index.vue | 23 +++++++----- 5 files changed, 45 insertions(+), 28 deletions(-) create mode 100644 src/views/controlCenter/210/index.vue diff --git a/.env.development b/.env.development index 5642af4..0490fbf 100644 --- a/.env.development +++ b/.env.development @@ -5,8 +5,8 @@ VITE_APP_TITLE = 云平台管理系统 VITE_APP_ENV = 'development' # 开发环境 -# VITE_APP_BASE_API = 'http://47.120.79.150/backend' -VITE_APP_BASE_API = 'http://192.168.2.23:8000' + VITE_APP_BASE_API = 'http://47.120.79.150/backend' +#VITE_APP_BASE_API = 'http://192.168.2.23:8000' # VITE_APP_BASE_API = 'http://localhost:8000' diff --git a/src/api/controlCenter/controlPanel/types.ts b/src/api/controlCenter/controlPanel/types.ts index bf11a91..1a1ca88 100644 --- a/src/api/controlCenter/controlPanel/types.ts +++ b/src/api/controlCenter/controlPanel/types.ts @@ -3,7 +3,7 @@ export interface deviceQuery { pageNum: number; deviceId: string; deviceName: string; - deviceStatus: string; + onlineStatus: string; deviceMac: string; deviceImei: string; personnelBy: string; diff --git a/src/views/controlCenter/210/index.vue b/src/views/controlCenter/210/index.vue new file mode 100644 index 0000000..29e0d3d --- /dev/null +++ b/src/views/controlCenter/210/index.vue @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/views/controlCenter/6170/index.vue b/src/views/controlCenter/6170/index.vue index 6606d24..2769650 100644 --- a/src/views/controlCenter/6170/index.vue +++ b/src/views/controlCenter/6170/index.vue @@ -113,10 +113,13 @@
- {{ - sendTextLoading ? '发送中' : '发送' }} +
+ {{ + sendTextLoading ? '发送中' : '发送' }} +
+ @@ -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(); // 调用断开连接方法 + } }); @@ -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; + } } diff --git a/src/views/controlCenter/controlPanel/index.vue b/src/views/controlCenter/controlPanel/index.vue index a8578ef..0d957a6 100644 --- a/src/views/controlCenter/controlPanel/index.vue +++ b/src/views/controlCenter/controlPanel/index.vue @@ -45,8 +45,8 @@ - - + + @@ -192,7 +192,7 @@ const initData: PageData<'', deviceQuery> = { pageSize: 10, deviceId: '', deviceName: '', - deviceStatus: '', + onlineStatus: '', deviceMac: '', deviceImei: '', personnelBy: '', @@ -299,10 +299,13 @@ const resetQuery = () => { }; -/** 设备控制跳转 */ +/** 设备控制跳转动态取detailPageUrl字段值,跳转 */ const handleControl = (row: any) => { const deviceId = row.id; - router.push('/controlCenter/6170/' + deviceId); + const detailPageUrl = row.detailPageUrl; + const basePath = detailPageUrl.replace(/\/index$/, ''); + const dynamicPath = `/${basePath}/${deviceId}`; + router.push(dynamicPath); // 跳转路由 }; /** 选择条数 */ @@ -354,12 +357,12 @@ const getDeptTree = async () => { const sendTextMessage = () => { // 防重复提交 if (!queryParams.value.deviceType) { - ElMessage.closeAll(); + ElMessage.closeAll(); proxy?.$modal.msgWarning('请先选择设备类型'); return; } if (ids.value.length == 0) { - ElMessage.closeAll(); + ElMessage.closeAll(); proxy?.$modal.msgWarning('请先选中一条设备'); return; } @@ -368,7 +371,7 @@ const sendTextMessage = () => { // 发送文本消息确认 const submitForm = async () => { if (!form.value.messageToSend) { - ElMessage.closeAll(); + ElMessage.closeAll(); proxy?.$modal.msgWarning('发送消息不能为空'); return } @@ -424,12 +427,12 @@ const cancel = () => { // 强制报警 const forceAlarm = async () => { if (!queryParams.value.deviceType) { - ElMessage.closeAll(); + ElMessage.closeAll(); proxy?.$modal.msgWarning('请先选择设备类型'); return; } if (ids.value.length == 0) { - ElMessage.closeAll(); + ElMessage.closeAll(); proxy?.$modal.msgWarning('请先选中一条设备'); return; }