2026-03-17 14:00:55 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<Cn-page :loading="loading">
|
|
|
|
|
|
<view class="detail" slot="body">
|
|
|
|
|
|
<view class="detail-content" style="font-size: 32rpx">
|
|
|
|
|
|
<!-- <view class="detail-content-title mb20">发生时间</view> -->
|
|
|
|
|
|
<view>{{ detail.date }}</view>
|
|
|
|
|
|
</view>
|
2026-03-30 08:43:13 +08:00
|
|
|
|
<view class="detail-content" style="padding: 0px">
|
|
|
|
|
|
<view class="detail-content-title mb20 pt20 pl20">终端告警列表</view>
|
2026-03-17 14:00:55 +08:00
|
|
|
|
|
2026-03-30 08:43:13 +08:00
|
|
|
|
<!-- <uni-collapse accordion v-model="collapseValue">
|
2026-03-17 14:00:55 +08:00
|
|
|
|
<uni-collapse-item :title="item.devName" v-for="item in list">
|
|
|
|
|
|
<template v-slot:title>
|
|
|
|
|
|
<view class="collapseTop">
|
|
|
|
|
|
<view class="mb5 name"> {{ item.devName }}</view>
|
|
|
|
|
|
<view class="mb5 frequency">
|
|
|
|
|
|
<view class="mr20"> 告警次数: {{ item.warnCounts }} 次</view>
|
|
|
|
|
|
<view> 通讯中断: {{ item.interruptCounts }} 次</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<view>
|
|
|
|
|
|
<view class="mb10 ml12 frequency">
|
|
|
|
|
|
<view>项目名称:{{ item.projectName }} </view></view
|
|
|
|
|
|
>
|
|
|
|
|
|
<view class="mb10 ml12 frequency">
|
|
|
|
|
|
<view>工程名称:{{ item.engineeringName }}</view></view
|
|
|
|
|
|
>
|
|
|
|
|
|
<view class="mb10 ml12 frequency">
|
|
|
|
|
|
<view>通讯信息:</view>
|
|
|
|
|
|
<view style="flex: 1">
|
|
|
|
|
|
<view v-if="item.interruptCounts == 0">通讯正常</view>
|
|
|
|
|
|
<view v-else>通讯中断{{ item.interruptCounts }}次,具体如下所示:</view
|
|
|
|
|
|
><view v-for="date in item.interruptDetails" class="mt15 textBox">{{
|
|
|
|
|
|
date
|
|
|
|
|
|
}}</view></view
|
|
|
|
|
|
></view
|
|
|
|
|
|
>
|
|
|
|
|
|
<view class="mb10 ml12 frequency">
|
|
|
|
|
|
<view>告警信息:</view>
|
|
|
|
|
|
<view style="flex: 1">
|
|
|
|
|
|
<view v-if="item.warnCounts == 0">暂无终端告警信息</view>
|
|
|
|
|
|
<view v-else>终端告警{{ item.warnCounts }}次,具体如下所示:</view
|
|
|
|
|
|
><view v-for="val in item.warnDetails" class="mt15 textBox">
|
|
|
|
|
|
{{ val.warnEventTime + '发生' + val.warnEventDesc }}
|
|
|
|
|
|
</view></view
|
|
|
|
|
|
></view
|
|
|
|
|
|
>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</uni-collapse-item>
|
2026-03-30 08:43:13 +08:00
|
|
|
|
</uni-collapse> -->
|
|
|
|
|
|
<view class="event-list">
|
2026-04-01 10:00:04 +08:00
|
|
|
|
<uni-card class="event-item" :class="item.type" v-for="(item, index) in list" :key="index">
|
2026-03-30 08:43:13 +08:00
|
|
|
|
<!-- 头部:图标 + 信息 + 操作 -->
|
|
|
|
|
|
<view class="event-header">
|
|
|
|
|
|
<view class="event-icon">
|
|
|
|
|
|
<!-- 动态图标:根据类型切换 -->
|
|
|
|
|
|
<uni-icons
|
|
|
|
|
|
custom-prefix="iconfont"
|
|
|
|
|
|
type="icon-terminal-box-fill"
|
|
|
|
|
|
size="35"
|
|
|
|
|
|
color="#FF0000"
|
|
|
|
|
|
></uni-icons>
|
|
|
|
|
|
<view class="badge1" v-if="item.status == 0"> </view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="event-info">
|
|
|
|
|
|
<view class="event-title">
|
|
|
|
|
|
<text class="event-id">{{ item.devName }}</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="event-desc">
|
|
|
|
|
|
<text>工程名称:{{ item.engineeringName }}</text>
|
|
|
|
|
|
<text>项目名称:{{ item.projectName }}</text>
|
|
|
|
|
|
<!-- <text>事件时间:{{ item.startTime }}</text> -->
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<!-- 详情区域 -->
|
|
|
|
|
|
<view class="event-detail">
|
2026-04-01 10:00:04 +08:00
|
|
|
|
<uni-collapse>
|
2026-03-30 08:43:13 +08:00
|
|
|
|
<uni-collapse-item
|
|
|
|
|
|
:title="
|
|
|
|
|
|
item.interruptCounts == 0 ? '通讯正常' : `通讯中断 ${item.interruptCounts} 次`
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
2026-04-01 10:00:04 +08:00
|
|
|
|
<view
|
|
|
|
|
|
v-for="date in String(item.interruptDetails || '').split(',')"
|
|
|
|
|
|
class="textBox mb10"
|
|
|
|
|
|
>{{ date }}</view
|
|
|
|
|
|
>
|
2026-03-30 08:43:13 +08:00
|
|
|
|
</uni-collapse-item>
|
|
|
|
|
|
<uni-collapse-item
|
|
|
|
|
|
:title="
|
|
|
|
|
|
item.warnCounts == 0 ? '暂无终端告警信息' : `终端告警 ${item.warnCounts} 次`
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
<view v-for="val in item.warnDetails" class="textBox mb10">
|
|
|
|
|
|
{{ val.warnEventTime + '发生' + val.warnEventDesc }}
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</uni-collapse-item>
|
|
|
|
|
|
</uni-collapse>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</uni-card>
|
|
|
|
|
|
</view>
|
2026-03-17 14:00:55 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</Cn-page>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import { updateStatus, queryAlarmDetail } from '@/common/api/message'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
loading: true,
|
|
|
|
|
|
detail: {},
|
|
|
|
|
|
limit: '',
|
2026-03-30 08:43:13 +08:00
|
|
|
|
collapseValue: '0',
|
2026-03-17 14:00:55 +08:00
|
|
|
|
|
|
|
|
|
|
list: [],
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
onLoad(options) {
|
2026-03-30 08:43:13 +08:00
|
|
|
|
this.loading = true
|
2026-03-17 14:00:55 +08:00
|
|
|
|
this.detail = JSON.parse(decodeURIComponent(options.detail).replace(/百分比/g, '%'))
|
|
|
|
|
|
this.init()
|
|
|
|
|
|
if (this.detail.isRead != 1) {
|
|
|
|
|
|
updateStatus({
|
|
|
|
|
|
eventIds: [this.detail.eventId],
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
init() {
|
|
|
|
|
|
queryAlarmDetail({
|
|
|
|
|
|
devList: this.detail.devIds,
|
|
|
|
|
|
time: this.detail.date,
|
|
|
|
|
|
})
|
|
|
|
|
|
.then((res) => {
|
|
|
|
|
|
this.list = res.data
|
|
|
|
|
|
this.loading = false
|
|
|
|
|
|
})
|
|
|
|
|
|
.catch(() => {
|
|
|
|
|
|
this.loading = false
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
2026-03-30 08:43:13 +08:00
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
@import '../index.scss';
|
2026-03-17 14:00:55 +08:00
|
|
|
|
.detail {
|
|
|
|
|
|
padding: 20rpx 0;
|
|
|
|
|
|
|
|
|
|
|
|
.detail-content {
|
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
margin-bottom: 20rpx;
|
2026-03-30 08:43:13 +08:00
|
|
|
|
font-size: 26rpx;
|
2026-03-17 14:00:55 +08:00
|
|
|
|
|
|
|
|
|
|
.detail-content-title {
|
2026-03-30 08:43:13 +08:00
|
|
|
|
font-size: 30rpx;
|
2026-03-17 14:00:55 +08:00
|
|
|
|
color: #111;
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.collapseTop {
|
|
|
|
|
|
padding: 10rpx 0;
|
|
|
|
|
|
margin-left: 15px;
|
|
|
|
|
|
.name {
|
2026-03-30 08:43:13 +08:00
|
|
|
|
font-size: 28rpx;
|
2026-03-17 14:00:55 +08:00
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.frequency {
|
|
|
|
|
|
display: flex;
|
2026-03-30 08:43:13 +08:00
|
|
|
|
font-size: 26rpx;
|
2026-03-17 14:00:55 +08:00
|
|
|
|
// color: #666666;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.textBox {
|
|
|
|
|
|
border-bottom: 1px solid #eee;
|
2026-03-30 08:43:13 +08:00
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
|
color: #666666;
|
2026-04-01 10:00:04 +08:00
|
|
|
|
text-indent: 2em;
|
2026-03-30 08:43:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
.event-list {
|
|
|
|
|
|
background: #fff;
|
2026-04-01 10:00:04 +08:00
|
|
|
|
padding-bottom: 10rpx;
|
2026-03-30 08:43:13 +08:00
|
|
|
|
.event-icon {
|
|
|
|
|
|
width: 90rpx;
|
|
|
|
|
|
height: 90rpx;
|
|
|
|
|
|
background-color: #ff000020;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/deep/ .uni-collapse-item__title-box {
|
|
|
|
|
|
padding: 0 15px 0 0;
|
|
|
|
|
|
height: 56rpx;
|
|
|
|
|
|
line-height: 56rpx;
|
|
|
|
|
|
font-size: 26rpx !important;
|
|
|
|
|
|
color: #666666;
|
|
|
|
|
|
span {
|
|
|
|
|
|
font-size: 26rpx !important;
|
|
|
|
|
|
}
|
2026-03-17 14:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|