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

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

@ -5,8 +5,8 @@ VITE_APP_TITLE = 云平台管理系统
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'
# 开发环境 # 开发环境
# VITE_APP_BASE_API = 'http://47.120.79.150/backend' 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://192.168.2.23:8000'
# VITE_APP_BASE_API = 'http://localhost:8000' # VITE_APP_BASE_API = 'http://localhost:8000'

View File

@ -3,7 +3,7 @@ export interface deviceQuery {
pageNum: number; pageNum: number;
deviceId: string; deviceId: string;
deviceName: string; deviceName: string;
deviceStatus: string; onlineStatus: string;
deviceMac: string; deviceMac: string;
deviceImei: string; deviceImei: string;
personnelBy: string; personnelBy: string;

View File

@ -0,0 +1,7 @@
<template>
<div class="device-page p-2">
这是210控制页面
</div>
</template>
<script setup lang="ts"></script>
<style lang="scss" scoped></style>

View File

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

View File

@ -45,8 +45,8 @@
<el-form-item label="设备名称" prop="deviceName"> <el-form-item label="设备名称" prop="deviceName">
<el-input v-model="queryParams.deviceName" placeholder="请输入设备名称" clearable /> <el-input v-model="queryParams.deviceName" placeholder="请输入设备名称" clearable />
</el-form-item> </el-form-item>
<el-form-item label="设备状态" prop="deviceStatus"> <el-form-item label="设备状态" prop="onlineStatus">
<el-select v-model="queryParams.deviceStatus" placeholder="设备状态" clearable> <el-select v-model="queryParams.onlineStatus" placeholder="设备状态" clearable>
<el-option label="在线" value="1"></el-option> <el-option label="在线" value="1"></el-option>
<el-option label="离线" value="0"></el-option> <el-option label="离线" value="0"></el-option>
</el-select> </el-select>
@ -192,7 +192,7 @@ const initData: PageData<'', deviceQuery> = {
pageSize: 10, pageSize: 10,
deviceId: '', deviceId: '',
deviceName: '', deviceName: '',
deviceStatus: '', onlineStatus: '',
deviceMac: '', deviceMac: '',
deviceImei: '', deviceImei: '',
personnelBy: '', personnelBy: '',
@ -299,10 +299,13 @@ const resetQuery = () => {
}; };
/** 设备控制跳转 */ /** 设备控制跳转动态取detailPageUrl字段值跳转 */
const handleControl = (row: any) => { const handleControl = (row: any) => {
const deviceId = row.id; 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); // 跳转路由
}; };
/** 选择条数 */ /** 选择条数 */