系统状态

main
Lufaneng 6 months ago
parent ce890b9099
commit d8f18e55b7

@ -37,8 +37,12 @@
<div class="status-item"> <div class="status-item">
版本号1.0.0 版本号1.0.0
</div> </div>
<div class="status-item"> <div class="status-item" v-if="status !== -1">
系统状态<span class="status-online">开启</span> 系统状态
<span v-if="status === 1" class="status-online"></span>
<span v-else-if="status === 0" class="status-offline">关闭</span>
<span v-else class="status-offline">{{ status }}</span>
</div> </div>
</div> </div>
</div> </div>
@ -54,6 +58,7 @@ import {
VideoPlay, VideoPlay,
Bell Bell
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import RPC from '@/utils/rpc'
const currentTime = ref('') const currentTime = ref('')
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
@ -65,9 +70,16 @@ if (route.query.deviceName) {
localStorage.setItem('central_control_device_name', route.query.deviceName) localStorage.setItem('central_control_device_name', route.query.deviceName)
} }
const commit_uid = localStorage.getItem('central_control_comm_uid') const commit_uid = localStorage.getItem('central_control_comm_uid')
const device_name = localStorage.getItem('central_control_device_name') 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 = [ const functionCards = [
{ key: 'monitor', title: '实时监控', icon: Camera, route: '/monitoring' }, { key: 'monitor', title: '实时监控', icon: Camera, route: '/monitoring' },
{ key: 'control', title: '手动控制', icon: Operation, route: '/handle-control' }, { key: 'control', title: '手动控制', icon: Operation, route: '/handle-control' },
@ -315,6 +327,11 @@ onUnmounted(() => {
font-weight: bold; font-weight: bold;
} }
.status-offline {
color: #f12323;
font-weight: bold;
}
/* Element Plus 卡片样式重写 */ /* Element Plus 卡片样式重写 */
:deep(.el-card) { :deep(.el-card) {
background: transparent !important; background: transparent !important;

Loading…
Cancel
Save