fix(APP功能调整): 文档中的第7、8、10没有做;第4点需要再核查下ITIC、F47曲线中的可容忍事件、不可容忍事件的显示是否正确。

This commit is contained in:
dk
2026-05-15 11:16:00 +08:00
parent eb72146e0d
commit 17e47c1f07
17 changed files with 1800 additions and 1664 deletions

View File

@@ -37,21 +37,22 @@
{{ device.equipmentName }} {{ device.equipmentName }}
</text> </text>
<text class="uni-card__header-content-subtitle uni-ellipsis"> <text class="uni-card__header-content-subtitle uni-ellipsis">
{{ device.mac }} <!-- {{ device.mac }}-->
</text> </text>
<view class="tagBox"> <view class="tagBox">
<text class="event-tag" :class="device.runStatus == 1 ? 'lx-tag' : 'zx-tag'">{{ <text class="event-tag" :class="device.runStatus == 1 ? 'lx-tag' : 'zx-tag'">
device.runStatus == 1 ? '离线' : '在线' {{ device.runStatus == 1 ? '离线' : '在线' }}
}}</text> </text>
<text <text
class="event-tag" class="event-tag"
:class="device.devType == 'Direct_Connected_Device' ? 'zl-tag' : 'jc-tag'" :class="device.devType == 'Direct_Connected_Device' ? 'zl-tag' : 'jc-tag'"
> >
{{ device.devType == 'Direct_Connected_Device' ? '治理设备' : '监测设备' }} {{ device.devType == 'Direct_Connected_Device' ? '治理设备' : '监测设备' }}
</text> </text>
<text class="event-tag" :class="device.isPrimaryUser == 1 ? 'z-tag' : 'fx-tag'">{{ <text class="event-tag" :class="device.isPrimaryUser == 1 ? 'z-tag' : 'fx-tag'">
device.isPrimaryUser == 1 ? '设备' : '分享设备' {{ device.isPrimaryUser == 1 ? '我的设备' : '他人设备' }}
}}</text></view </text>
</view
> >
</view> </view>
</view> </view>
@@ -76,7 +77,7 @@
<text>{{ device.process == 2 ? '功能调试' : '出厂调试' }}</text> <text>{{ device.process == 2 ? '功能调试' : '出厂调试' }}</text>
</view> </view>
</view> </view>
<view class="pinToTop" v-if="device.isTop == 1"> 置顶 </view> <view class="pinToTop" v-if="device.isTop == 1"> 置顶</view>
</uni-card> </uni-card>
</template> </template>
<script> <script>
@@ -87,7 +88,8 @@ export default {
props: { props: {
device: { device: {
type: Object, type: Object,
default: () => {}, default: () => {
},
}, },
}, },
methods: { methods: {
@@ -152,6 +154,7 @@ export default {
line-height: 1.2; line-height: 1.2;
} }
} }
.uni-card { .uni-card {
/deep/ .uni-card__header-box { /deep/ .uni-card__header-box {
display: flex; display: flex;
@@ -160,6 +163,7 @@ export default {
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
} }
/deep/ .uni-card__header { /deep/ .uni-card__header {
display: flex; display: flex;
border-bottom: 2rpx #ebeef5 solid; border-bottom: 2rpx #ebeef5 solid;
@@ -169,16 +173,20 @@ export default {
overflow: hidden; overflow: hidden;
} }
} }
.uni-card .uni-card__header .uni-card__header-content .uni-card__header-content-title { .uni-card .uni-card__header .uni-card__header-content .uni-card__header-content-title {
font-size: 30rpx; font-size: 30rpx;
color: #3a3a3a; color: #3a3a3a;
font-weight: 700; font-weight: 700;
} }
.uni-card .uni-card__header .uni-card__header-content .uni-card__header-content-subtitle { .uni-card .uni-card__header .uni-card__header-content .uni-card__header-content-subtitle {
margin-top: 15rpx;
font-size: 24rpx; font-size: 24rpx;
// margin-top: 5px; // margin-top: 5px;
color: #666666; color: #666666;
} }
.uni-card .uni-card__header .uni-card__header-avatar .uni-card__header-avatar-image { .uni-card .uni-card__header .uni-card__header-avatar .uni-card__header-avatar-image {
width: 40px; width: 40px;
height: 40px; height: 40px;
@@ -186,6 +194,7 @@ export default {
border-radius: 5px; border-radius: 5px;
margin-right: 10px; margin-right: 10px;
} }
.uni-card .uni-card__header .uni-card__header-content { .uni-card .uni-card__header .uni-card__header-content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -193,10 +202,12 @@ export default {
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
} }
.tagBox { .tagBox {
display: flex; display: flex;
gap: 15rpx; gap: 15rpx;
} }
.event-icon { .event-icon {
position: relative; position: relative;
width: 100rpx; width: 100rpx;
@@ -207,6 +218,7 @@ export default {
align-items: center; align-items: center;
margin-right: 20rpx; margin-right: 20rpx;
} }
.event-tag { .event-tag {
font-size: 22rpx; font-size: 22rpx;
padding: 2rpx 10rpx; padding: 2rpx 10rpx;
@@ -220,28 +232,34 @@ export default {
background-color: #10b98120; background-color: #10b98120;
color: #10b981; color: #10b981;
} }
.lx-tag { .lx-tag {
background-color: #ff3b3020; background-color: #ff3b3020;
color: #ff3b30; color: #ff3b30;
} }
.z-tag { .z-tag {
background-color: #2563eb20; background-color: #2563eb20;
color: #2563eb; color: #2563eb;
} }
.fx-tag { .fx-tag {
background-color: #90939920; background-color: #90939920;
color: #909399; color: #909399;
} }
.zl-tag { .zl-tag {
// background-color: #007aff20; // background-color: #007aff20;
// color: #007aff; // color: #007aff;
background-color: #007aff20; background-color: #007aff20;
color: #007aff; color: #007aff;
} }
.jc-tag { .jc-tag {
background-color: #007aff20; background-color: #007aff20;
color: #007aff; color: #007aff;
} }
.pinToTop { .pinToTop {
background-color: $uni-theme-color; background-color: $uni-theme-color;
width: 100rpx; width: 100rpx;

View File

@@ -588,7 +588,7 @@ export default {
}) })
} }
} }
if (this.userInfo.authorities !== 'tourist') { if (this.userInfo.authorities !== 'tourist' && this.device.isPrimaryUser === '1') {
this.content.splice(0, 0, { this.content.splice(0, 0, {
iconPath: '/static/subordinate.png', iconPath: '/static/subordinate.png',
text: '用户', text: '用户',

View File

@@ -4,7 +4,7 @@
<view class="device"> <view class="device">
<view class="nav" :style="{ top: navTabHeight + 'px' }"> <view class="nav" :style="{ top: navTabHeight + 'px' }">
<view class="nav-menu" @click="selectEngineering" <view class="nav-menu" @click="selectEngineering"
>{{ >{{
select.engineeringName select.engineeringName
? select.engineeringName.length > 6 ? select.engineeringName.length > 6
? select.engineeringName.substring(0, 6) + '...' ? select.engineeringName.substring(0, 6) + '...'
@@ -35,12 +35,12 @@
</picker> </picker>
<picker <picker
@change="runStatusChange" @change="runStatusChange"
:value="select.runStatusIndex" :value="select.runStatusIndex"
:range="projectType" :range="projectType"
range-key="text" range-key="text"
> >
<view class="nav-menu" > <view class="nav-menu">
{{ {{
select.runStatusName select.runStatusName
? select.runStatusName.length > 12 ? select.runStatusName.length > 12
@@ -67,13 +67,13 @@
v-if=" v-if="
userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user' userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'
" "
>移交 >移交
</view> </view>
<view <view
class="nav-menu nav-menu-btn" class="nav-menu nav-menu-btn"
@click="selectDevice('share')" @click="selectDevice('share')"
v-if="userInfo.authorities === 'app_vip_user'" v-if="userInfo.authorities === 'app_vip_user'"
>分享 >分享
</view> </view>
</template> </template>
</view> </view>
@@ -89,7 +89,6 @@
<Cn-device-card :device="item" :key="index"> <Cn-device-card :device="item" :key="index">
<template v-slot:title> <template v-slot:title>
<!-- 卡片标题 --> <!-- 卡片标题 -->
<switch <switch
v-if="transfer || share" v-if="transfer || share"
:checked="checkList.indexOf(item.equipmentId) > -1" :checked="checkList.indexOf(item.equipmentId) > -1"
@@ -97,8 +96,7 @@
@change="switchChange(item)" @change="switchChange(item)"
/> />
<view class="star-icon" v-else> <view class="star-icon" v-else>
<!-- <uni-icons type="search" size="25" color="#376cf3"></uni-icons> --> <uni-icons type="search" size="25" color="#376cf3"></uni-icons>
🔍
</view> </view>
</template> </template>
</Cn-device-card> </Cn-device-card>
@@ -119,6 +117,7 @@ import { getProjectList } from '@/common/api/project'
import { queryDictData } from '@/common/api/dictionary' import { queryDictData } from '@/common/api/dictionary'
import list from '@/common/js/list' import list from '@/common/js/list'
import { engineeringPinToTop } from '@/common/api/device' import { engineeringPinToTop } from '@/common/api/device'
export default { export default {
mixins: [list], mixins: [list],
data() { data() {
@@ -458,15 +457,7 @@ export default {
} else { } else {
this[type] = true this[type] = true
} }
}, }
switchChange(e) {
let index = this.checkList.indexOf(e.equipmentId)
if (index > -1) {
this.checkList.splice(index, 1)
} else {
this.checkList.push(e.equipmentId)
}
},
}, },
} }
</script> </script>

View File

@@ -238,7 +238,7 @@ export default {
}) })
} }
} }
if (this.userInfo.authorities !== 'tourist') { if (this.userInfo.authorities !== 'tourist' && this.device.isPrimaryUser === '1') {
this.content.splice(0, 0, { this.content.splice(0, 0, {
iconPath: '/static/subordinate.png', iconPath: '/static/subordinate.png',
text: '用户', text: '用户',

View File

@@ -44,13 +44,13 @@
class="nav-menu nav-menu-btn" class="nav-menu nav-menu-btn"
@click="selectDevice('transfer')" @click="selectDevice('transfer')"
v-if="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'" v-if="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'"
>移交 >移交
</view> </view>
<view <view
class="nav-menu nav-menu-btn" class="nav-menu nav-menu-btn"
@click="selectDevice('share')" @click="selectDevice('share')"
v-if="userInfo.authorities === 'app_vip_user'" v-if="userInfo.authorities === 'app_vip_user'"
>分享 >分享
</view> </view>
</template> </template>
<!-- <picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text"> <!-- <picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
@@ -70,7 +70,6 @@
<Cn-device-card :device="item" :key="index"> <Cn-device-card :device="item" :key="index">
<template v-slot:title> <template v-slot:title>
<!-- 卡片标题 --> <!-- 卡片标题 -->
<switch <switch
v-if="transfer || share" v-if="transfer || share"
:checked="checkList.indexOf(item.equipmentId) > -1" :checked="checkList.indexOf(item.equipmentId) > -1"
@@ -78,8 +77,7 @@
@change="switchChange(item)" @change="switchChange(item)"
/> />
<view class="star-icon" v-else> <view class="star-icon" v-else>
<!-- <uni-icons type="search" size="25" color="#376cf3"></uni-icons> --> <uni-icons type="search" size="25" color="#376cf3"></uni-icons>
🔍
</view> </view>
</template> </template>
</Cn-device-card> </Cn-device-card>
@@ -97,6 +95,7 @@
import { getProjectList } from '@/common/api/project' import { getProjectList } from '@/common/api/project'
import { queryDictData } from '@/common/api/dictionary' import { queryDictData } from '@/common/api/dictionary'
import { engineeringPinToTop } from '@/common/api/device' import { engineeringPinToTop } from '@/common/api/device'
export default { export default {
props: { props: {
store: { store: {
@@ -167,7 +166,8 @@ export default {
created() { created() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo) this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
}, },
mounted() {}, mounted() {
},
methods: { methods: {
bindClick(e, item) { bindClick(e, item) {
engineeringPinToTop({ engineeringPinToTop({
@@ -373,9 +373,11 @@ export default {
.nav-menu { .nav-menu {
} }
} }
/deep/ .button-group--right { /deep/ .button-group--right {
padding: 0 0 20rpx; padding: 0 0 20rpx;
} }
.star-icon { .star-icon {
font-size: 40rpx; font-size: 40rpx;
} }

View File

@@ -1,324 +1,342 @@
<template> <template>
<Cn-page :loading="loading" class="messageBox" style="padding-top: 10px"> <Cn-page :loading="loading" class="messageBox" style="padding-top: 10px">
<view slot="body" class="message"> <view slot="body" class="message">
<view class="tabsBox"> <view class="tabsBox">
<uni-segmented-control <uni-segmented-control
:current="current" :current="current"
:values="items" :values="items"
style-type="text" style-type="text"
active-color="#376cf3" active-color="#376cf3"
@clickItem="onClickItem" @clickItem="onClickItem"
/> />
<!-- 角标 --> <!-- 角标 -->
<view class="badge-container"> <view class="badge-container">
<span v-for="(item, index) in items" :key="index" class="badge"> <span v-for="(item, index) in items" :key="index" class="badge">
<uni-badge :text="badgeCounts[index] > 99 ? '99+' : badgeCounts[index]" /> <uni-badge :text="badgeCounts[index] > 99 ? '99+' : badgeCounts[index]" />
<!-- {{ badgeCounts[index] > 99 ? '99+' : badgeCounts[index] }} --> <!-- {{ badgeCounts[index] > 99 ? '99+' : badgeCounts[index] }} -->
</span> </span>
</view> </view>
<!-- 筛选条件 --> <!-- 筛选条件 -->
<Cn-filterCriteria <Cn-filterCriteria
ref="cnFilterCriteria" ref="cnFilterCriteria"
:level="current === 0 ? 3 : current === 1 ? 3 : 2" :level="current === 0 ? 3 : current === 1 ? 3 : 2"
@select="select" @select="select"
> >
</Cn-filterCriteria> <picker
</view> v-if="current === 0"
<view class="content"> @change="bindPickerChange"
<Transient :value="sortIndex"
ref="TransientRef" :range="sortOptions"
v-if="current === 0" style="margin-left: auto"
:navHeight="navHeight" >
:selectValue="selectValue" <view class="sort-picker">
@getDevCount="getDevCount" {{ sortOptions[sortIndex] }}排序
/> <uni-icons
<SteadyState custom-prefix="iconfont"
ref="SteadyStateRef" type="icon-paixu1"
v-if="current === 1" size="10"
:navHeight="navHeight" color="#2563EB"
:selectValue="selectValue" ></uni-icons>
@getDevCount="getDevCount" </view>
/> </picker>
<Alarm </Cn-filterCriteria>
ref="AlarmRef" </view>
v-if="current === 2" <view class="content">
:navHeight="navHeight" <Transient
:selectValue="selectValue" ref="TransientRef"
@getDevCount="getDevCount" v-if="current === 0"
/> :navHeight="navHeight"
<Run :selectValue="selectValue"
ref="RunRef" @getDevCount="getDevCount"
v-if="current === 3" />
:navHeight="navHeight" <SteadyState
:selectValue="selectValue" ref="SteadyStateRef"
@getDevCount="getDevCount" v-if="current === 1"
/> :navHeight="navHeight"
</view> :selectValue="selectValue"
</view> @getDevCount="getDevCount"
</Cn-page> />
</template> <Alarm
<script> ref="AlarmRef"
import Transient from '@/pages/message1/transient.vue' v-if="current === 2"
import SteadyState from '@/pages/message1/steadyState.vue' :navHeight="navHeight"
import Alarm from '@/pages/message1/alarm.vue' :selectValue="selectValue"
import Run from '@/pages/message1/run.vue' @getDevCount="getDevCount"
import { getDevCount } from '../../common/api/device.js' />
import { updateStatus } from '@/common/api/message' <Run
export default { ref="RunRef"
components: { Transient, SteadyState, Alarm, Run }, v-if="current === 3"
props: {}, :navHeight="navHeight"
data() { :selectValue="selectValue"
return { @getDevCount="getDevCount"
items: ['暂态事件', '稳态事件'], //'运行告警', '运行事件' />
badgeCounts: [0, 0, 0, 0], </view>
current: 0, </view>
colorIndex: 0, </Cn-page>
item: '', </template>
loading: false, <script>
width: 0, import Transient from '@/pages/message1/transient.vue'
navHeight: 0, import SteadyState from '@/pages/message1/steadyState.vue'
selectValue: {}, import Alarm from '@/pages/message1/alarm.vue'
devCount: [], import Run from '@/pages/message1/run.vue'
// 筛选数据 import { getDevCount } from '../../common/api/device.js'
} import { updateStatus } from '@/common/api/message'
}, export default {
onLoad() {}, components: { Transient, SteadyState, Alarm, Run },
mounted() { props: {},
this.setHeight() data() {
}, return {
onPullDownRefresh() { items: ['暂态事件', '稳态事件'], //'运行告警', '运行事件'
this.refresh() badgeCounts: [0, 0, 0, 0],
}, current: 0,
onNavigationBarButtonTap(e) { colorIndex: 0,
uni.showModal({ item: '',
title: '提示', loading: false,
content: '确定要全部标记为已读吗?', width: 0,
success: (res) => { navHeight: 0,
if (res.confirm) { selectValue: {},
updateStatus({ devCount: [],
// '暂态事件', 0 sortIndex: 0,
// '稳态事件', 1 sortOptions: ['发生时间', '暂降深度', '持续时间'],
// '运行告警', 3 }
// '运行事件' 2 },
type: this.current == 2 ? 3 : this.current == 3 ? 2 : this.current, onLoad() {},
eventIds: [], mounted() {
}).then(() => { this.setHeight()
this.refresh() },
this.getDevCount() onPullDownRefresh() {
}) this.refresh()
} },
}, onNavigationBarButtonTap(e) {
}) uni.showModal({
}, title: '提示',
content: '确定要全部标记为已读吗?',
onShow() { success: (res) => {
if (uni.getStorageSync(this.$cacheKey.userInfo).authorities === 'operation_manager') { if (res.confirm) {
this.items = ['暂态事件', '稳态事件', '运行告警', '运行事件'] updateStatus({
} // '暂态事件', 0
const params = uni.getStorageSync('messageParams') // '稳态事件', 1
this.getDevCount() // '运行告警', 3
this.$nextTick(() => { // '运行事件' 2
if (params.type !== '') { type: this.current == 2 ? 3 : this.current == 3 ? 2 : this.current,
this.current = params.type - 0 eventIds: [],
} }).then(() => {
if (params.engineeringName != '') { this.refresh()
this.$refs.cnFilterCriteria && this.$refs.cnFilterCriteria.external(params) this.getDevCount()
} })
// this.refresh() }
this.$refs.TransientRef && this.$refs.TransientRef.getConfig() },
}) })
}, },
// 页面销毁
onHide() { onShow() {
uni.setStorageSync('messageParams', { if (uni.getStorageSync(this.$cacheKey.userInfo).authorities === 'operation_manager') {
engineeringName: '', this.items = ['暂态事件', '稳态事件', '运行告警', '运行事件']
engineeringId: '', //工程ID }
projectName: '', const params = uni.getStorageSync('messageParams')
projectId: '', //項目ID this.getDevCount()
deviceName: '', this.$nextTick(() => {
deviceId: '', //设备ID if (params.type !== '') {
lineName: '', this.current = params.type - 0
lineId: '', //测点ID }
type: '', if (params.engineeringName != '') {
}) this.$refs.cnFilterCriteria && this.$refs.cnFilterCriteria.external(params)
}, }
methods: { })
setHeight() { },
uni.createSelectorQuery() // 页面销毁
.select('.tabsBox') onHide() {
.boundingClientRect((rect) => { uni.setStorageSync('messageParams', {
this.width = rect.width engineeringName: '',
// engineeringId: '', //工程ID
// #ifdef H5 projectName: '',
this.navHeight = rect.height + 75 projectId: '', //項目ID
// #endif deviceName: '',
// #ifdef APP-PLUS deviceId: '', //设备ID
this.navHeight = rect.height + 20 lineName: '',
// #endif lineId: '', //测点ID
}) type: '',
.exec() })
}, },
methods: {
refresh() { setHeight() {
switch (this.current) { uni.createSelectorQuery()
case 0: .select('.tabsBox')
this.$refs.TransientRef.store.reload() .boundingClientRect((rect) => {
break this.width = rect.width
case 1: //
this.$refs.SteadyStateRef.store.reload() // #ifdef H5
break this.navHeight = rect.height + 75
case 2: // #endif
this.$refs.AlarmRef.store.reload() // #ifdef APP-PLUS
break this.navHeight = rect.height + 20
case 3: // #endif
this.$refs.RunRef.store.reload() })
break .exec()
} },
},
onClickItem(e) { refresh() {
if (this.current !== e.currentIndex) { switch (this.current) {
this.current = e.currentIndex case 0:
} this.$refs.TransientRef.store.reload()
}, break
select(value) { case 1:
this.selectValue = value this.$refs.SteadyStateRef.store.reload()
setTimeout(() => { break
this.setHeight() case 2:
}, 100) this.$refs.AlarmRef.store.reload()
}, break
// 设置角标 case 3:
getDevCount() { this.$refs.RunRef.store.reload()
if (uni.getStorageSync('projectList')[1] != undefined) { break
getDevCount(uni.getStorageSync('projectList')[1].engineeringId).then((res) => { }
this.devCount = res.data },
this.badgeCounts = [ onClickItem(e) {
this.devCount.eventCount, if (this.current !== e.currentIndex) {
this.devCount.harmonicCount, this.current = e.currentIndex
this.devCount.alarmCount, }
this.devCount.runCount, },
] select(value) {
uni.setStorage({ this.selectValue = value
key: this.$cacheKey.messageCount, setTimeout(() => {
data: this.devCount, this.setHeight()
}) }, 100)
},
let messagePage = bindPickerChange(e) {
this.devCount.eventCount + this.sortIndex = e.detail.value
this.devCount.harmonicCount + if (this.$refs.TransientRef) {
(uni.getStorageSync(this.$cacheKey.userInfo).authorities == 'operation_manager' this.$refs.TransientRef.setSort(this.sortIndex)
? this.devCount.alarmCount + this.devCount.runCount }
: 0) },
let minePage = this.devCount.feedBackCount // 设置角标
getDevCount() {
if (messagePage) { if (uni.getStorageSync('projectList')[1] != undefined) {
uni.setTabBarBadge({ getDevCount(uni.getStorageSync('projectList')[1].engineeringId).then((res) => {
index: 1, this.devCount = res.data
text: messagePage ? (messagePage > 99 ? '99+' : messagePage + '') : '', this.badgeCounts = [
}) this.devCount.eventCount,
} else { this.devCount.harmonicCount,
uni.removeTabBarBadge({ this.devCount.alarmCount,
index: 1, this.devCount.runCount,
}) ]
} uni.setStorage({
if (minePage) { key: this.$cacheKey.messageCount,
uni.setTabBarBadge({ data: this.devCount,
index: 2, })
text: minePage + '',
}) let messagePage =
} else { this.devCount.eventCount +
uni.removeTabBarBadge({ this.devCount.harmonicCount +
index: 2, (uni.getStorageSync(this.$cacheKey.userInfo).authorities == 'operation_manager'
}) ? this.devCount.alarmCount + this.devCount.runCount
} : 0)
// #ifdef APP-PLUS let minePage = this.devCount.feedBackCount
plus.runtime.setBadgeNumber(messagePage + minePage)
// #endif if (messagePage) {
}) uni.setTabBarBadge({
} index: 1,
}, text: messagePage ? (messagePage > 99 ? '99+' : messagePage + '') : '',
})
// 根据索引动态计算右侧偏移位置,使徽章对准每个标签的右上角 } else {
getBadgeRightPosition(index) { uni.removeTabBarBadge({
if (this.items == 4) { index: 1,
return (index + 1) * (this.width / 4) + 'px' })
} else { }
return (index + 0) * (this.width / 2) + 'px' if (minePage) {
} uni.setTabBarBadge({
}, index: 2,
}, text: minePage + '',
})
computed: {}, } else {
} uni.removeTabBarBadge({
</script> index: 2,
<style lang="scss"> })
.messageBox { }
overflow: hidden; // #ifdef APP-PLUS
/deep/.tabsBox { plus.runtime.setBadgeNumber(messagePage + minePage)
position: relative; // #endif
background-color: #fff; })
.segmented-control { }
// height: 40px; },
background-color: #fff;
border-bottom: 1px solid #cccccc70; // 根据索引动态计算右侧偏移位置,使徽章对准每个标签的右上角
.segmented-control__item { getBadgeRightPosition(index) {
align-items: baseline; if (this.items == 4) {
margin-top: 5px; return (index + 1) * (this.width / 4) + 'px'
} } else {
} return (index + 0) * (this.width / 2) + 'px'
}
.segmented-control__text { },
font-size: 30rpx !important; },
color: rgb(96, 98, 102);
} computed: {},
.segmented-control__item--text { }
font-weight: bold; </script>
padding: 0 0 5rpx; <style lang="scss">
} .messageBox {
.choose { overflow: hidden;
// padding: 20rpx; /deep/.tabsBox {
// display: flex; position: relative;
// justify-content: space-between; background-color: #fff;
// align-items: center; .segmented-control {
background: #fff; // height: 40px;
} background-color: #fff;
} border-bottom: 1px solid #cccccc70;
.segmented-control__item {
.subsection { align-items: baseline;
width: 90%; margin-top: 5px;
margin: 20rpx auto; }
} }
.badge-container {
position: absolute; .segmented-control__text {
top: -10rpx; /* 徽章向上偏移,与控件重叠 */ font-size: 30rpx !important;
display: flex; color: rgb(96, 98, 102);
justify-content: space-around; }
right: 0; .segmented-control__item--text {
width: 100%; font-weight: bold;
height: 0; padding: 0 0 5rpx;
pointer-events: none; /* 确保徽章不干扰点击事件 */ }
} .choose {
/deep/ .uni-badge--error { // padding: 20rpx;
background-color: #ff3b30; // display: flex;
} // justify-content: space-between;
// align-items: center;
.badge { background: #fff;
flex: 1; }
// position: absolute; }
// min-width: 18px;
// height: 16px; .subsection {
// padding: 0 4px; width: 90%;
// background-color: #ff3b30; /* 红色徽章 */ margin: 20rpx auto;
// color: white; }
// font-size: 22rpx; .badge-container {
// line-height: 16px; position: absolute;
// text-align: center; top: -10rpx; /* 徽章向上偏移,与控件重叠 */
// border-radius: 9px; display: flex;
// justify-content: space-around;
text-align: center; right: 0;
// transform: translateX(-110%); /* 使徽章中心对齐右上角 */ width: 100%;
.uni-badge--x { height: 0;
left: 70rpx; pointer-events: none; /* 确保徽章不干扰点击事件 */
} }
} /deep/ .uni-badge--error {
} background-color: #ff3b30;
</style> }
.badge {
flex: 1;
text-align: center;
.uni-badge--x {
left: 70rpx;
}
}
.sort-picker {
font-size: 24rpx;
color: #2563eb;
display: flex;
align-items: center;
white-space: nowrap;
}
}
</style>

View File

@@ -21,17 +21,18 @@
<view class="content-item-header-right-des">工程名称{{ item.engineeringName }}</view> <view class="content-item-header-right-des">工程名称{{ item.engineeringName }}</view>
<view class="content-item-header-right-des">项目名称{{ item.projectName }}</view> <view class="content-item-header-right-des">项目名称{{ item.projectName }}</view>
<view class="content-item-header-right-des" v-if="type == '0' || type == '1'" <view class="content-item-header-right-des" v-if="type == '0' || type == '1'"
>监测点名称{{ item.lineName }}</view >监测点名称{{ item.lineName }}
</view
> >
<view class="content-item-header-right-des" v-if="type == '0'" <view class="content-item-header-right-des" v-if="type == '0'"
>暂态类型{{ item.showName }}</view >暂态类型{{ item.showName }}
</view
> >
<!-- <view class="content-item-header-right-des">{{ item.subTitle }}</view> --> <!-- <view class="content-item-header-right-des">{{ item.subTitle }}</view> -->
</view> </view>
<view class="ml10" v-if="type === '0' || item.status != '1'"> <view class="ml10" v-if="type === '0' || item.status != '1'">
<!-- <uni-icons type="search" size="25" color="#376cf3"></uni-icons> --> <uni-icons type="search" size="25" color="#376cf3"></uni-icons>
🔍 </view>
</view>
</view> </view>
<view class="content-item-footer">{{ item.subTitle }}</view> <view class="content-item-footer">{{ item.subTitle }}</view>
</view> </view>

View File

@@ -31,26 +31,25 @@
color="#376cf3" color="#376cf3"
></uni-icons> --> ></uni-icons> -->
<Cn-icon-transient :name="`运行告警`" /> <Cn-icon-transient :name="`运行告警`" />
<view class="badge1" v-if="item.isRead == 0"> </view> <view class="badge1" v-if="item.isRead == 0"></view>
</view> </view>
<view class="event-info"> <view class="event-info">
<view class="event-title"> <view class="event-title">
<text class="event-id">{{ item.date }}</text> <text class="event-id">{{ item.date }}</text>
</view> </view>
<view class="event-desc"> <view class="event-desc">
<text>告警终端{{ item.warnNums }}</text> <text>告警终端总数{{ item.warnNums }}</text>
<text>通讯中断{{ item.interruptCounts }}</text> <text>质量指标告警终端数{{ item.interruptCounts }}</text>
<text>终端告警{{ item.warnCounts}}</text> <text>事件触发告警终端数{{ item.warnCounts }}</text>
</view> </view>
</view> </view>
<view class="event-action"> <view class="event-action">
<!-- <uni-icons type="search" size="25" color="#376cf3"></uni-icons> --> <uni-icons type="search" size="25" color="#376cf3"></uni-icons>
🔍
</view> </view>
</view> </view>
<!-- <view class="event-detail"> <!-- <view class="event-detail">
<text> 告警终端{{ item.warnNums }} </text> <text> 告警终端总数{{ item.warnNums }} </text>
</view> --> </view> -->
</uni-card> </uni-card>
<uni-load-more <uni-load-more
@@ -63,6 +62,7 @@
</template> </template>
<script> <script>
import list from '@/common/js/list' import list from '@/common/js/list'
export default { export default {
components: {}, components: {},
props: { props: {
@@ -82,7 +82,8 @@ export default {
status: 'noMore', //more加载前 loading加载中 noMore加载后 status: 'noMore', //more加载前 loading加载中 noMore加载后
} }
}, },
mounted() {}, mounted() {
},
methods: { methods: {
init() { init() {
@@ -160,6 +161,7 @@ export default {
flex: 1; flex: 1;
} }
} }
/deep/ .uni-scroll-view-refresher { /deep/ .uni-scroll-view-refresher {
display: none; display: none;
} }

View File

@@ -1,249 +1,249 @@
<template> <template>
<!-- ITIC --> <!-- ITIC -->
<view> <view>
<l-echart v-if="status != 'loading'" ref="echartRef" @finished="initChart"></l-echart> <l-echart v-if="status != 'loading'" ref="echartRef" @finished="initChart"></l-echart>
<uni-load-more v-else :status="status"></uni-load-more> <uni-load-more v-else :status="status"></uni-load-more>
</view> </view>
</template> </template>
<script> <script>
const echarts = require('../../../uni_modules/lime-echart/static/echarts.min') const echarts = require('../../../uni_modules/lime-echart/static/echarts.min')
export default { export default {
components: {}, components: {},
props: { props: {
store: { store: {
type: [Object], type: [Object],
}, },
}, },
data() { data() {
return { return {
option: { option: {
backgroundColor: '#fff', backgroundColor: '#fff',
grid: { grid: {
left: '10px', left: '10px',
right: '40rpx', right: '40rpx',
bottom: '40rpx', bottom: '40rpx',
top: '10px', top: '10px',
containLabel: true, containLabel: true,
}, },
legend: { legend: {
data: ['分割线', '可容忍事件', '不可容忍事件'], data: ['分割线', '可容忍事件', '不可容忍事件'],
right: '10px', right: '10px',
bottom: '10px', bottom: '10px',
textStyle: { textStyle: {
fontSize: 10, fontSize: 10,
}, },
itemWidth: 10, itemWidth: 10,
itemHeight: 10, itemHeight: 10,
itemGap: 8, itemGap: 8,
padding: [5, 5, 5, 10], padding: [5, 5, 5, 10],
}, },
yAxis: { yAxis: {
type: 'log', type: 'log',
min: '0.001', min: '0.001',
max: '1000', max: '1000',
name: 's', name: 's',
inverse: true, inverse: true,
axisLabel: { axisLabel: {
rotate: -90, rotate: -90,
}, },
splitLine: { show: false }, splitLine: { show: false },
}, },
xAxis: { xAxis: {
type: 'value', type: 'value',
splitNumber: 10, splitNumber: 10,
minInterval: 20, minInterval: 20,
position: 'top', position: 'top',
rotate: 90, rotate: 90,
max: 140, max: 140,
axisLabel: { axisLabel: {
rotate: -90, rotate: -90,
}, },
name: '%', name: '%',
}, },
series: [ series: [
{ {
name: '分割线', name: '分割线',
type: 'line', type: 'line',
data: [ data: [
[0, 0.05], [0, 0.05],
[50, 0.05], [50, 0.05],
[50, 0.2], [50, 0.2],
[70, 0.2], [70, 0.2],
[70, 0.5], [70, 0.5],
[80, 0.5], [80, 0.5],
[80, 10], [80, 10],
[80, 1000], [80, 1000],
], ],
showSymbol: false, showSymbol: false,
tooltips: { tooltips: {
show: false, show: false,
}, },
color: '#DAA520', color: '#DAA520',
}, },
{ {
name: '可容忍事件', name: '可容忍事件',
type: 'scatter', type: 'scatter',
symbol: 'circle', symbol: 'circle',
// data: this.pointF, // data: this.pointF,
data: [], data: [],
color: 'green', color: 'green',
}, },
{ {
name: '不可容忍事件', name: '不可容忍事件',
type: 'scatter', type: 'scatter',
symbol: 'circle', symbol: 'circle',
// data: this.pointFun, // data: this.pointFun,
data: [], data: [],
color: 'red', color: 'red',
}, },
], ],
}, },
status: 'loading', status: 'loading',
echartRef: null, echartRef: null,
pointF: [], pointF: [],
pointFun: [], pointFun: [],
data: [], data: [],
maxXAxis: 140, maxXAxis: 140,
} }
}, },
mounted() { mounted() {
// this.initChart() // this.initChart()
// console.log('🚀 ~ props.data:', this.props.data) // console.log('🚀 ~ props.data:', this.props.data)
}, },
methods: { methods: {
init() {}, init() {},
async initChart() { async initChart() {
if (!this.$refs.echartRef) return if (!this.$refs.echartRef) return
try { try {
this.echartRef = await this.$refs.echartRef.init(echarts) this.echartRef = await this.$refs.echartRef.init(echarts)
this.bindChartClickEvent() this.bindChartClickEvent()
this.echartRef.setOption(this.option, true) this.echartRef.setOption(this.option, true)
} catch (error) { } catch (error) {
console.error('图表初始化失败:', error) console.error('图表初始化失败:', error)
} }
}, },
gongfunction() { gongfunction() {
var standF = 0 var standF = 0
var unstandF = 0 var unstandF = 0
this.pointF = [] this.pointF = []
this.pointFun = [] this.pointFun = []
var total = 0 var total = 0
let dataList = [0] let dataList = [0]
total = this.data.length total = this.data.length
if (total == 0) { if (total == 0) {
} else { } else {
for (var i = 0; i < this.data.length; i++) { for (var i = 0; i < this.data.length; i++) {
var point = [] var point = []
var xx = this.data[i].evtParamTm.replace(/s/g, '') var xx = this.data[i].evtParamTm.replace(/s/g, '')
var yy = this.data[i].evtParamVVaDepth.replace(/%/g, '') var yy = this.data[i].evtParamVVaDepth.replace(/%/g, '')
var time = this.data[i].startTime.replace('T', ' ') var time = this.data[i].startTime.replace('T', ' ')
dataList.push(yy) dataList.push(yy)
point = [yy, xx, time, this.data[i]] point = [yy, xx, time, this.data[i]]
if (xx < 0.05) { if (xx < 0.05) {
standF++ standF++
this.pointF.push({ this.pointF.push({
value: point, value: point,
itemStyle: { normal: { color: 'green' } }, itemStyle: { normal: { color: 'green' } },
}) })
} else if (xx < 0.2) { } else if (xx < 0.2) {
if (yy > 50) { if (yy > 50) {
standF++ standF++
this.pointF.push({ this.pointF.push({
value: point, value: point,
itemStyle: { normal: { color: 'green' } }, itemStyle: { normal: { color: 'green' } },
}) })
} else { } else {
unstandF++ unstandF++
this.pointFun.push({ this.pointFun.push({
value: point, value: point,
itemStyle: { normal: { color: 'red' } }, itemStyle: { normal: { color: 'red' } },
}) })
} }
} else if (xx < 0.5) { } else if (xx < 0.5) {
if (yy > 70) { if (yy > 70) {
standF++ standF++
this.pointF.push({ this.pointF.push({
value: point, value: point,
itemStyle: { normal: { color: 'green' } }, itemStyle: { normal: { color: 'green' } },
}) })
} else { } else {
unstandF++ unstandF++
this.pointFun.push({ this.pointFun.push({
value: point, value: point,
itemStyle: { normal: { color: 'red' } }, itemStyle: { normal: { color: 'red' } },
}) })
} }
} else { } else {
if (yy > 80) { if (yy > 80) {
standF++ standF++
this.pointF.push({ this.pointF.push({
value: point, value: point,
itemStyle: { normal: { color: 'green' } }, itemStyle: { normal: { color: 'green' } },
}) })
} else { } else {
unstandF++ unstandF++
this.pointFun.push({ this.pointFun.push({
value: point, value: point,
itemStyle: { normal: { color: 'red' } }, itemStyle: { normal: { color: 'red' } },
}) })
} }
} }
} }
} }
this.option.xAxis.max = Math.max( this.option.xAxis.max = Math.max(
140, 140,
Math.ceil( Math.ceil(
Math.max( Math.max(
...dataList ...dataList
.filter((item) => { .filter((item) => {
return item !== '-' && !isNaN(Number(item)) return item !== '-' && !isNaN(Number(item))
}) })
.map((item) => Number(item)), .map((item) => Number(item)),
) / 10, ) / 10,
) * 10, ) * 10,
) //this.maxXAxis ) //this.maxXAxis
this.option.series[1].data = this.pointF this.option.series[1].data = this.pointF
this.option.series[2].data = this.pointFun this.option.series[2].data = this.pointFun
if (this.echartRef) { if (this.echartRef) {
this.echartRef.setOption(this.option, true) this.echartRef.setOption(this.option, true)
} else { } else {
this.initChart() this.initChart()
} }
}, },
bindChartClickEvent() { bindChartClickEvent() {
if (!this.echartRef) return if (!this.echartRef) return
this.echartRef.on('click', (params) => { this.echartRef.on('click', (params) => {
// 点击查看详情 // 点击查看详情
let item = params.value[3] let item = params.value[3]
let str = JSON.stringify(item).replace(/%/g, '百分比') let str = JSON.stringify(item).replace(/%/g, '百分比')
uni.navigateTo({ url: '/pages/message1/comp/transientDetails?detail=' + encodeURIComponent(str) }) uni.navigateTo({ url: '/pages/message1/comp/transientDetails?detail=' + encodeURIComponent(str) })
}) })
}, },
}, },
computed: {}, computed: {},
watch: { watch: {
store: { store: {
handler(val, oldVal) { handler(val, oldVal) {
this.status = val.status this.status = val.status
this.data = (val.data || []) this.data = (val.data || [])
this.gongfunction() this.gongfunction()
}, },
deep: true, deep: true,
immediate: true, immediate: true,
}, },
}, },
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@@ -1,241 +1,241 @@
<template> <template>
<!-- ITIC --> <!-- ITIC -->
<view> <view>
<l-echart v-if="status != 'loading'" ref="echartRef" @finished="initChart"></l-echart> <l-echart v-if="status != 'loading'" ref="echartRef" @finished="initChart"></l-echart>
<uni-load-more v-else :status="status"></uni-load-more> <uni-load-more v-else :status="status"></uni-load-more>
</view> </view>
</template> </template>
<script> <script>
const echarts = require('../../../uni_modules/lime-echart/static/echarts.min') const echarts = require('../../../uni_modules/lime-echart/static/echarts.min')
export default { export default {
components: {}, components: {},
props: { props: {
store: { store: {
type: [Object], type: [Object],
}, },
}, },
data() { data() {
return { return {
option: { option: {
backgroundColor: '#fff', backgroundColor: '#fff',
grid: { grid: {
left: '10px', left: '10px',
right: '40rpx', right: '40rpx',
bottom: '40rpx', bottom: '40rpx',
top: '10px', top: '10px',
containLabel: true, containLabel: true,
}, },
legend: { legend: {
data: ['上限', '下限', '可容忍事件', '不可容忍事件'], data: ['上限', '下限', '可容忍事件', '不可容忍事件'],
right: '10px', right: '10px',
bottom: '10px', bottom: '10px',
textStyle: { textStyle: {
fontSize: 10, fontSize: 10,
}, },
itemWidth: 10, itemWidth: 10,
itemHeight: 10, itemHeight: 10,
itemGap: 8, itemGap: 8,
padding: [5, 5, 5, 10], padding: [5, 5, 5, 10],
}, },
color: ['#FF8C00', '#00BFFF', 'green', 'red'], color: ['#FF8C00', '#00BFFF', 'green', 'red'],
yAxis: { yAxis: {
type: 'log', type: 'log',
min: '0.001', min: '0.001',
max: '1000', max: '1000',
name: 's', name: 's',
inverse: true, inverse: true,
axisLabel: { axisLabel: {
rotate: -90, rotate: -90,
}, },
splitLine: { show: false }, splitLine: { show: false },
}, },
xAxis: { xAxis: {
type: 'value', type: 'value',
splitNumber: 10, splitNumber: 10,
minInterval: 3, minInterval: 3,
position: 'top', position: 'top',
rotate: 90, rotate: 90,
axisLabel: { axisLabel: {
rotate: 90, rotate: 90,
}, },
name: '%', name: '%',
}, },
series: [ series: [
{ {
name: '上限', name: '上限',
type: 'line', type: 'line',
data: [ data: [
[200, 0.001], [200, 0.001],
[140, 0.003], [140, 0.003],
[120, 0.003], [120, 0.003],
[120, 0.5], [120, 0.5],
[110, 0.5], [110, 0.5],
[110, 10], [110, 10],
[110, 1000], [110, 1000],
], ],
showSymbol: false, showSymbol: false,
tooltips: { tooltips: {
show: false, show: false,
}, },
color: '#FF8C00', color: '#FF8C00',
}, },
{ {
name: '下限', name: '下限',
type: 'line', type: 'line',
data: [ data: [
[0, 0.02], [0, 0.02],
[70, 0.02], [70, 0.02],
[70, 0.5], [70, 0.5],
[80, 0.5], [80, 0.5],
[80, 10], [80, 10],
[90, 10], [90, 10],
[90, 1000], [90, 1000],
], ],
showSymbol: false, showSymbol: false,
tooltips: { tooltips: {
show: false, show: false,
}, },
color: '#00BFFF', color: '#00BFFF',
}, },
{ {
name: '可容忍事件', name: '可容忍事件',
type: 'scatter', type: 'scatter',
symbol: 'circle', symbol: 'circle',
// data: this.pointI, // data: this.pointI,
data: [], data: [],
color: 'green', color: 'green',
}, },
{ {
name: '不可容忍事件', name: '不可容忍事件',
type: 'scatter', type: 'scatter',
symbol: 'circle', symbol: 'circle',
// data: this.pointIun, // data: this.pointIun,
data: [], data: [],
color: 'red', color: 'red',
}, },
], ],
}, },
status: 'loading', status: 'loading',
echartRef: null, echartRef: null,
pointI: [], pointI: [],
pointIun: [], pointIun: [],
data: [], data: [],
} }
}, },
mounted() { mounted() {
// this.initChart() // this.initChart()
// console.log('🚀 ~ props.data:', this.props.data) // console.log('🚀 ~ props.data:', this.props.data)
}, },
methods: { methods: {
init() {}, init() {},
async initChart() { async initChart() {
if (!this.$refs.echartRef) return if (!this.$refs.echartRef) return
try { try {
this.echartRef = await this.$refs.echartRef.init(echarts) this.echartRef = await this.$refs.echartRef.init(echarts)
this.bindChartClickEvent() this.bindChartClickEvent()
this.echartRef.setOption(this.option, true) this.echartRef.setOption(this.option, true)
} catch (error) { } catch (error) {
console.error('图表初始化失败:', error) console.error('图表初始化失败:', error)
} }
}, },
gongfunction() { gongfunction() {
// 初始化计数与数据数组 // 初始化计数与数据数组
let normalCount = 0 let normalCount = 0
let abnormalCount = 0 let abnormalCount = 0
this.normalPoints = [] this.normalPoints = []
this.abnormalPoints = [] this.abnormalPoints = []
if (!this.data || this.data.length === 0) { if (!this.data || this.data.length === 0) {
this.updateChartOption() this.updateChartOption()
return return
} }
// 缓存长度,遍历数据 // 缓存长度,遍历数据
const len = this.data.length const len = this.data.length
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
const item = this.data[i] const item = this.data[i]
// 建议确认正则意图,/s/g 仅移除字母 s若去空格应为 /\s/g // 建议确认正则意图,/s/g 仅移除字母 s若去空格应为 /\s/g
const xx = parseFloat(item.evtParamTm.replace(/s/g, '')) const xx = parseFloat(item.evtParamTm.replace(/s/g, ''))
const yy = parseFloat(item.evtParamVVaDepth.replace(/%/g, '')) const yy = parseFloat(item.evtParamVVaDepth.replace(/%/g, ''))
const time = item.startTime.replace('T', ' ') const time = item.startTime.replace('T', ' ')
const pointData = [yy, xx, time, item] const pointData = [yy, xx, time, item]
const isNormal = this.checkPointStatus(xx, yy) const isNormal = this.checkPointStatus(xx, yy)
const pointObj = { const pointObj = {
value: pointData, value: pointData,
itemStyle: { normal: { color: isNormal ? 'green' : 'red' } }, itemStyle: { normal: { color: isNormal ? 'green' : 'red' } },
} }
if (isNormal) { if (isNormal) {
normalCount++ normalCount++
this.normalPoints.push(pointObj) this.normalPoints.push(pointObj)
} else { } else {
abnormalCount++ abnormalCount++
this.abnormalPoints.push(pointObj) this.abnormalPoints.push(pointObj)
} }
} }
this.updateChartOption() this.updateChartOption()
}, },
// 提取判断逻辑为独立方法 // 提取判断逻辑为独立方法
checkPointStatus(xx, yy) { checkPointStatus(xx, yy) {
if (xx <= 0.003) { if (xx <= 0.003) {
const line = 230 - 30000 * xx const line = 230 - 30000 * xx
return yy <= line return yy <= line
} else if (xx <= 0.02) { } else if (xx <= 0.02) {
return yy <= 120 return yy <= 120
} else if (xx <= 0.5) { } else if (xx <= 0.5) {
return yy > 70 && yy < 120 return yy > 70 && yy < 120
} else if (xx <= 10) { } else if (xx <= 10) {
return yy > 80 && yy < 110 return yy > 80 && yy < 110
} else { } else {
return yy > 90 && yy < 110 return yy > 90 && yy < 110
} }
}, },
updateChartOption() { updateChartOption() {
// 建议避免硬编码 series 索引,可通过 seriesName 查找 // 建议避免硬编码 series 索引,可通过 seriesName 查找
this.option.series[2].data = this.normalPoints this.option.series[2].data = this.normalPoints
this.option.series[3].data = this.abnormalPoints this.option.series[3].data = this.abnormalPoints
if (this.echartRef) { if (this.echartRef) {
this.echartRef.setOption(this.option, true) this.echartRef.setOption(this.option, true)
} else { } else {
this.initChart() this.initChart()
} }
}, },
bindChartClickEvent() { bindChartClickEvent() {
if (!this.echartRef) return if (!this.echartRef) return
this.echartRef.on('click', (params) => { this.echartRef.on('click', (params) => {
console.log('🚀 ~ params:', params.value[3]) console.log('🚀 ~ params:', params.value[3])
// 点击查看详情 // 点击查看详情
let item = params.value[3] let item = params.value[3]
let str = JSON.stringify(item).replace(/%/g, '百分比') let str = JSON.stringify(item).replace(/%/g, '百分比')
uni.navigateTo({ url: '/pages/message1/comp/transientDetails?detail=' + encodeURIComponent(str) }) uni.navigateTo({ url: '/pages/message1/comp/transientDetails?detail=' + encodeURIComponent(str) })
}) })
}, },
}, },
computed: {}, computed: {},
watch: { watch: {
store: { store: {
handler(val, oldVal) { handler(val, oldVal) {
this.status = val.status this.status = val.status
this.data = (val.data || []) this.data = (val.data || [])
this.gongfunction() this.gongfunction()
}, },
deep: true, deep: true,
immediate: true, immediate: true,
}, },
}, },
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@@ -1,99 +1,146 @@
<template> <template>
<Cn-page :loading="loading"> <Cn-page :loading="loading">
<view class="detail" slot="body"> <view class="detail" slot="body">
<view class="detail-content" style="font-size: 32rpx"> <view class="detail-content" style="font-size: 32rpx">
<!-- <view class="detail-content-title mb20">发生时间</view> --> <view>{{ detail.startTime }}</view>
<view>{{ detail.startTime }}</view> </view>
</view> <view class="detail-content">
<view class="detail-content"> <view class="detail-content-title mb20">基础信息</view>
<view class="detail-content-title mb20">基础信息</view> <view class="mb5"> 工程名称{{ detail.engineeringName }} </view>
<view class="mb5"> 工程名称{{ detail.engineeringName }} </view> <view class="mb5"> 项目名称{{ detail.projectName }} </view>
<view class="mb5"> 项目名称{{ detail.projectName }} </view> <view class="mb5"> 设备名称{{ detail.equipmentName }}</view>
<view class="mb5"> 设备名称{{ detail.equipmentName }}</view> <view class="mb5"> 监测点名称{{ detail.lineName }}</view>
<view class="mb5"> 监测点名称{{ detail.lineName }}</view> <view class="mb5"> 暂态类型{{ detail.showName }}</view>
<view class="mb5"> 暂态类型{{ detail.showName }}</view> <view class="mb5" v-if="detail.evtParamTm"> 持续时间{{ detail.evtParamTm }}s</view>
<view class="mb5" v-if="detail.evtParamTm"> 持续时间{{ detail.evtParamTm }}s</view> <view class="mb5" v-if="detail.evtParamVVaDepth"> 幅值{{ detail.evtParamVVaDepth }}%</view>
<view class="mb5" v-if="detail.evtParamVVaDepth"> 幅值{{ detail.evtParamVVaDepth }}%</view> <view class="mb5" v-if="detail.evtParamPhase"> 相别{{ detail.evtParamPhase }}</view>
<view class="mb5" v-if="detail.evtParamPhase"> 相别{{ detail.evtParamPhase }}</view> </view>
<!-- <view class="mb5" v-for="(item, textIndex) in detail.dataSet" :key="textIndex"> <view class="detail-tabs">
{{ item.showName + '' + (item.value == 3.1415926 ? '-' : item.value) + (item.unit || '') }} <uni-segmented-control
</view> --> :current="detailTab"
</view> active-color="#376cf3"
<view class="detail-content"> :values="['波形图', 'ITIC', 'F47']"
<view class="detail-content-title mb20">瞬时波形图</view> @clickItem="onDetailTabChange"
<image />
style="width: 100%" </view>
:src="detail.instantPics" <view v-if="detailTab == 0">
mode="widthFix" <view class="detail-content">
v-if="detail.instantPics" <view class="detail-content-title mb20">瞬时波形图</view>
@click="previewImage(detail.instantPics)" <image
/> style="width: 100%"
<text v-else>暂无</text> :src="detail.instantPics"
</view> mode="widthFix"
<view class="detail-content"> v-if="detail.instantPics"
<view class="detail-content-title mb20">RMS波形图</view> @click="previewImage(detail.instantPics)"
<image />
style="width: 100%" <text v-else>暂无</text>
:src="detail.rmsPics" </view>
mode="widthFix" <view class="detail-content">
v-if="detail.rmsPics" <view class="detail-content-title mb20">RMS波形图</view>
@click="previewImage(detail.rmsPics)" <image
/> style="width: 100%"
<text v-else>暂无</text> :src="detail.rmsPics"
</view> mode="widthFix"
</view> v-if="detail.rmsPics"
</Cn-page> @click="previewImage(detail.rmsPics)"
</template> />
<script> <text v-else>暂无</text>
import { updateStatus } from '@/common/api/message' </view>
</view>
export default { <view v-if="detailTab == 1" class="chart-wrapper">
data() { <ITIC :store="eventStore" style="min-height: 600rpx;" />
return { </view>
loading: true, <view v-if="detailTab == 2" class="chart-wrapper">
detail: {}, <F47 :store="eventStore" style="min-height: 600rpx;" />
} </view>
}, </view>
onLoad(options) { </Cn-page>
// console.log(options.detail) </template>
this.detail = JSON.parse(decodeURIComponent(options.detail).replace(/百分比/g, '%')) <script>
this.detail.rmsPics && (this.detail.rmsPics = this.$config.static + this.detail.rmsPics) import { updateStatus } from '@/common/api/message'
this.detail.instantPics && (this.detail.instantPics = this.$config.static + this.detail.instantPics) import ITIC from './ITIC.vue'
import F47 from './F47.vue'
this.loading = false
if (this.detail.status != 1) { export default {
updateStatus({ components: { ITIC, F47 },
eventIds: [this.detail.id], data() {
}) return {
} loading: true,
}, detail: {},
methods: { detailTab: 0,
previewImage(url) { }
// uni.previewImage({ },
// urls: [url], computed: {
// }) eventStore() {
uni.navigateTo({ const hasData = this.detail && (this.detail.id || this.detail.equipmentId)
url: `/pages/message1/comp/preview?url=${encodeURIComponent(url)}`, if (!hasData) {
}) return { data: [], status: 'noMore' }
}, }
}, const item = {
} ...this.detail,
</script> evtParamTm: this.detail.evtParamTm || '0s',
<style lang="scss"> evtParamVVaDepth: this.detail.evtParamVVaDepth || '0%',
.detail { }
padding: 20rpx 0; return {
data: [item],
.detail-content { status: 'noMore',
padding: 20rpx; }
background: #fff; },
margin-bottom: 20rpx; },
font-size: 28rpx; onLoad(options) {
this.detail = JSON.parse(decodeURIComponent(options.detail).replace(/百分比/g, '%'))
.detail-content-title { this.detail.rmsPics && (this.detail.rmsPics = this.$config.static + this.detail.rmsPics)
font-size: 30rpx; this.detail.instantPics && (this.detail.instantPics = this.$config.static + this.detail.instantPics)
color: #111;
font-weight: 700; this.loading = false
} if (this.detail.status != 1) {
} updateStatus({
} eventIds: [this.detail.id],
</style> })
}
},
methods: {
onDetailTabChange(e) {
this.detailTab = e.currentIndex
},
previewImage(url) {
uni.navigateTo({
url: `/pages/message1/comp/preview?url=${encodeURIComponent(url)}`,
})
},
},
}
</script>
<style lang="scss">
.detail {
padding: 20rpx 0;
.detail-content {
padding: 20rpx;
background: #fff;
margin-bottom: 20rpx;
font-size: 28rpx;
.detail-content-title {
font-size: 30rpx;
color: #111;
font-weight: 700;
}
}
.detail-tabs {
padding: 0 20rpx;
margin-bottom: 20rpx;
}
.chart-container {
min-height: 600rpx;
}
.chart-wrapper {
background: #fff;
margin-bottom: 20rpx;
padding: 20rpx;
}
}
</style>

View File

@@ -27,7 +27,7 @@
<view class="event-desc"> <view class="event-desc">
<text>工程名称{{ item.engineeringName }}</text> <text>工程名称{{ item.engineeringName }}</text>
<text>项目名称{{ item.projectName }}</text> <text>项目名称{{ item.projectName }}</text>
<text>事件时间{{ item.startTime }}</text> <text>事件时间{{ item.startTime2 }}</text>
</view> </view>
</view> </view>
</view> </view>

View File

@@ -17,9 +17,9 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 稳态数量 --> <!-- 越限数量 -->
<scroll-view <scroll-view
v-if="filterValue == '稳态数量'" v-if="filterValue == '越限数量'"
scroll-y="true" scroll-y="true"
@refresherrefresh="refresherrefresh" @refresherrefresh="refresherrefresh"
@scrolltolower="scrolltolower" @scrolltolower="scrolltolower"
@@ -47,7 +47,7 @@
color="#E6A23C" color="#E6A23C"
></uni-icons> --> ></uni-icons> -->
<Cn-icon-transient :name="`稳态越限`" /> <Cn-icon-transient :name="`稳态越限`" />
<view class="badge1" v-if="item.isRead == 0"> </view> <view class="badge1" v-if="item.isRead == 0"></view>
</view> </view>
<view class="event-info"> <view class="event-info">
<view class="event-title"> <view class="event-title">
@@ -61,13 +61,12 @@
</view> </view>
</view> </view>
<view class="event-action"> <view class="event-action">
<!-- <uni-icons type="search" size="25" color="#376cf3"></uni-icons> --> <uni-icons type="search" size="25" color="#376cf3"></uni-icons>
🔍
</view> </view>
</view> </view>
<!-- 详情区域 --> <!-- 详情区域 -->
<view class="event-detail textBox" @touchmove.stop> <view class="event-detail textBox" @touchmove.stop>
<text>{{ item.statisticsDate }}发生 {{ item.overLimitDesc }} </text> <text>{{ item.statisticsDate }}发生 {{ item.overLimitDesc }}</text>
</view> </view>
</uni-card> </uni-card>
@@ -149,6 +148,7 @@
<script> <script>
import list from '@/common/js/list' import list from '@/common/js/list'
import { queryAppHarmonicCounts, queryAppHarmonicLine } from '../../common/api/harmonic.js' import { queryAppHarmonicCounts, queryAppHarmonicLine } from '../../common/api/harmonic.js'
export default { export default {
components: {}, components: {},
props: { props: {
@@ -165,9 +165,9 @@ export default {
data() { data() {
return { return {
height: 0, height: 0,
filterValue: '稳态数量', filterValue: '越限数量',
list: [ list: [
{ value: 0, label: '稳态数量' }, { value: 0, label: '越限数量' },
{ value: 0, label: '越限天数' }, { value: 0, label: '越限天数' },
{ value: 0, label: '越限测点数' }, { value: 0, label: '越限测点数' },
], ],
@@ -276,6 +276,7 @@ export default {
.box:first-child { .box:first-child {
flex: 1.3 !important; flex: 1.3 !important;
} }
/* 列表容器 */ /* 列表容器 */
.event-list { .event-list {
/* 头部:图标 + 信息 + 操作 */ /* 头部:图标 + 信息 + 操作 */
@@ -294,9 +295,11 @@ export default {
font-size: 24rpx; font-size: 24rpx;
} }
} }
/deep/ .uni-scroll-view-refresher { /deep/ .uni-scroll-view-refresher {
display: none; display: none;
} }
.textBox { .textBox {
max-height: 110rpx; max-height: 110rpx;
overflow-y: auto; overflow-y: auto;
@@ -308,15 +311,18 @@ export default {
// text-overflow: ellipsis; // text-overflow: ellipsis;
// word-break: break-all; // word-break: break-all;
} }
/deep/ .uni-calendar-item--checked { /deep/ .uni-calendar-item--checked {
background-color: #ffffff00; background-color: #ffffff00;
color: #000000e6; color: #000000e6;
opacity: 1; opacity: 1;
} }
/deep/ .uni-calendar-item--isDay { /deep/ .uni-calendar-item--isDay {
background-color: #ffffff00; background-color: #ffffff00;
color: #000000e6; color: #000000e6;
opacity: 1; opacity: 1;
.uni-calendar-item__weeks-lunar-text { .uni-calendar-item__weeks-lunar-text {
background-color: #ffffff00; background-color: #ffffff00;
color: #000000e6; color: #000000e6;
@@ -327,9 +333,11 @@ export default {
/deep/ .uni-calendar-item__weeks-box-text { /deep/ .uni-calendar-item__weeks-box-text {
z-index: 1; z-index: 1;
} }
/deep/ .uni-calendar-item--isDay-text { /deep/ .uni-calendar-item--isDay-text {
color: #333 !important; /* 改成你想要的颜色 */ color: #333 !important; /* 改成你想要的颜色 */
} }
/deep/ .uni-calendar-item__weeks-box-circle { /deep/ .uni-calendar-item__weeks-box-circle {
position: absolute; position: absolute;
top: 7px; top: 7px;
@@ -340,30 +348,38 @@ export default {
z-index: 0; z-index: 0;
background-color: #e6a23c; background-color: #e6a23c;
} }
/* 核心:选中圆圈下的 子元素(日期数字) */ /* 核心:选中圆圈下的 子元素(日期数字) */
/deep/ .uni-calendar-item__weeks-box-circle + .uni-calendar-item__weeks-box-text { /deep/ .uni-calendar-item__weeks-box-circle + .uni-calendar-item__weeks-box-text {
color: #fff !important; /* 改成你想要的颜色 */ color: #fff !important; /* 改成你想要的颜色 */
} }
/deep/ .uni-calendar__backtoday, /deep/ .uni-calendar__backtoday,
/deep/ .uni-calendar__header-btn-box { /deep/ .uni-calendar__header-btn-box {
display: none; display: none;
} }
/deep/ .uni-calendar-item__weeks-lunar-text { /deep/ .uni-calendar-item__weeks-lunar-text {
display: none; display: none;
} }
/deep/ .uni-calendar__header { /deep/ .uni-calendar__header {
pointer-events: none !important; pointer-events: none !important;
} }
.event-detail { .event-detail {
/deep/ .uni-calendar__header { /deep/ .uni-calendar__header {
display: none !important; display: none !important;
} }
/deep/ .uni-calendar__weeks-day { /deep/ .uni-calendar__weeks-day {
height: 35px; height: 35px;
} }
/deep/ .uni-calendar-item__weeks-box-item { /deep/ .uni-calendar-item__weeks-box-item {
height: 40px; height: 40px;
} }
/deep/ .uni-calendar-item__weeks-box-circle { /deep/ .uni-calendar-item__weeks-box-circle {
position: absolute; position: absolute;
top: 3px; top: 3px;

View File

@@ -1,333 +1,266 @@
<template> <template>
<view style="position: relative"> <view style="position: relative">
<!-- 暂态 --> <!-- 暂态 -->
<view class="transientBox"> <view class="transientBox">
<view class="statistics pd20"> <view class="statistics pd20">
<view <view
class="box boxClick" class="box boxClick"
:class="{ boxClick1: filterValue == index }" :class="{ boxClick1: filterValue == index }"
v-for="(item, index) in dataList" v-for="(item, index) in dataList"
@click=" @click="
filterValue = index filterValue = index
init() init()
" "
> >
<!-- <text class="num">{{ item.value }}</text> --> <!-- <text class="num">{{ item.value }}</text> -->
<text class="num">{{ item.value }}</text> <text class="num">{{ item.value }}</text>
<text class="label">{{ item.label }}</text> <text class="label">{{ item.label }}</text>
</view> </view>
</view> </view>
<view class="smallLabel"> <view class="smallLabel"> </view>
<uni-segmented-control </view>
:current="curSub" <!-- 卡片 -->
active-color="#376cf3" <scroll-view
:values="subsectionList" scroll-y="true"
@clickItem="sectionChange" @refresherrefresh="refresherrefresh"
v-if="subsectionList.length > 1" @scrolltolower="scrolltolower"
/> :refresher-triggered="triggered"
<view style="width: 180rpx"> refresher-enabled="true"
<picker @change="bindPickerChange" :value="sort" :range="array" v-if="curSub == 0"> class="event-list"
<view class="uni-input" :style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
>{{ array[sort] }}排序 >
<uni-icons <!-- 循环渲染事件项 -->
custom-prefix="iconfont" <uni-card
type="icon-paixu1" class="event-item boxClick"
size="10" :class="judgment(item.showName).type"
color="#2563EB" v-for="(item, index) in store.data || []"
></uni-icons> :key="index"
</view> @click="jump(item)"
</picker> >
</view> <!-- 头部图标 + 信息 + 操作 -->
</view> <view class="event-header">
</view> <view class="event-icon">
<!-- 卡片 --> <!-- 动态图标根据类型切换 -->
<scroll-view <!-- <uni-icons
scroll-y="true" :custom-prefix="'iconfont'"
@refresherrefresh="refresherrefresh" :type="judgment(item.showName).icon"
@scrolltolower="scrolltolower" :color="judgment(item.showName).color"
:refresher-triggered="triggered" :size="judgment(item.showName).size"
refresher-enabled="true" ></uni-icons> -->
class="event-list" <Cn-icon-transient :name="item.showName" />
v-if="curSub == 0" <!-- 0未读 1已读 -->
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }" <view class="badge1" v-if="item.status == 0"> </view>
> </view>
<!-- 循环渲染事件项 --> <view class="event-info">
<uni-card <view class="event-title">
class="event-item boxClick" <text class="event-id">{{ item.lineName }}</text>
:class="judgment(item.showName).type" <text class="event-tag" :class="`${judgment(item.showName).type}-tag`">{{
v-for="(item, index) in store.data || []" item.showName
:key="index" }}</text>
@click="jump(item)" </view>
> <view class="event-desc">
<!-- 头部图标 + 信息 + 操作 --> <text>工程名称{{ item.engineeringName }}</text>
<view class="event-header"> <text>项目名称{{ item.projectName }}</text>
<view class="event-icon"> <text>设备名称{{ item.equipmentName }}</text>
<!-- 动态图标根据类型切换 --> </view>
<!-- <uni-icons </view>
:custom-prefix="'iconfont'" <view class="event-action">
:type="judgment(item.showName).icon" <uni-icons type="search" size="25" color="#376cf3"></uni-icons>
:color="judgment(item.showName).color" </view>
:size="judgment(item.showName).size" </view>
></uni-icons> --> <!-- 详情区域 -->
<Cn-icon-transient :name="item.showName" /> <view class="event-detail">
<!-- 0未读 1已读 --> <text>
<view class="badge1" v-if="item.status == 0"> </view> {{ item.startTime ? '发生时间:' + item.startTime : '' }}
</view> {{
<view class="event-info"> item.evtParamVVaDepth != null && item.evtParamVVaDepth !== ''
<view class="event-title"> ? ',幅值:' + item.evtParamVVaDepth + '%'
<text class="event-id">{{ item.lineName }}</text> : ''
<text class="event-tag" :class="`${judgment(item.showName).type}-tag`">{{ }}
item.showName {{
}}</text> item.evtParamTm != null && item.evtParamTm !== ''
</view> ? ',持续时间:' + item.evtParamTm + 's'
<view class="event-desc"> : ''
<text>工程名称{{ item.engineeringName }}</text> }}
<text>项目名称{{ item.projectName }}</text> {{
<text>设备名称{{ item.equipmentName }}</text> item.evtParamPhase != null && item.evtParamPhase !== ''
</view> ? ',相别:' + item.evtParamPhase
</view> : ''
<view class="event-action"> }}
<!-- <uni-icons type="search" size="25" color="#376cf3"></uni-icons> --> </text>
🔍 </view>
</view> </uni-card>
</view> <uni-load-more
<!-- 详情区域 --> v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
<view class="event-detail"> :status="store.status"
<text> ></uni-load-more>
{{ item.startTime ? '发生时间:' + item.startTime : '' }} <Cn-empty v-else style="top: 20%"></Cn-empty>
{{ </scroll-view>
item.evtParamVVaDepth != null && item.evtParamVVaDepth !== '' </view>
? ',幅值:' + item.evtParamVVaDepth + '%' </template>
: '' <script>
}} import list from '@/common/js/list'
{{ import { queryAppEventCounts } from '../../common/api/harmonic.js'
item.evtParamTm != null && item.evtParamTm !== ''
? ',持续时间:' + item.evtParamTm + 's' export default {
: '' props: {
}} navHeight: {
{{ type: Number,
item.evtParamPhase != null && item.evtParamPhase !== '' default: 0,
? ',相别:' + item.evtParamPhase },
: '' selectValue: {
}} type: Object,
</text> // default: () => {},
</view> },
</uni-card> },
<uni-load-more mixins: [list],
v-if="store.status == 'loading' || (store.data && store.data.length > 0)" data() {
:status="store.status" return {
></uni-load-more> height: 0,
<Cn-empty v-else style="top: 20%"></Cn-empty> filterValue: 0,
</scroll-view> dataList: [
<!-- ITIC 列表 --> { value: 0, label: '暂态数量', key: '' },
<ITIC { value: 0, label: '暂降', key: '电压暂降' },
v-if="subsectionList[curSub] == 'ITIC'" { value: 0, label: '中断', key: '电压中断' },
:store="store" { value: 0, label: '暂升', key: '电压暂升' },
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }" ],
></ITIC> status: 'noMore', //more加载前 loading加载中 noMore加载后
<!-- F47 列表 --> sort: 0,
<F47 triggered: true,
v-if="subsectionList[curSub] == 'F47'" }
:store="store" },
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
></F47> methods: {
</view> getHeight() {
</template> uni.createSelectorQuery()
<script> .select('.transientBox')
import list from '@/common/js/list' .boundingClientRect((rect) => {
import { queryUserPushConfig } from '@/common/api/mine' //
import ITIC from './comp/ITIC.vue' // #ifdef H5
import F47 from './comp/F47.vue' this.height = rect?.height || 0
import { queryAppEventCounts } from '../../common/api/harmonic.js' // #endif
// #ifdef APP-PLUS
export default { this.height = rect?.height || 0
components: { ITIC, F47 }, // #endif
props: { })
navHeight: { .exec()
type: Number, },
default: 0, // 查詢
}, init() {
selectValue: { this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
type: Object, this.store.params.type = 0
// default: () => {}, // this.store.params.pageSize = 10000
}, this.store.params.sortField = this.sort
}, this.store.params.engineeringid = this.selectValue.engineeringId
mixins: [list], this.store.params.projectId = this.selectValue.projectId
data() { this.store.params.deviceId = this.selectValue.deviceId
return { this.store.params.lineId = this.selectValue.lineId
height: 0, this.store.params.target =
filterValue: 0, this.filterValue == 0
dataList: [ ? []
{ value: 0, label: '暂态数量', key: '' }, : this.filterValue == 1
{ value: 0, label: '暂降', key: '电压暂降' }, ? ['Evt_Sys_DipStr']
{ value: 0, label: '中断', key: '电压中断' }, : this.filterValue == 2
{ value: 0, label: '暂升', key: '电压暂升' }, ? ['Evt_Sys_IntrStr']
], : ['Evt_Sys_SwlStr']
curSub: 0, this.store.params.startTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).firstDay
subsectionList: [], //'列表', 'ITIC', 'F47' this.store.params.endTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).lastDay
status: 'noMore', //more加载前 loading加载中 noMore加载后 this.store.loadedCallback = () => {
sort: 0, this.getHeight()
triggered: true, this.loading = false
// config: {}, queryAppEventCounts(this.store.params).then((res) => {
array: ['发生时间', '暂降深度', '持续时间'], this.dataList[0].value = res.data.allNum
} this.dataList[1].value = res.data.eventDown
}, this.dataList[2].value = res.data.eventOff
this.dataList[3].value = res.data.eventUp
mounted() { })
this.getConfig() }
}, this.store.reload()
},
methods: { judgment(val, key) {
getHeight() { switch (val) {
uni.createSelectorQuery() case '电压暂降':
.select('.transientBox') return {
.boundingClientRect((rect) => { type: 'sag',
// icon: 'icon-a-svg4',
// #ifdef H5 color: '#2563eb',
this.height = rect?.height || 0 size: '25',
// #endif }
// #ifdef APP-PLUS case '电压暂升':
this.height = rect?.height || 0 return {
// #endif type: 'swell',
}) icon: 'icon-a-svg5',
.exec() color: '#e6a23c',
}, size: '25',
// 查詢 }
init() { case '电压中断':
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage') return {
this.store.params.type = 0 type: 'interrupt',
// this.store.params.pageSize = 10000 icon: 'icon-zhongduan2',
this.store.params.sortField = this.sort color: '#6b7280',
this.store.params.engineeringid = this.selectValue.engineeringId size: '35',
this.store.params.projectId = this.selectValue.projectId }
this.store.params.deviceId = this.selectValue.deviceId case '瞬态':
this.store.params.lineId = this.selectValue.lineId return {
this.store.params.target = type: 'transient',
this.filterValue == 0 icon: 'icon-shuntaishijian',
? [] color: '#8b5cf6',
: this.filterValue == 1 size: '40',
? ['Evt_Sys_DipStr'] }
: this.filterValue == 2 case '未知':
? ['Evt_Sys_IntrStr'] return {
: ['Evt_Sys_SwlStr'] type: 'unknown',
this.store.params.startTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).firstDay icon: 'icon-wenhao',
this.store.params.endTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).lastDay color: '#6b7280',
this.store.loadedCallback = () => { size: '45',
this.getHeight() }
this.loading = false }
queryAppEventCounts(this.store.params).then((res) => { },
this.dataList[0].value = res.data.allNum
this.dataList[1].value = res.data.eventDown // 点击查看详情
this.dataList[2].value = res.data.eventOff jump(item) {
this.dataList[3].value = res.data.eventUp let str = JSON.stringify(item).replace(/%/g, '百分比')
}) item.status = '1'
} uni.navigateTo({ url: '/pages/message1/comp/transientDetails?detail=' + encodeURIComponent(str) })
this.store.reload() },
}, setSort(index) {
getConfig() { this.sort = index
queryUserPushConfig().then((res) => { this.init()
// this.config = res.data },
let list = [ // 下拉
'列表', refresherrefresh() {
res.data.iticFunction == 1 ? 'ITIC' : '', this.triggered = true
res.data.f47Function == 1 ? 'F47' : '', uni.startPullDownRefresh()
].filter((item) => item) setTimeout(() => {
this.curSub = !list[this.curSub] ? 0 : this.curSub this.triggered = false
this.subsectionList = JSON.parse(JSON.stringify(list)) }, 500)
}) },
}, // 上拉
scrolltolower() {
judgment(val, key) { if (this.store.status != 'noMore') {
switch (val) { this.store.next && this.store.next()
case '电压暂降': }
return { },
type: 'sag', },
icon: 'icon-a-svg4', computed: {},
color: '#2563eb',
size: '25', watch: {
} selectValue: {
case '电压暂升': handler(val, oldVal) {
return { if (Object.keys(val).length === 0) return
type: 'swell', this.init()
icon: 'icon-a-svg5', },
color: '#e6a23c', deep: true,
size: '25', immediate: true,
} },
case '电压中断': },
return { }
type: 'interrupt', </script>
icon: 'icon-zhongduan2',
color: '#6b7280', <style lang="scss" scoped>
size: '35', @import './index.scss';
}
case '瞬态': /deep/ .uni-scroll-view-refresher {
return { display: none;
type: 'transient', }
icon: 'icon-shuntaishijian', </style>
color: '#8b5cf6',
size: '40',
}
case '未知':
return {
type: 'unknown',
icon: 'icon-wenhao',
color: '#6b7280',
size: '45',
}
}
},
// 点击查看详情
jump(item) {
let str = JSON.stringify(item).replace(/%/g, '百分比')
item.status = '1'
uni.navigateTo({ url: '/pages/message1/comp/transientDetails?detail=' + encodeURIComponent(str) })
},
// 切换排序
bindPickerChange(e) {
this.sort = e.detail.value
this.init()
},
sectionChange(e) {
this.curSub = e.currentIndex
},
// 下拉
refresherrefresh() {
this.triggered = true
uni.startPullDownRefresh()
setTimeout(() => {
this.triggered = false
}, 500)
},
// 上拉
scrolltolower() {
if (this.store.status != 'noMore') {
this.store.next && this.store.next()
}
},
},
onShow() {
this.curSub = 0
},
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';
/deep/ .uni-scroll-view-refresher {
display: none;
}
</style>

View File

@@ -93,7 +93,7 @@ import { sm3Digest } from '@/common/js/sm3.js'
export default { export default {
data() { data() {
return { return {
checkbox: false, checkbox: true,
loading: false, loading: false,
loginType: 'pwd', loginType: 'pwd',
phone: '', phone: '',

View File

@@ -77,7 +77,7 @@ export default {
name: 'jiaban', name: 'jiaban',
data() { data() {
return { return {
checkbox: false, checkbox: true,
step: 1, step: 1,
loading: false, loading: false,
waitTime: 0, waitTime: 0,

826
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff