2026-03-17 14:00:55 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<view style="position: relative">
|
|
|
|
|
|
<!-- 运行告警 -->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 卡片 -->
|
2026-03-30 08:43:13 +08:00
|
|
|
|
<scroll-view
|
|
|
|
|
|
scroll-y="true"
|
|
|
|
|
|
@refresherrefresh="refresherrefresh"
|
2026-04-17 08:50:07 +08:00
|
|
|
|
@scrolltolower="scrolltolower"
|
2026-03-30 08:43:13 +08:00
|
|
|
|
:refresher-triggered="triggered"
|
|
|
|
|
|
refresher-enabled="true"
|
|
|
|
|
|
class="event-list"
|
|
|
|
|
|
:style="{ height: 'calc(100vh - ' + (navHeight + 10) + 'px)', overflow: 'auto' }"
|
|
|
|
|
|
>
|
2026-03-17 14:00:55 +08:00
|
|
|
|
<!-- 循环渲染事件项 -->
|
|
|
|
|
|
<uni-card
|
2026-04-24 09:13:17 +08:00
|
|
|
|
class="event-item boxClick"
|
2026-03-17 14:00:55 +08:00
|
|
|
|
:class="item.type"
|
|
|
|
|
|
v-for="(item, index) in this.store.data"
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
@click="jump(item)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<!-- 头部:图标 + 信息 + 操作 -->
|
|
|
|
|
|
<view class="event-header">
|
|
|
|
|
|
<view class="event-icon">
|
|
|
|
|
|
<!-- 动态图标:根据类型切换 -->
|
2026-04-17 08:50:07 +08:00
|
|
|
|
<!-- <uni-icons
|
2026-03-17 14:00:55 +08:00
|
|
|
|
custom-prefix="iconfont"
|
|
|
|
|
|
type="icon-terminal-box-fill"
|
2026-03-30 08:43:13 +08:00
|
|
|
|
size="30"
|
2026-04-17 08:50:07 +08:00
|
|
|
|
color="#376cf3"
|
|
|
|
|
|
></uni-icons> -->
|
|
|
|
|
|
<Cn-icon-transient :name="`运行告警`" />
|
2026-03-17 14:00:55 +08:00
|
|
|
|
<view class="badge1" v-if="item.isRead == 0"> </view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="event-info">
|
|
|
|
|
|
<view class="event-title">
|
2026-04-17 08:50:07 +08:00
|
|
|
|
<text class="event-id">{{ item.date }}</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="event-desc">
|
|
|
|
|
|
<text>告警终端:{{ item.warnNums }}台</text>
|
|
|
|
|
|
<text>通讯中断:{{ item.interruptCounts }}次</text>
|
|
|
|
|
|
<text>终端告警:{{ item.warnCounts}}次</text>
|
|
|
|
|
|
|
2026-03-17 14:00:55 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
2026-04-17 08:50:07 +08:00
|
|
|
|
<view class="event-action">
|
2026-04-03 14:48:45 +08:00
|
|
|
|
<!-- <uni-icons type="search" size="25" color="#376cf3"></uni-icons> -->
|
2026-04-17 08:50:07 +08:00
|
|
|
|
🔍
|
2026-04-03 14:48:45 +08:00
|
|
|
|
</view>
|
2026-03-17 14:00:55 +08:00
|
|
|
|
</view>
|
2026-04-17 08:50:07 +08:00
|
|
|
|
<!-- <view class="event-detail">
|
|
|
|
|
|
<text> 告警终端{{ item.warnNums }}台 </text>
|
|
|
|
|
|
</view> -->
|
2026-03-17 14:00:55 +08:00
|
|
|
|
</uni-card>
|
|
|
|
|
|
<uni-load-more
|
|
|
|
|
|
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
|
|
|
|
|
|
:status="store.status"
|
|
|
|
|
|
></uni-load-more>
|
|
|
|
|
|
<Cn-empty v-else style="top: 20%"></Cn-empty>
|
2026-03-30 08:43:13 +08:00
|
|
|
|
</scroll-view>
|
2026-03-17 14:00:55 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import list from '@/common/js/list'
|
|
|
|
|
|
export default {
|
|
|
|
|
|
components: {},
|
|
|
|
|
|
props: {
|
|
|
|
|
|
navHeight: {
|
|
|
|
|
|
type: Number,
|
|
|
|
|
|
default: 0,
|
|
|
|
|
|
},
|
|
|
|
|
|
selectValue: {
|
|
|
|
|
|
type: Object,
|
|
|
|
|
|
// default: () => {},
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
mixins: [list],
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2026-03-30 08:43:13 +08:00
|
|
|
|
triggered: true,
|
2026-03-17 14:00:55 +08:00
|
|
|
|
status: 'noMore', //more加载前 loading加载中 noMore加载后
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
mounted() {},
|
|
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
init() {
|
|
|
|
|
|
this.store = this.DataSource('/cs-harmonic-boot/csAlarm/queryAlarmList')
|
2026-04-17 08:50:07 +08:00
|
|
|
|
// this.store.params.pageSize = 10000
|
2026-03-17 14:00:55 +08:00
|
|
|
|
this.store.params.engineerId = this.selectValue.engineeringId
|
|
|
|
|
|
this.store.params.projectId = this.selectValue.projectId
|
|
|
|
|
|
this.store.params.devId = this.selectValue.deviceId
|
|
|
|
|
|
this.store.params.lineId = this.selectValue.lineId
|
|
|
|
|
|
this.store.params.time = this.selectValue.date
|
|
|
|
|
|
this.store.loadedCallback = () => {
|
|
|
|
|
|
this.loading = false
|
|
|
|
|
|
}
|
2026-03-30 08:43:13 +08:00
|
|
|
|
|
2026-03-17 14:00:55 +08:00
|
|
|
|
this.store.reload()
|
|
|
|
|
|
},
|
|
|
|
|
|
jump(item) {
|
|
|
|
|
|
let str = JSON.stringify(item).replace(/%/g, '百分比')
|
|
|
|
|
|
item.status = '1'
|
|
|
|
|
|
uni.navigateTo({ url: '/pages/message1/comp/alarmDetails?detail=' + encodeURIComponent(str) })
|
|
|
|
|
|
},
|
2026-03-30 08:43:13 +08:00
|
|
|
|
// 下拉
|
|
|
|
|
|
refresherrefresh() {
|
|
|
|
|
|
this.triggered = true
|
|
|
|
|
|
uni.startPullDownRefresh()
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
this.triggered = false
|
|
|
|
|
|
}, 500)
|
|
|
|
|
|
},
|
2026-04-17 08:50:07 +08:00
|
|
|
|
// 上拉
|
|
|
|
|
|
scrolltolower() {
|
|
|
|
|
|
if (this.store.status != 'noMore') {
|
|
|
|
|
|
this.store.next && this.store.next()
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2026-03-17 14:00:55 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
computed: {},
|
|
|
|
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
selectValue: {
|
|
|
|
|
|
handler(val, oldVal) {
|
|
|
|
|
|
if (Object.keys(val).length === 0) return
|
|
|
|
|
|
this.init()
|
|
|
|
|
|
},
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
immediate: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
@import './index.scss';
|
|
|
|
|
|
/* 列表容器 */
|
|
|
|
|
|
.event-list {
|
|
|
|
|
|
margin-top: 20rpx;
|
|
|
|
|
|
/* 头部:图标 + 信息 + 操作 */
|
2026-04-17 08:50:07 +08:00
|
|
|
|
// .event-header {
|
|
|
|
|
|
// margin-bottom: 0rpx;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// .event-title {
|
|
|
|
|
|
// margin-bottom: 0rpx;
|
|
|
|
|
|
// }
|
2026-03-17 14:00:55 +08:00
|
|
|
|
|
|
|
|
|
|
/* 图标区域(按类型区分背景色) */
|
|
|
|
|
|
.event-icon {
|
2026-04-17 08:50:07 +08:00
|
|
|
|
// width: 80rpx;
|
|
|
|
|
|
// height: 80rpx;
|
|
|
|
|
|
background-color: #376cf320;
|
2026-03-17 14:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 信息区域 */
|
|
|
|
|
|
.event-info {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-03-30 08:43:13 +08:00
|
|
|
|
/deep/ .uni-scroll-view-refresher {
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
}
|
2026-03-17 14:00:55 +08:00
|
|
|
|
</style>
|