| | |
| | | </view>
|
| | |
|
| | | <view class="info-box">
|
| | | <view class="left flex-sub">
|
| | | <view class="left flex-sub" style="width: 60%;">
|
| | | <view class="title text-sm text-cut">报警信息:</view>
|
| | | <template v-if="item.errorData">
|
| | | <view class="title text-sm text-red">故障 {{item.errorData.length}}</view>
|
| | | <view class="title text-sm text-red text-cut">{{ (item.errorData.length > 0) ? item.errorData[0]:'' }}</view>
|
| | | </template>
|
| | |
|
| | | <template v-if="item.warnData">
|
| | | <view class="title text-sm text-yellow">告警 {{item.warnData.length}}</view>
|
| | | </template>
|
| | | <template v-else-if="item.warnData">
|
| | | <view class="title text-sm text-yellow text-cut"> {{(item.warnData.length > 0) ? item.warnData[0]:''}}</view>
|
| | | </template> |
| | | <view v-if="getErrorCount(item) > 0"> |
| | | <u-tag size="mini" :text="getErrorCount(item)" type="error" plain></u-tag> |
| | | </view> |
| | | <view style="width: 20rpx;"></view> |
| | | <view v-if="getWarnCount(item) > 0"> |
| | | <u-tag size="mini" :text="getWarnCount(item)" type="warning" plain></u-tag> |
| | | </view>
|
| | |
|
| | | </view>
|
| | | <view class="right" style="min-width: 240rpx;">
|
| | |
| | |
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | onShow() {
|
| | | this.startTimer()
|
| | | this.mqttData()
|
| | | },
|
| | | beforeDestroy() {
|
| | | onHide() {
|
| | | this.stopTimer()
|
| | | uni.$off(this.$constant.MQTT_TOPIC_MESSAGE)
|
| | | },
|
| | |
| | |
|
| | |
|
| | | },
|
| | | |
| | | getErrorCount(item){ |
| | | let count = 0; |
| | | if(item.errorData){ |
| | | count += item.errorData.length |
| | | } |
| | | return count; |
| | | }, |
| | | getWarnCount(item){ |
| | | let count = 0; |
| | | if(item.warnData){ |
| | | count += item.warnData.length |
| | | } |
| | | return count; |
| | | }, |
| | | |
| | | startTimer() {
|
| | | this.timer = setInterval(() => {
|
| | | this.queryRealFaultData();
|
| | | //this.queryRealFaultData();
|
| | | }, 3000);
|
| | | },
|
| | | stopTimer() {
|
| | |
| | | case topics.updateEquStatu:
|
| | | this.handleEquipmentStatusUpdate(wdata);
|
| | | break;
|
| | | case topics.realData:
|
| | | case topics.realData: |
| | | this.mergeMqttRealData(wdata);
|
| | | break;
|
| | | case topics.realFaultTopic:
|
| | | case topics.oneceFaultTopic:
|
| | | case topics.oneceFaultTopic: |
| | | this.handleFaultData(wdata);
|
| | | break;
|
| | | }
|