diff --git a/src/views/Menu/index.vue b/src/views/Menu/index.vue index 5716058..803ca9c 100644 --- a/src/views/Menu/index.vue +++ b/src/views/Menu/index.vue @@ -37,8 +37,12 @@
版本号:1.0.0
-
- 系统状态:开启 +
+ 系统状态: + 开启 + 关闭 + {{ status }} +
@@ -54,6 +58,7 @@ import { VideoPlay, Bell } from '@element-plus/icons-vue' +import RPC from '@/utils/rpc' const currentTime = ref('') const router = useRouter() const route = useRoute() @@ -65,9 +70,16 @@ if (route.query.deviceName) { localStorage.setItem('central_control_device_name', route.query.deviceName) } + const commit_uid = localStorage.getItem('central_control_comm_uid') const device_name = localStorage.getItem('central_control_device_name') +const status = ref(-1) +onMounted(() => { + RPC.post('/m9z/getRelayStatus', { comm_uid: commit_uid }).then(res => { + status.value = res + }) +}) const functionCards = [ { key: 'monitor', title: '实时监控', icon: Camera, route: '/monitoring' }, { key: 'control', title: '手动控制', icon: Operation, route: '/handle-control' }, @@ -315,6 +327,11 @@ onUnmounted(() => { font-weight: bold; } +.status-offline { + color: #f12323; + font-weight: bold; +} + /* Element Plus 卡片样式重写 */ :deep(.el-card) { background: transparent !important;