2 changed files with 182 additions and 90 deletions
@ -0,0 +1,147 @@ |
|||||
|
<template> |
||||
|
<t-dialog |
||||
|
:visible="visible" |
||||
|
:header="title" |
||||
|
width="700px" |
||||
|
destroy-on-close |
||||
|
:footer="false" |
||||
|
dialog-class-name="dock-status-dialog" |
||||
|
@update:visible="onVisibleUpdate" |
||||
|
@close="emit('close')" |
||||
|
> |
||||
|
<div class="dock-status-body"> |
||||
|
<div class="dock-status-grid"> |
||||
|
<div> |
||||
|
<span>设备连接</span> |
||||
|
<strong :class="{ 'green-text': summary.online }">{{ summary.connection }}</strong> |
||||
|
<small>{{ summary.connectionHint }}</small> |
||||
|
</div> |
||||
|
<div> |
||||
|
<span>无人机状态</span> |
||||
|
<strong>{{ summary.drone }}</strong> |
||||
|
<small>{{ summary.droneHint }}</small> |
||||
|
</div> |
||||
|
<div> |
||||
|
<span>舱门状态</span> |
||||
|
<strong>{{ summary.door }}</strong> |
||||
|
<small>{{ summary.doorHint }}</small> |
||||
|
</div> |
||||
|
<div> |
||||
|
<span>充电模块</span> |
||||
|
<strong :class="{ 'green-text': chargeActive }">{{ summary.charge }}</strong> |
||||
|
<small>{{ summary.chargeHint }}</small> |
||||
|
</div> |
||||
|
<div> |
||||
|
<span>控制模式</span> |
||||
|
<strong>{{ summary.mode }}</strong> |
||||
|
<small>{{ summary.modeHint }}</small> |
||||
|
</div> |
||||
|
<div> |
||||
|
<span>当前告警</span> |
||||
|
<strong :class="{ 'green-text': !summary.alarmCount }">{{ summary.alarm }}</strong> |
||||
|
<small>{{ summary.alarmHint }}</small> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<section class="dock-state-section"> |
||||
|
<div class="dock-state-heading"> |
||||
|
<h4>状态</h4> |
||||
|
<span>PLC 实时反馈 · {{ updatedText }}</span> |
||||
|
</div> |
||||
|
<div class="dock-state-board"> |
||||
|
<article> |
||||
|
<h5>舱门状态</h5> |
||||
|
<ul> |
||||
|
<li :class="{ active: board.leftClosed }"><i></i>左顶门关</li> |
||||
|
<li :class="{ active: board.leftOpen }"><i></i>左顶门开</li> |
||||
|
<li :class="{ active: board.rightClosed }"><i></i>右顶门关</li> |
||||
|
<li :class="{ active: board.rightOpen }"><i></i>右顶门开</li> |
||||
|
</ul> |
||||
|
</article> |
||||
|
<article> |
||||
|
<h5>杆件状态</h5> |
||||
|
<ul> |
||||
|
<li :class="{ active: board.lrTight }"><i></i>左右归中闭合</li> |
||||
|
<li :class="{ active: board.lrLoose }"><i></i>左右归中打开</li> |
||||
|
<li :class="{ active: board.fbTight }"><i></i>前后归中闭合</li> |
||||
|
<li :class="{ active: board.fbLoose }"><i></i>前后归中打开</li> |
||||
|
</ul> |
||||
|
</article> |
||||
|
<article> |
||||
|
<h5>系统状态</h5> |
||||
|
<ul> |
||||
|
<li :class="{ active: board.emergencyStop }"><i :class="{ warning: board.emergencyStop }"></i>急停</li> |
||||
|
<li :class="{ active: board.autoMode }"><i></i>自动模式</li> |
||||
|
<li :class="{ active: board.noAlarm }"><i></i>无报警</li> |
||||
|
<li :class="{ active: board.resetDone }"><i></i>复位完成</li> |
||||
|
</ul> |
||||
|
</article> |
||||
|
<article> |
||||
|
<h5>充电与在位</h5> |
||||
|
<ul> |
||||
|
<li :class="{ active: board.charging }"><i></i>充电中</li> |
||||
|
<li :class="{ active: board.chargeIdle }"><i></i>充电空闲</li> |
||||
|
<li :class="{ active: board.dronePresent }"><i></i>无人机在位</li> |
||||
|
<li :class="{ active: board.powerOnline }"><i></i>电源在线</li> |
||||
|
</ul> |
||||
|
</article> |
||||
|
</div> |
||||
|
</section> |
||||
|
</div> |
||||
|
</t-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script setup> |
||||
|
defineProps({ |
||||
|
visible: { type: Boolean, default: false }, |
||||
|
title: { type: String, default: '机巢' }, |
||||
|
summary: { |
||||
|
type: Object, |
||||
|
default: () => ({ |
||||
|
online: false, |
||||
|
connection: '--', |
||||
|
connectionHint: '', |
||||
|
drone: '--', |
||||
|
droneHint: '', |
||||
|
door: '--', |
||||
|
doorHint: '', |
||||
|
charge: '--', |
||||
|
chargeHint: '', |
||||
|
mode: '--', |
||||
|
modeHint: '', |
||||
|
alarmCount: 0, |
||||
|
alarm: '--', |
||||
|
alarmHint: '', |
||||
|
}), |
||||
|
}, |
||||
|
chargeActive: { type: Boolean, default: false }, |
||||
|
updatedText: { type: String, default: '刚刚' }, |
||||
|
board: { |
||||
|
type: Object, |
||||
|
default: () => ({ |
||||
|
leftClosed: false, |
||||
|
leftOpen: false, |
||||
|
rightClosed: false, |
||||
|
rightOpen: false, |
||||
|
lrTight: false, |
||||
|
lrLoose: false, |
||||
|
fbTight: false, |
||||
|
fbLoose: false, |
||||
|
emergencyStop: false, |
||||
|
autoMode: false, |
||||
|
noAlarm: false, |
||||
|
resetDone: false, |
||||
|
charging: false, |
||||
|
chargeIdle: false, |
||||
|
dronePresent: false, |
||||
|
powerOnline: false, |
||||
|
}), |
||||
|
}, |
||||
|
}) |
||||
|
|
||||
|
const emit = defineEmits(['update:visible', 'close']) |
||||
|
|
||||
|
function onVisibleUpdate(next) { |
||||
|
emit('update:visible', next) |
||||
|
} |
||||
|
</script> |
||||
Loading…
Reference in new issue