Files
app-govern/pages/message1/steadyState.vue

392 lines
13 KiB
Vue
Raw Normal View History

2026-03-17 14:00:55 +08:00
<template>
<view style="position: relative">
<!-- 稳态 -->
<view class="transientBox">
<view class="statistics pd20">
2026-04-13 10:12:04 +08:00
<view
class="box"
:class="{ boxClick: item.label == filterValue }"
v-for="item in list"
2026-04-17 08:50:07 +08:00
@click="
filterValue = item.label
init()
"
2026-04-13 10:12:04 +08:00
>
2026-03-17 14:00:55 +08:00
<text class="num">{{ item.value }}</text>
<text class="label">{{ item.label }}</text>
</view>
</view>
</view>
<!-- 越限数量 -->
2026-03-30 08:43:13 +08:00
<scroll-view
v-if="filterValue == '越限数量'"
2026-03-30 08:43:13 +08:00
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 + height) + '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 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-kouanjiancedian"
size="40"
color="#E6A23C"
2026-04-17 08:50:07 +08:00
></uni-icons> -->
<Cn-icon-transient :name="`稳态越限`" />
<view class="badge1" v-if="item.isRead == 0"></view>
2026-03-17 14:00:55 +08:00
</view>
<view class="event-info">
<view class="event-title">
<text class="event-id">{{ item.lineName }}</text>
</view>
<view class="event-desc">
<text>工程名称{{ item.engineeringName }}</text>
<text>项目名称{{ item.projectName }}</text>
<text>设备名称{{ item.devName }}</text>
2026-03-30 08:43:13 +08:00
<!-- <text>统计日期{{ item.statisticsDate }}</text> -->
2026-03-17 14:00:55 +08:00
</view>
</view>
2026-03-30 08:43:13 +08:00
<view class="event-action">
<uni-icons type="search" size="25" color="#376cf3"></uni-icons>
2026-03-30 08:43:13 +08:00
</view>
2026-03-17 14:00:55 +08:00
</view>
<!-- 详情区域 -->
2026-04-17 08:50:07 +08:00
<view class="event-detail textBox" @touchmove.stop>
<text>{{ item.statisticsDate }}发生 {{ item.overLimitDesc }}</text>
2026-03-17 14:00:55 +08:00
</view>
</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-04-13 10:12:04 +08:00
<!-- 越限天数 -->
<view v-if="filterValue == '越限天数'">
<uni-calendar
:insert="true"
:lunar="false"
:date="startData"
:selected="selected"
:start-date="startData"
:end-date="endData"
/>
</view>
2026-04-17 08:50:07 +08:00
<!-- 越限测点数 -->
<scroll-view
v-if="filterValue == '越限测点数'"
scroll-y="true"
@refresherrefresh="refresherrefresh"
@scrolltolower="scrolltolower"
:refresher-triggered="triggered"
refresher-enabled="true"
class="event-list"
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
>
<!-- 循环渲染事件项 -->
<uni-card class="event-item" :class="item.type" v-for="(item, index) in store.data" :key="index">
<!-- 头部图标 + 信息 + 操作 -->
<view class="event-header">
<view class="event-icon">
<!-- 动态图标根据类型切换 -->
<!-- <uni-icons
custom-prefix="iconfont"
type="icon-kouanjiancedian"
size="40"
color="#E6A23C"
></uni-icons> -->
<Cn-icon-transient :name="`稳态越限`" />
</view>
<view class="event-info">
<view class="event-title">
<text class="event-id">{{ item.lineName }}</text>
</view>
<view class="event-desc">
<text>工程名称{{ item.engineeringName }}</text>
<text>项目名称{{ item.projectName }}</text>
<text>设备名称{{ item.devName }}</text>
<!-- <text>统计日期{{ item.statisticsDate }}</text> -->
</view>
</view>
</view>
<!-- 详情区域 -->
<view class="event-detail">
<uni-calendar
:insert="true"
:lunar="false"
:date="startData"
:selected="item.timeList.map((date) => ({ date, info: '' }))"
:start-date="startData"
:end-date="endData"
/>
</view>
</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>
</scroll-view>
2026-03-17 14:00:55 +08:00
</view>
</template>
<script>
import list from '@/common/js/list'
2026-04-17 08:50:07 +08:00
import { queryAppHarmonicCounts, queryAppHarmonicLine } from '../../common/api/harmonic.js'
2026-03-17 14:00:55 +08:00
export default {
components: {},
props: {
navHeight: {
type: Number,
default: 0,
},
selectValue: {
type: Object,
// default: () => {},
},
},
mixins: [list],
data() {
return {
height: 0,
filterValue: '越限数量',
2026-03-17 14:00:55 +08:00
list: [
{ value: 0, label: '越限数量' },
2026-03-17 14:00:55 +08:00
{ value: 0, label: '越限天数' },
{ value: 0, label: '越限测点数' },
],
2026-04-13 10:12:04 +08:00
startData: '',
endData: '',
selected: [
2026-04-17 08:50:07 +08:00
// { date: '2026-04-10', info: '' },
// { date: '2026-04-11', info: '' },
// { date: '2026-04-12', info: '' },
2026-04-13 10:12:04 +08:00
],
2026-04-17 08:50:07 +08:00
2026-03-30 08:43:13 +08:00
triggered: true,
2026-03-17 14:00:55 +08:00
status: 'noMore', //more加载前 loading加载中 noMore加载后
}
},
mounted() {
uni.createSelectorQuery()
.select('.transientBox')
.boundingClientRect((rect) => {
//
// #ifdef H5
this.height = rect.height
// #endif
// #ifdef APP-PLUS
this.height = rect.height
// #endif
})
.exec()
},
methods: {
// "devId": "",
// "engineerId": "",
// "lineId": "",
// "projectId": "",
// "time": ""
// 查詢
init() {
2026-04-17 08:50:07 +08:00
if (this.filterValue == '越限测点数') {
this.store = this.DataSource('/cs-harmonic-boot/csHarmonic/queryAppHarmonicLine')
} else {
this.store = this.DataSource('/cs-harmonic-boot/csHarmonic/queryHarmonicList')
}
// 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
2026-04-13 10:12:04 +08:00
2026-03-17 14:00:55 +08:00
this.store.loadedCallback = () => {
this.loading = false
2026-04-13 10:12:04 +08:00
this.startData = this.$util.getMonthFirstAndLastDay(this.selectValue.date).firstDay
this.endData = this.$util.getMonthFirstAndLastDay(this.selectValue.date).lastDay
2026-04-17 08:50:07 +08:00
// 查询越限日期
queryAppHarmonicCounts(this.store.params).then((res) => {
this.list[0].value = res.data.harmonicNums
this.list[1].value = res.data.overDays
this.list[2].value = res.data.overLineNums
this.selected = res.data.overDaysList.map((date) => ({ date, info: '' }))
})
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/steadyStateDetails?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';
.box:first-child {
flex: 1.3 !important;
}
2026-03-17 14:00:55 +08:00
/* 列表容器 */
.event-list {
/* 头部:图标 + 信息 + 操作 */
.event-header {
display: flex;
align-items: center;
margin-bottom: 10rpx;
}
/* 图标区域(按类型区分背景色) */
.event-icon {
2026-04-17 08:50:07 +08:00
background-color: #376cf320;
2026-03-17 14:00:55 +08:00
}
.event-tags {
font-size: 24rpx;
}
}
2026-03-30 08:43:13 +08:00
/deep/ .uni-scroll-view-refresher {
display: none;
}
2026-04-03 14:48:45 +08:00
.textBox {
max-height: 110rpx;
2026-04-17 08:50:07 +08:00
overflow-y: auto;
// overflow: hidden;
2026-04-03 14:48:45 +08:00
/* 下面是溢出显示省略号关键样式 */
2026-04-17 08:50:07 +08:00
// display: -webkit-box;
// -webkit-line-clamp: 3; /* 控制最多显示几行,你可以改 2/3/4 */
// -webkit-box-orient: vertical;
// text-overflow: ellipsis;
// word-break: break-all;
2026-04-03 14:48:45 +08:00
}
2026-04-13 10:12:04 +08:00
/deep/ .uni-calendar-item--checked {
background-color: #ffffff00;
color: #000000e6;
opacity: 1;
}
2026-04-13 10:12:04 +08:00
/deep/ .uni-calendar-item--isDay {
background-color: #ffffff00;
color: #000000e6;
opacity: 1;
2026-04-13 10:12:04 +08:00
.uni-calendar-item__weeks-lunar-text {
background-color: #ffffff00;
color: #000000e6;
opacity: 1;
}
}
/deep/ .uni-calendar-item__weeks-box-text {
z-index: 1;
}
2026-04-17 08:50:07 +08:00
/deep/ .uni-calendar-item--isDay-text {
color: #333 !important; /* 改成你想要的颜色 */
}
2026-04-13 10:12:04 +08:00
/deep/ .uni-calendar-item__weeks-box-circle {
position: absolute;
2026-04-17 08:50:07 +08:00
top: 7px;
right: 6px;
2026-04-13 10:12:04 +08:00
width: 39px;
height: 39px;
border-radius: 50%;
z-index: 0;
2026-04-24 09:13:17 +08:00
background-color: #e6a23c;
2026-04-13 10:12:04 +08:00
}
2026-04-13 10:12:04 +08:00
/* 核心:选中圆圈下的 子元素(日期数字) */
/deep/ .uni-calendar-item__weeks-box-circle + .uni-calendar-item__weeks-box-text {
color: #fff !important; /* 改成你想要的颜色 */
}
2026-04-13 10:12:04 +08:00
/deep/ .uni-calendar__backtoday,
/deep/ .uni-calendar__header-btn-box {
display: none;
}
2026-04-17 08:50:07 +08:00
/deep/ .uni-calendar-item__weeks-lunar-text {
display: none;
}
2026-04-13 10:12:04 +08:00
/deep/ .uni-calendar__header {
pointer-events: none !important;
}
2026-04-17 08:50:07 +08:00
.event-detail {
/deep/ .uni-calendar__header {
display: none !important;
}
2026-04-17 08:50:07 +08:00
/deep/ .uni-calendar__weeks-day {
height: 35px;
}
2026-04-17 08:50:07 +08:00
/deep/ .uni-calendar-item__weeks-box-item {
height: 40px;
}
2026-04-17 08:50:07 +08:00
/deep/ .uni-calendar-item__weeks-box-circle {
position: absolute;
top: 3px;
right: 8px;
width: 35px;
height: 35px;
}
}
2026-03-17 14:00:55 +08:00
</style>