提交app
This commit is contained in:
126
pages/message1/alarm.vue
Normal file
126
pages/message1/alarm.vue
Normal file
@@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<view style="position: relative">
|
||||
<!-- 运行告警 -->
|
||||
|
||||
<!-- 卡片 -->
|
||||
<view class="event-list" :style="{ height: 'calc(100vh - ' + (navHeight + 10) + 'px)', overflow: 'auto' }">
|
||||
<!-- 循环渲染事件项 -->
|
||||
<uni-card
|
||||
class="event-item"
|
||||
:class="item.type"
|
||||
v-for="(item, index) in this.store.data"
|
||||
:key="index"
|
||||
@click="jump(item)"
|
||||
>
|
||||
<!-- 头部:图标 + 信息 + 操作 -->
|
||||
<view class="event-header">
|
||||
<view class="event-icon">
|
||||
<!-- 动态图标:根据类型切换 -->
|
||||
<uni-icons
|
||||
custom-prefix="iconfont"
|
||||
type="icon-terminal-box-fill"
|
||||
size="22"
|
||||
color="#FF0000"
|
||||
></uni-icons>
|
||||
<view class="badge1" v-if="item.isRead == 0"> </view>
|
||||
</view>
|
||||
<view class="event-info">
|
||||
<view class="event-title">
|
||||
<text class="event-id">{{ item.date }}发生告警终端{{ item.warnNums }}台</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="event-action"> 🔍 </view>
|
||||
</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>
|
||||
</view>
|
||||
</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 {
|
||||
status: 'noMore', //more加载前 loading加载中 noMore加载后
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
this.store = this.DataSource('/cs-harmonic-boot/csAlarm/queryAlarmList')
|
||||
this.store.params.pageSize = 10000
|
||||
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
|
||||
}
|
||||
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) })
|
||||
},
|
||||
},
|
||||
|
||||
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;
|
||||
/* 头部:图标 + 信息 + 操作 */
|
||||
.event-header {
|
||||
margin-bottom: 0rpx;
|
||||
}
|
||||
.event-title {
|
||||
margin-bottom: 0rpx;
|
||||
}
|
||||
|
||||
/* 图标区域(按类型区分背景色) */
|
||||
.event-icon {
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
background-color: #ff000020;
|
||||
}
|
||||
|
||||
/* 信息区域 */
|
||||
.event-info {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
231
pages/message1/comp/F47.vue
Normal file
231
pages/message1/comp/F47.vue
Normal file
@@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<!-- ITIC -->
|
||||
<view>
|
||||
<l-echart v-if="status != 'loading'" ref="echartRef" @finished="initChart"></l-echart>
|
||||
<uni-load-more v-else :status="status"></uni-load-more>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const echarts = require('../../../uni_modules/lime-echart/static/echarts.min')
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
store: {
|
||||
type: [Object],
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
option: {
|
||||
backgroundColor: '#fff',
|
||||
grid: {
|
||||
left: '10px',
|
||||
right: '40rpx',
|
||||
bottom: '40rpx',
|
||||
top: '10px',
|
||||
containLabel: true,
|
||||
},
|
||||
legend: {
|
||||
data: ['分割线', '可容忍事件', '不可容忍事件'],
|
||||
right: '10px',
|
||||
bottom: '10px',
|
||||
textStyle: {
|
||||
fontSize: 10,
|
||||
},
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemGap: 8,
|
||||
padding: [5, 5, 5, 10],
|
||||
},
|
||||
|
||||
yAxis: {
|
||||
type: 'log',
|
||||
min: '0.001',
|
||||
max: '1000',
|
||||
name: 's',
|
||||
inverse: true,
|
||||
axisLabel: {
|
||||
rotate: -90,
|
||||
},
|
||||
splitLine: { show: false },
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
splitNumber: 10,
|
||||
minInterval: 3,
|
||||
position: 'top',
|
||||
rotate: 90,
|
||||
axisLabel: {
|
||||
rotate: -90,
|
||||
},
|
||||
name: '%',
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '分割线',
|
||||
type: 'line',
|
||||
data: [
|
||||
[0, 0.05],
|
||||
[50, 0.05],
|
||||
[50, 0.2],
|
||||
[70, 0.2],
|
||||
[70, 0.5],
|
||||
[80, 0.5],
|
||||
[80, 10],
|
||||
[80, 1000],
|
||||
],
|
||||
showSymbol: false,
|
||||
tooltips: {
|
||||
show: false,
|
||||
},
|
||||
color: '#DAA520',
|
||||
},
|
||||
{
|
||||
name: '可容忍事件',
|
||||
type: 'scatter',
|
||||
symbol: 'circle',
|
||||
// data: this.pointF,
|
||||
data: [],
|
||||
color: 'green',
|
||||
},
|
||||
{
|
||||
name: '不可容忍事件',
|
||||
type: 'scatter',
|
||||
symbol: 'circle',
|
||||
// data: this.pointFun,
|
||||
data: [],
|
||||
color: 'red',
|
||||
},
|
||||
],
|
||||
},
|
||||
status: 'loading',
|
||||
echartRef: null,
|
||||
pointF: [],
|
||||
pointFun: [],
|
||||
data: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.initChart()
|
||||
// console.log('🚀 ~ props.data:', this.props.data)
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {},
|
||||
async initChart() {
|
||||
if (!this.$refs.echartRef) return
|
||||
try {
|
||||
this.echartRef = await this.$refs.echartRef.init(echarts)
|
||||
this.bindChartClickEvent()
|
||||
this.echartRef.setOption(this.option, true)
|
||||
} catch (error) {
|
||||
console.error('图表初始化失败:', error)
|
||||
}
|
||||
},
|
||||
|
||||
gongfunction() {
|
||||
var standF = 0
|
||||
var unstandF = 0
|
||||
this.pointF = []
|
||||
this.pointFun = []
|
||||
var total = 0
|
||||
total = this.data.length
|
||||
if (total == 0) {
|
||||
} else {
|
||||
for (var i = 0; i < this.data.length; i++) {
|
||||
var point = []
|
||||
var xx = this.data[i].evtParamTm.replace(/s/g, '')
|
||||
var yy = this.data[i].evtParamVVaDepth.replace(/%/g, '')
|
||||
var time = this.data[i].startTime.replace('T', ' ')
|
||||
|
||||
point = [yy, xx, time, this.data[i]]
|
||||
|
||||
if (xx < 0.05) {
|
||||
standF++
|
||||
this.pointF.push({
|
||||
value: point,
|
||||
itemStyle: { normal: { color: 'green' } },
|
||||
})
|
||||
} else if (xx < 0.2) {
|
||||
if (yy > 50) {
|
||||
standF++
|
||||
this.pointF.push({
|
||||
value: point,
|
||||
itemStyle: { normal: { color: 'green' } },
|
||||
})
|
||||
} else {
|
||||
unstandF++
|
||||
this.pointFun.push({
|
||||
value: point,
|
||||
itemStyle: { normal: { color: 'red' } },
|
||||
})
|
||||
}
|
||||
} else if (xx < 0.5) {
|
||||
if (yy > 70) {
|
||||
standF++
|
||||
this.pointF.push({
|
||||
value: point,
|
||||
itemStyle: { normal: { color: 'green' } },
|
||||
})
|
||||
} else {
|
||||
unstandF++
|
||||
this.pointFun.push({
|
||||
value: point,
|
||||
itemStyle: { normal: { color: 'red' } },
|
||||
})
|
||||
}
|
||||
} else {
|
||||
if (yy > 80) {
|
||||
standF++
|
||||
this.pointF.push({
|
||||
value: point,
|
||||
itemStyle: { normal: { color: 'green' } },
|
||||
})
|
||||
} else {
|
||||
unstandF++
|
||||
this.pointFun.push({
|
||||
value: point,
|
||||
itemStyle: { normal: { color: 'red' } },
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.option.series[1].data = this.pointF
|
||||
this.option.series[2].data = this.pointFun
|
||||
|
||||
if (this.echartRef) {
|
||||
this.echartRef.setOption(this.option, true)
|
||||
} else {
|
||||
this.initChart()
|
||||
}
|
||||
},
|
||||
|
||||
bindChartClickEvent() {
|
||||
if (!this.echartRef) return
|
||||
this.echartRef.on('click', (params) => {
|
||||
console.log('🚀 ~ params:', params.value[3])
|
||||
// 点击查看详情
|
||||
let item = params.value[3]
|
||||
let str = JSON.stringify(item).replace(/%/g, '百分比')
|
||||
uni.navigateTo({ url: '/pages/message1/comp/transientDetails?detail=' + encodeURIComponent(str) })
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
computed: {},
|
||||
|
||||
watch: {
|
||||
store: {
|
||||
handler(val, oldVal) {
|
||||
this.status = val.status
|
||||
this.data = val.data
|
||||
this.gongfunction()
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
341
pages/message1/comp/ITIC.vue
Normal file
341
pages/message1/comp/ITIC.vue
Normal file
@@ -0,0 +1,341 @@
|
||||
<template>
|
||||
<!-- ITIC -->
|
||||
<view>
|
||||
<l-echart v-if="status != 'loading'" ref="echartRef" @finished="initChart"></l-echart>
|
||||
<uni-load-more v-else :status="status"></uni-load-more>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const echarts = require('../../../uni_modules/lime-echart/static/echarts.min')
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
store: {
|
||||
type: [Object],
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
option: {
|
||||
backgroundColor: '#fff',
|
||||
grid: {
|
||||
left: '10px',
|
||||
right: '40rpx',
|
||||
bottom: '40rpx',
|
||||
top: '10px',
|
||||
containLabel: true,
|
||||
},
|
||||
legend: {
|
||||
data: ['上限', '下限', '可容忍事件', '不可容忍事件'],
|
||||
right: '10px',
|
||||
bottom: '10px',
|
||||
textStyle: {
|
||||
fontSize: 10,
|
||||
},
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemGap: 8,
|
||||
padding: [5, 5 ,5 ,10],
|
||||
},
|
||||
|
||||
color: ['#FF8C00', '#00BFFF', 'green', 'red'],
|
||||
yAxis: {
|
||||
type: 'log',
|
||||
min: '0.001',
|
||||
max: '1000',
|
||||
name: 's',
|
||||
inverse: true,
|
||||
axisLabel: {
|
||||
rotate: -90,
|
||||
},
|
||||
splitLine: { show: false },
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
splitNumber: 10,
|
||||
minInterval: 3,
|
||||
position: 'top',
|
||||
rotate: 90,
|
||||
axisLabel: {
|
||||
rotate: 90,
|
||||
},
|
||||
name: '%',
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '上限',
|
||||
type: 'line',
|
||||
data: [
|
||||
[200, 0.001],
|
||||
[140, 0.003],
|
||||
[120, 0.003],
|
||||
[120, 0.5],
|
||||
[110, 0.5],
|
||||
[110, 10],
|
||||
[110, 1000],
|
||||
],
|
||||
showSymbol: false,
|
||||
tooltips: {
|
||||
show: false,
|
||||
},
|
||||
color: '#FF8C00',
|
||||
},
|
||||
{
|
||||
name: '下限',
|
||||
type: 'line',
|
||||
data: [
|
||||
[0, 0.02],
|
||||
[70, 0.02],
|
||||
[70, 0.5],
|
||||
[80, 0.5],
|
||||
[80, 10],
|
||||
[90, 10],
|
||||
[90, 1000],
|
||||
],
|
||||
showSymbol: false,
|
||||
tooltips: {
|
||||
show: false,
|
||||
},
|
||||
color: '#00BFFF',
|
||||
},
|
||||
{
|
||||
name: '可容忍事件',
|
||||
type: 'scatter',
|
||||
symbol: 'circle',
|
||||
// data: this.pointI,
|
||||
data: [],
|
||||
color: 'green',
|
||||
},
|
||||
{
|
||||
name: '不可容忍事件',
|
||||
type: 'scatter',
|
||||
symbol: 'circle',
|
||||
// data: this.pointIun,
|
||||
data: [],
|
||||
color: 'red',
|
||||
},
|
||||
],
|
||||
},
|
||||
status: 'loading',
|
||||
echartRef: null,
|
||||
pointI: [],
|
||||
pointIun: [],
|
||||
data: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.initChart()
|
||||
// console.log('🚀 ~ props.data:', this.props.data)
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {},
|
||||
async initChart() {
|
||||
if (!this.$refs.echartRef) return
|
||||
try {
|
||||
this.echartRef = await this.$refs.echartRef.init(echarts)
|
||||
this.bindChartClickEvent()
|
||||
this.echartRef.setOption(this.option, true)
|
||||
} catch (error) {
|
||||
console.error('图表初始化失败:', error)
|
||||
}
|
||||
},
|
||||
|
||||
// gongfunction() {
|
||||
// var standI = 0
|
||||
// var unstandI = 0
|
||||
// this.pointI = []
|
||||
// this.pointIun = []
|
||||
// var total = 0
|
||||
// total = this.data.length
|
||||
// if (total == 0) {
|
||||
// } else {
|
||||
// for (var i = 0; i < this.data.length; i++) {
|
||||
// var point = []
|
||||
// var xx = this.data[i].evtParamTm.replace(/s/g, '')
|
||||
// var yy = this.data[i].evtParamVVaDepth.replace(/%/g, '')
|
||||
// var time = this.data[i].startTime.replace('T', ' ')
|
||||
|
||||
// point = [yy, xx, time, this.data[i]]
|
||||
|
||||
// if (xx <= 0.003) {
|
||||
// var line = 0
|
||||
// line = 230 - 30000 * xx
|
||||
// if (yy > line) {
|
||||
// unstandI++
|
||||
// this.pointIun.push({
|
||||
// value: point,
|
||||
// itemStyle: { normal: { color: 'red' } },
|
||||
// })
|
||||
// } else {
|
||||
// standI++
|
||||
// this.pointI.push({
|
||||
// value: point,
|
||||
// itemStyle: { normal: { color: 'green' } },
|
||||
// })
|
||||
// }
|
||||
// } else if (xx <= 0.02) {
|
||||
// if (yy > 120) {
|
||||
// unstandI++
|
||||
// this.pointIun.push({
|
||||
// value: point,
|
||||
// itemStyle: { normal: { color: 'red' } },
|
||||
// })
|
||||
// } else {
|
||||
// standI++
|
||||
// this.pointI.push({
|
||||
// value: point,
|
||||
// itemStyle: { normal: { color: 'green' } },
|
||||
// })
|
||||
// }
|
||||
// } else if (xx <= 0.5) {
|
||||
// if (yy > 120 || yy < 70) {
|
||||
// unstandI++
|
||||
// this.pointIun.push({
|
||||
// value: point,
|
||||
// itemStyle: { normal: { color: 'red' } },
|
||||
// })
|
||||
// } else {
|
||||
// standI++
|
||||
// this.pointI.push({
|
||||
// value: point,
|
||||
// itemStyle: { normal: { color: 'green' } },
|
||||
// })
|
||||
// }
|
||||
// } else if (xx <= 10) {
|
||||
// if (yy > 110 || yy < 80) {
|
||||
// unstandI++
|
||||
// this.pointIun.push({
|
||||
// value: point,
|
||||
// itemStyle: { normal: { color: 'red' } },
|
||||
// })
|
||||
// } else {
|
||||
// standI++
|
||||
// this.pointI.push({
|
||||
// value: point,
|
||||
// itemStyle: { normal: { color: 'green' } },
|
||||
// })
|
||||
// }
|
||||
// } else {
|
||||
// if (yy > 110 || yy < 90) {
|
||||
// unstandI++
|
||||
// this.pointIun.push({
|
||||
// value: point,
|
||||
// itemStyle: { normal: { color: 'red' } },
|
||||
// })
|
||||
// } else {
|
||||
// standI++
|
||||
// this.pointI.push({
|
||||
// value: point,
|
||||
// itemStyle: { normal: { color: 'green' } },
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// this.option.series[2].data = this.pointI
|
||||
// this.option.series[3].data = this.pointIun
|
||||
|
||||
// if (this.echartRef) {
|
||||
// this.echartRef.setOption(this.option, true)
|
||||
// } else {
|
||||
// this.initChart()
|
||||
// }
|
||||
// },
|
||||
|
||||
gongfunction() {
|
||||
// 初始化计数与数据数组
|
||||
let normalCount = 0
|
||||
let abnormalCount = 0
|
||||
this.normalPoints = []
|
||||
this.abnormalPoints = []
|
||||
|
||||
if (!this.data || this.data.length === 0) {
|
||||
this.updateChartOption()
|
||||
return
|
||||
}
|
||||
|
||||
// 缓存长度,遍历数据
|
||||
const len = this.data.length
|
||||
for (let i = 0; i < len; i++) {
|
||||
const item = this.data[i]
|
||||
// 建议确认正则意图,/s/g 仅移除字母 s,若去空格应为 /\s/g
|
||||
const xx = parseFloat(item.evtParamTm.replace(/s/g, ''))
|
||||
const yy = parseFloat(item.evtParamVVaDepth.replace(/%/g, ''))
|
||||
const time = item.startTime.replace('T', ' ')
|
||||
|
||||
const pointData = [yy, xx, time, item]
|
||||
const isNormal = this.checkPointStatus(xx, yy)
|
||||
const pointObj = {
|
||||
value: pointData,
|
||||
itemStyle: { normal: { color: isNormal ? 'green' : 'red' } },
|
||||
}
|
||||
|
||||
if (isNormal) {
|
||||
normalCount++
|
||||
this.normalPoints.push(pointObj)
|
||||
} else {
|
||||
abnormalCount++
|
||||
this.abnormalPoints.push(pointObj)
|
||||
}
|
||||
}
|
||||
|
||||
this.updateChartOption()
|
||||
},
|
||||
|
||||
// 提取判断逻辑为独立方法
|
||||
checkPointStatus(xx, yy) {
|
||||
if (xx <= 0.003) {
|
||||
const line = 230 - 30000 * xx
|
||||
return yy <= line
|
||||
} else if (xx <= 0.02) {
|
||||
return yy <= 120
|
||||
} else if (xx <= 0.5) {
|
||||
return yy > 70 && yy < 120
|
||||
} else if (xx <= 10) {
|
||||
return yy > 80 && yy < 110
|
||||
} else {
|
||||
return yy > 90 && yy < 110
|
||||
}
|
||||
},
|
||||
|
||||
updateChartOption() {
|
||||
// 建议避免硬编码 series 索引,可通过 seriesName 查找
|
||||
this.option.series[2].data = this.normalPoints
|
||||
this.option.series[3].data = this.abnormalPoints
|
||||
|
||||
if (this.echartRef) {
|
||||
this.echartRef.setOption(this.option, true)
|
||||
} else {
|
||||
this.initChart()
|
||||
}
|
||||
},
|
||||
|
||||
bindChartClickEvent() {
|
||||
if (!this.echartRef) return
|
||||
this.echartRef.on('click', (params) => {
|
||||
console.log('🚀 ~ params:', params.value[3])
|
||||
// 点击查看详情
|
||||
let item = params.value[3]
|
||||
let str = JSON.stringify(item).replace(/%/g, '百分比')
|
||||
uni.navigateTo({ url: '/pages/message1/comp/transientDetails?detail=' + encodeURIComponent(str) })
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
computed: {},
|
||||
|
||||
watch: {
|
||||
store: {
|
||||
handler(val, oldVal) {
|
||||
this.status = val.status
|
||||
this.data = val.data
|
||||
this.gongfunction()
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
134
pages/message1/comp/alarmDetails.vue
Normal file
134
pages/message1/comp/alarmDetails.vue
Normal file
@@ -0,0 +1,134 @@
|
||||
<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>
|
||||
<view class="detail-content">
|
||||
<view class="detail-content-title mb20">终端告警列表</view>
|
||||
|
||||
<uni-collapse accordion>
|
||||
<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>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import { updateStatus, queryAlarmDetail } from '@/common/api/message'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
detail: {},
|
||||
limit: '',
|
||||
accordionVal: '1',
|
||||
|
||||
list: [],
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.loading = false
|
||||
this.detail = JSON.parse(decodeURIComponent(options.detail).replace(/百分比/g, '%'))
|
||||
this.init()
|
||||
if (this.detail.isRead != 1) {
|
||||
updateStatus({
|
||||
eventIds: [this.detail.eventId],
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.loading = false
|
||||
queryAlarmDetail({
|
||||
devList: this.detail.devIds,
|
||||
time: this.detail.date,
|
||||
})
|
||||
.then((res) => {
|
||||
this.list = res.data
|
||||
this.loading = false
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</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: 32rpx;
|
||||
color: #111;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
.collapseTop {
|
||||
padding: 10rpx 0;
|
||||
margin-left: 15px;
|
||||
.name {
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
.frequency {
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
// color: #666666;
|
||||
}
|
||||
}
|
||||
.textBox {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
</style>
|
||||
326
pages/message1/comp/preview.vue
Normal file
326
pages/message1/comp/preview.vue
Normal file
@@ -0,0 +1,326 @@
|
||||
<template>
|
||||
<view class="preview-container">
|
||||
<!-- 右上角关闭按钮 -->
|
||||
<view class="close-btn" @click="close">
|
||||
<text class="close-icon">✕</text>
|
||||
</view>
|
||||
|
||||
<!-- 下载按钮 -->
|
||||
<view class="download-btn" @click="downloadImage">
|
||||
<text class="download-icon">⬇️</text>
|
||||
</view>
|
||||
|
||||
<!-- 图片预览区域,使用movable-area和movable-view实现缩放移动 -->
|
||||
<movable-area class="movable-area" :style="{ width: '100vw', height: '100vh' }">
|
||||
<movable-view
|
||||
class="movable-view"
|
||||
direction="all"
|
||||
:scale="true"
|
||||
:scale-min="0.5"
|
||||
:scale-max="3"
|
||||
:scale-value="scaleValue"
|
||||
@scale="onScale"
|
||||
:x="x"
|
||||
:y="y"
|
||||
:style="{
|
||||
width: rotatedWidth + 'px',
|
||||
height: rotatedHeight + 'px'
|
||||
}"
|
||||
>
|
||||
<view
|
||||
class="image-wrapper"
|
||||
:style="{
|
||||
width: imgWidth + 'px',
|
||||
height: imgHeight + 'px',
|
||||
transform: 'rotate(90deg)',
|
||||
transformOrigin: 'center center'
|
||||
}"
|
||||
>
|
||||
<image
|
||||
:src="imageUrl"
|
||||
class="preview-img"
|
||||
mode="aspectFill"
|
||||
:style="{
|
||||
width: imgWidth + 'px',
|
||||
height: imgHeight + 'px'
|
||||
}"
|
||||
@load="onImageLoad"
|
||||
></image>
|
||||
</view>
|
||||
</movable-view>
|
||||
</movable-area>
|
||||
|
||||
<!-- 图片信息提示 -->
|
||||
<view class="scale-tip" v-if="showScaleTip">
|
||||
当前缩放: {{ Math.round(scaleValue * 100) }}%
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
onLoad(options) {
|
||||
this.imageUrl = decodeURIComponent(options.url) // 接收传递的图片URL,需要解码
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
imageUrl: '',
|
||||
// 缩放相关
|
||||
scaleValue: 1,
|
||||
x: 0,
|
||||
y: 0,
|
||||
// 图片原始尺寸
|
||||
imgWidth: 0,
|
||||
imgHeight: 0,
|
||||
// 旋转后的尺寸(交换宽高)
|
||||
rotatedWidth: 0,
|
||||
rotatedHeight: 0,
|
||||
// 提示显示控制
|
||||
showScaleTip: false,
|
||||
tipTimer: null,
|
||||
// 屏幕尺寸
|
||||
windowWidth: 0,
|
||||
windowHeight: 0
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// 获取屏幕尺寸
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
this.windowWidth = systemInfo.windowWidth;
|
||||
this.windowHeight = systemInfo.windowHeight;
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 图片加载完成后获取尺寸
|
||||
onImageLoad(e) {
|
||||
const { width, height } = e.detail;
|
||||
|
||||
// 保存原始尺寸
|
||||
this.imgWidth = width;
|
||||
this.imgHeight = height;
|
||||
|
||||
// 旋转90度后,宽度和高度互换
|
||||
this.rotatedWidth = height; // 旋转后宽度 = 原高度
|
||||
this.rotatedHeight = width; // 旋转后高度 = 原宽度
|
||||
|
||||
// 计算初始位置居中
|
||||
this.resetPosition();
|
||||
|
||||
console.log('图片加载:', {width, height}, '旋转后:', {rotatedWidth: this.rotatedWidth, rotatedHeight: this.rotatedHeight});
|
||||
},
|
||||
|
||||
// 重置位置到中心
|
||||
resetPosition() {
|
||||
// 计算居中的偏移量
|
||||
this.x = (this.windowWidth - this.rotatedWidth) / 2;
|
||||
this.y = (this.windowHeight - this.rotatedHeight) / 2;
|
||||
|
||||
console.log('重置位置:', {x: this.x, y: this.y, windowWidth: this.windowWidth, windowHeight: this.windowHeight});
|
||||
},
|
||||
|
||||
// 缩放事件处理
|
||||
onScale(e) {
|
||||
this.scaleValue = e.detail.scale;
|
||||
|
||||
// 显示缩放提示
|
||||
this.showScaleTip = true;
|
||||
if (this.tipTimer) {
|
||||
clearTimeout(this.tipTimer);
|
||||
}
|
||||
this.tipTimer = setTimeout(() => {
|
||||
this.showScaleTip = false;
|
||||
}, 1500);
|
||||
},
|
||||
|
||||
// 关闭预览
|
||||
close() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
|
||||
// 下载图片
|
||||
downloadImage() {
|
||||
uni.showLoading({
|
||||
title: '下载中...'
|
||||
});
|
||||
|
||||
// 先获取图片信息(如果是网络图片需要先下载)
|
||||
uni.downloadFile({
|
||||
url: this.imageUrl,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
// 保存图片到相册
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.hideLoading();
|
||||
console.error('保存失败', err);
|
||||
|
||||
// 处理用户拒绝权限的情况
|
||||
if (err.errMsg.includes('auth deny')) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '需要您授权保存图片到相册',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.openSetting({
|
||||
success: (settingRes) => {
|
||||
console.log('打开设置页面', settingRes);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '保存失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.hideLoading();
|
||||
console.error('下载失败', err);
|
||||
uni.showToast({
|
||||
title: '下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 双击重置缩放和位置(可选功能)
|
||||
onDoubleTap() {
|
||||
this.scaleValue = 1;
|
||||
this.resetPosition();
|
||||
}
|
||||
},
|
||||
|
||||
// 页面返回前清理定时器
|
||||
onUnload() {
|
||||
if (this.tipTimer) {
|
||||
clearTimeout(this.tipTimer);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.preview-container {
|
||||
position: relative;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: #000;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.movable-area {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.movable-view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.image-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: transform 0.1s ease;
|
||||
}
|
||||
|
||||
.preview-img {
|
||||
display: block;
|
||||
}
|
||||
|
||||
// 关闭按钮
|
||||
.close-btn {
|
||||
position: fixed;
|
||||
top: 30rpx;
|
||||
right: 30rpx;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 1000;
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
|
||||
.close-icon {
|
||||
color: #fff;
|
||||
font-size: 40rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
// 下载按钮
|
||||
.download-btn {
|
||||
position: fixed;
|
||||
top: 30rpx;
|
||||
right: 110rpx;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 1000;
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
|
||||
.download-icon {
|
||||
color: #fff;
|
||||
font-size: 40rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
// 缩放提示
|
||||
.scale-tip {
|
||||
position: fixed;
|
||||
bottom: 100rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
color: #fff;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 40rpx;
|
||||
font-size: 28rpx;
|
||||
z-index: 1000;
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
animation: fadeInOut 1.5s ease;
|
||||
}
|
||||
|
||||
@keyframes fadeInOut {
|
||||
0% { opacity: 0; }
|
||||
15% { opacity: 1; }
|
||||
85% { opacity: 1; }
|
||||
100% { opacity: 0; }
|
||||
}
|
||||
</style>
|
||||
148
pages/message1/comp/steadyStateDetails.vue
Normal file
148
pages/message1/comp/steadyStateDetails.vue
Normal file
@@ -0,0 +1,148 @@
|
||||
<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.statisticsDate }}</view>
|
||||
</view>
|
||||
<view class="detail-content">
|
||||
<view class="detail-content-title mb20">基础信息</view>
|
||||
<view class="mb5"> 监测点名称:{{ detail.lineName }}</view>
|
||||
<view class="mb5"> 设备名称:{{ detail.devName }} </view>
|
||||
<view class="mb5"> 项目名称:{{ detail.projectName }} </view>
|
||||
<view class="mb5"> 工程名称:{{ detail.engineeringName }} </view>
|
||||
<view class="mb5" style="display: flex">
|
||||
越限详情:
|
||||
<view style="flex: 1">{{ detail.overLimitDesc }}</view></view
|
||||
>
|
||||
</view>
|
||||
<view class="detail-content">
|
||||
<view class="detail-content-title mb20"
|
||||
>指标越限详情<text class="prompt">(仅显示较为严重的10次)</text></view
|
||||
>
|
||||
|
||||
<uni-collapse accordion>
|
||||
<uni-collapse-item :title="item.targetName" v-for="item in list">
|
||||
<view class="data-table">
|
||||
<view class="table-header">
|
||||
<text>时间</text>
|
||||
<text>数据类型</text>
|
||||
<text v-if="!item.harmDetailList[0].hasT">A相</text>
|
||||
<text v-if="!item.harmDetailList[0].hasT">B相</text>
|
||||
<text v-if="!item.harmDetailList[0].hasT">C相</text>
|
||||
<text v-if="item.harmDetailList[0].hasT">总相</text>
|
||||
<text>限值</text>
|
||||
</view>
|
||||
<view class="table-row" v-for="value in item.harmDetailList">
|
||||
<text>{{ value.statisticsTime }}</text>
|
||||
<text>{{ value.valueType }}</text>
|
||||
<text v-if="!value.hasT">{{ value.dataA }}</text>
|
||||
<text v-if="!value.hasT">{{ value.dataB }}</text>
|
||||
<text v-if="!value.hasT">{{ value.dataC }}</text>
|
||||
<text v-if="value.hasT">{{ value.dataT }}</text>
|
||||
<text>{{ value.overLimitData }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</uni-collapse-item>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import { updateStatus, queryHarmonicDetail } from '@/common/api/message'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
detail: {},
|
||||
list: [],
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
// console.log(options.detail)
|
||||
this.detail = JSON.parse(decodeURIComponent(options.detail).replace(/百分比/g, '%'))
|
||||
this.init()
|
||||
if (this.detail.isRead != 1) {
|
||||
updateStatus({
|
||||
eventIds: [this.detail.eventId],
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
queryHarmonicDetail({
|
||||
lineId: this.detail.lineId,
|
||||
time: this.detail.statisticsDate,
|
||||
})
|
||||
.then((res) => {
|
||||
this.list = res.data
|
||||
this.loading = false
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
|
||||
// }
|
||||
},
|
||||
},
|
||||
}
|
||||
</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: 32rpx;
|
||||
color: #111;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
.limit {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: end;
|
||||
width: 450rpx;
|
||||
margin-left: auto;
|
||||
}
|
||||
.prompt {
|
||||
font-size: 24rpx;
|
||||
color: #111;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
.data-table {
|
||||
margin-top: 20rpx;
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
.table-header,
|
||||
.table-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
text {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
// color: #333;
|
||||
&:first-child {
|
||||
// text-align: left;
|
||||
flex: 1.2;
|
||||
}
|
||||
}
|
||||
}
|
||||
.table-header {
|
||||
padding: 0rpx;
|
||||
}
|
||||
}
|
||||
/deep/ .uni-collapse-item__title-text{
|
||||
font-weight: 700;
|
||||
}
|
||||
</style>
|
||||
95
pages/message1/comp/transientDetails.vue
Normal file
95
pages/message1/comp/transientDetails.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<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.startTime }}</view>
|
||||
</view>
|
||||
<view class="detail-content">
|
||||
<view class="detail-content-title mb20">基础信息</view>
|
||||
<view class="mb5"> 设备名称:{{ detail.equipmentName }}</view>
|
||||
<view class="mb5"> 项目名称:{{ detail.projectName }} </view>
|
||||
<view class="mb5"> 工程名称:{{ detail.engineeringName }} </view>
|
||||
<view class="mb5"> 暂态类型:{{ detail.showName }}</view>
|
||||
<view class="mb5" v-for="(item, textIndex) in detail.dataSet" :key="textIndex">
|
||||
{{ item.showName + ':' + (item.value == 3.1415926 ? '-' : item.value) + (item.unit || '') }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail-content">
|
||||
<view class="detail-content-title mb20">瞬时波形图</view>
|
||||
<image
|
||||
style="width: 100%"
|
||||
:src="detail.instantPics"
|
||||
mode="widthFix"
|
||||
v-if="detail.instantPics"
|
||||
@click="previewImage(detail.instantPics)"
|
||||
/>
|
||||
<text v-else>暂无</text>
|
||||
</view>
|
||||
<view class="detail-content">
|
||||
<view class="detail-content-title mb20">RMS波形图</view>
|
||||
<image
|
||||
style="width: 100%"
|
||||
:src="detail.rmsPics"
|
||||
mode="widthFix"
|
||||
v-if="detail.rmsPics"
|
||||
@click="previewImage(detail.rmsPics)"
|
||||
/>
|
||||
<text v-else>暂无</text>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import { updateStatus } from '@/common/api/message'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
detail: {},
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
// console.log(options.detail)
|
||||
this.detail = JSON.parse(decodeURIComponent(options.detail).replace(/百分比/g, '%'))
|
||||
this.detail.rmsPics && (this.detail.rmsPics = this.$config.static + this.detail.rmsPics)
|
||||
this.detail.instantPics && (this.detail.instantPics = this.$config.static + this.detail.instantPics)
|
||||
|
||||
this.loading = false
|
||||
if (this.detail.status != 1) {
|
||||
updateStatus({
|
||||
eventIds: [this.detail.id],
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
previewImage(url) {
|
||||
// uni.previewImage({
|
||||
// urls: [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: 32rpx;
|
||||
color: #111;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
182
pages/message1/index.scss
Normal file
182
pages/message1/index.scss
Normal file
@@ -0,0 +1,182 @@
|
||||
/* 整体容器:横向排列,间距均匀 */
|
||||
.statistics {
|
||||
display: flex;
|
||||
gap: 20rpx; /* 盒子之间的间距 */
|
||||
/* 通用盒子样式 */
|
||||
.box {
|
||||
flex: 1; /* 四个盒子等分宽度 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 130rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
/* 第一个盒子的特殊样式(蓝色背景) */
|
||||
.box:first-child {
|
||||
flex: 1.7;
|
||||
background-color: $uni-theme-color;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* 数字样式 */
|
||||
.num {
|
||||
font-size: 38rpx;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
/* 标签文字样式 */
|
||||
.label {
|
||||
font-size: 24rpx;
|
||||
color: inherit; /* 继承父元素颜色,适配蓝色背景 */
|
||||
}
|
||||
}
|
||||
/* 列表容器 */
|
||||
.event-list {
|
||||
background-color: #f5f7fa;
|
||||
box-sizing: border-box;
|
||||
/* 通用项样式 */
|
||||
/deep/ .uni-card:first-of-type {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
/deep/ .uni-card {
|
||||
padding: 0 !important;
|
||||
}
|
||||
/* 头部:图标 + 信息 + 操作 */
|
||||
.event-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
/* 图标区域(按类型区分背景色) */
|
||||
.event-icon {
|
||||
position: relative;
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.badge1 {
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
right: -10rpx;
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
background-color: #ff3b30; /* 红色徽章 */
|
||||
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
/* 电压暂降 - 蓝色系 */
|
||||
.sag .event-icon {
|
||||
background-color: #2563eb20;
|
||||
}
|
||||
/* 电压暂升 - 橙色系 */
|
||||
.swell .event-icon {
|
||||
background-color: #e6a23c20;
|
||||
}
|
||||
.interrupt .event-icon {
|
||||
background-color: #90939920;
|
||||
}
|
||||
.event-icon image {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
|
||||
/* 信息区域 */
|
||||
.event-info {
|
||||
flex: 1;
|
||||
}
|
||||
.event-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 5rpx;
|
||||
flex-wrap: wrap; /* 适配小屏,防止文字溢出 */
|
||||
}
|
||||
.event-id {
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
color: #333333;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
/* 标签样式(按类型区分) */
|
||||
.event-tag {
|
||||
font-size: 20rpx;
|
||||
padding: 0rpx 10rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #ffffff;
|
||||
height: 38rpx;
|
||||
}
|
||||
.sag-tag {
|
||||
background-color: #ecf5ff;
|
||||
color: #2563eb;
|
||||
}
|
||||
.swell-tag {
|
||||
background-color: #fdf6ec;
|
||||
color: #e6a23c;
|
||||
}
|
||||
.interrupt-tag {
|
||||
background-color: #f4f4f5;
|
||||
color: #909399;
|
||||
}
|
||||
/* 描述文本 */
|
||||
.event-desc {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
}
|
||||
.event-desc text {
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
/* 操作按钮 */
|
||||
.event-action {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #999999;
|
||||
font-size: 40rpx;
|
||||
/* 点击反馈 */
|
||||
touch-action: manipulation;
|
||||
}
|
||||
.event-action:active {
|
||||
color: #376cf3;
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
/* 详情文本 */
|
||||
.event-detail {
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
line-height: 1.5;
|
||||
padding-top: 10rpx;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
word-wrap: break-word; /* 自动换行,防止长文本溢出 */
|
||||
}
|
||||
}
|
||||
.smallLabel {
|
||||
padding: 0 20rpx 20rpx 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
.segmented-control {
|
||||
flex: 1;
|
||||
margin-right: 20rpx;
|
||||
height: 58rpx;
|
||||
}
|
||||
.uni-input {
|
||||
|
||||
font-size: 24rpx;
|
||||
color: #2563eb;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
127
pages/message1/run.vue
Normal file
127
pages/message1/run.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<view style="position: relative">
|
||||
<!-- 运行事件 -->
|
||||
|
||||
<!-- 卡片 -->
|
||||
<view
|
||||
class="event-list" :style="{ height: 'calc(100vh - ' + (navHeight + 10) + 'px)', overflow: 'auto' }">
|
||||
<!-- 循环渲染事件项 -->
|
||||
<uni-card
|
||||
class="event-item"
|
||||
:class="item.type"
|
||||
v-for="(item, index) in store.data"
|
||||
:key="index"
|
||||
@click="jump(item)"
|
||||
>
|
||||
<!-- 头部:图标 + 信息 + 操作 -->
|
||||
<view class="event-header">
|
||||
<view class="event-icon">
|
||||
<!-- 动态图标:根据类型切换 -->
|
||||
<uni-icons custom-prefix="iconfont" type="icon-shebei" size="30" color="#10B981"></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.equipmentName }}</text>
|
||||
</view>
|
||||
<view class="event-desc">
|
||||
<text>工程名称:{{ item.engineeringName }}</text>
|
||||
<text>项目名称:{{ item.projectName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 详情区域 -->
|
||||
<view class="event-detail">
|
||||
<text> 于{{ item.startTime }}发生{{ item.showName }} </text>
|
||||
</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>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import list from '@/common/js/list'
|
||||
import { updateStatus } from '@/common/api/message'
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
navHeight: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
selectValue: {
|
||||
type: Object,
|
||||
// default: () => {},
|
||||
},
|
||||
},
|
||||
mixins: [list],
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
mounted() {},
|
||||
|
||||
methods: {
|
||||
// 查詢
|
||||
init() {
|
||||
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
|
||||
this.store.params.type = 2
|
||||
this.store.params.pageSize = 10000
|
||||
this.store.params.sortField = this.sort
|
||||
this.store.params.engineeringid = this.selectValue.engineeringId
|
||||
this.store.params.projectId = this.selectValue.projectId
|
||||
this.store.params.deviceId = this.selectValue.deviceId
|
||||
this.store.params.lineId = this.selectValue.lineId
|
||||
this.store.params.startTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).firstDay
|
||||
this.store.params.endTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).lastDay
|
||||
this.store.loadedCallback = () => {
|
||||
this.loading = false
|
||||
}
|
||||
this.store.reload()
|
||||
},
|
||||
jump(item) {
|
||||
if (item.status != '1') {
|
||||
item.status = '1'
|
||||
updateStatus({
|
||||
eventIds: [item.id],
|
||||
})
|
||||
this.$emit('getDevCount')
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
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;
|
||||
|
||||
/* 头部:图标 + 信息 + 操作 */
|
||||
|
||||
/* 图标区域(按类型区分背景色) */
|
||||
.event-icon {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
|
||||
background-color: #10b98120;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
174
pages/message1/steadyState.vue
Normal file
174
pages/message1/steadyState.vue
Normal file
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<view style="position: relative">
|
||||
<!-- 稳态 -->
|
||||
<view class="transientBox">
|
||||
<view class="statistics pd20">
|
||||
<view class="box" v-for="item in list">
|
||||
<text class="num">{{ item.value }}</text>
|
||||
<text class="label">{{ item.label }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 卡片 -->
|
||||
<view
|
||||
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"
|
||||
@click="jump(item)"
|
||||
>
|
||||
<!-- 头部:图标 + 信息 + 操作 -->
|
||||
<view class="event-header">
|
||||
<view class="event-icon">
|
||||
<!-- 动态图标:根据类型切换 -->
|
||||
<uni-icons
|
||||
custom-prefix="iconfont"
|
||||
type="icon-kouanjiancedian"
|
||||
size="40"
|
||||
color="#E6A23C"
|
||||
></uni-icons>
|
||||
<view class="badge1" v-if="item.isRead == 0"> </view>
|
||||
</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 class="event-action"> 🔍 </view>
|
||||
</view>
|
||||
<!-- 详情区域 -->
|
||||
<view class="event-detail">
|
||||
<text> {{ item.overLimitDesc }} </text>
|
||||
</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>
|
||||
</view>
|
||||
</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 {
|
||||
height: 0,
|
||||
list: [
|
||||
{ value: 0, label: '稳态数量' },
|
||||
{ value: 0, label: '越限天数' },
|
||||
{ value: 0, label: '越限测点数' },
|
||||
],
|
||||
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() {
|
||||
this.store = this.DataSource('/cs-harmonic-boot/csHarmonic/queryHarmonicList')
|
||||
this.store.params.pageSize = 10000
|
||||
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.list[0].value = this.store.copyData.harmonicNums
|
||||
this.list[1].value = this.store.copyData.overDays
|
||||
this.list[2].value = this.store.copyData.overLineNums
|
||||
this.loading = false
|
||||
}
|
||||
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) })
|
||||
},
|
||||
},
|
||||
|
||||
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;
|
||||
}
|
||||
/* 列表容器 */
|
||||
.event-list {
|
||||
/* 头部:图标 + 信息 + 操作 */
|
||||
.event-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
/* 图标区域(按类型区分背景色) */
|
||||
.event-icon {
|
||||
background-color: #e6a23c20;
|
||||
}
|
||||
|
||||
.event-tags {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
251
pages/message1/transient.vue
Normal file
251
pages/message1/transient.vue
Normal file
@@ -0,0 +1,251 @@
|
||||
<template>
|
||||
<view style="position: relative">
|
||||
<!-- 暂态 -->
|
||||
<view class="transientBox">
|
||||
<view class="statistics pd20">
|
||||
<view class="box" v-for="item in list" @click="filterValue = item.key">
|
||||
<!-- <text class="num">{{ item.value }}</text> -->
|
||||
<text class="num">{{
|
||||
store &&
|
||||
store.data &&
|
||||
store.data.filter((k) => (item.key == '' ? item : k.showName == item.key)).length
|
||||
}}</text>
|
||||
<text class="label">{{ item.label }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="smallLabel">
|
||||
<uni-segmented-control
|
||||
:current="curSub"
|
||||
active-color="#376cf3"
|
||||
:values="subsectionList"
|
||||
@clickItem="sectionChange"
|
||||
v-if="subsectionList.length > 1"
|
||||
/>
|
||||
<view style="width: 180rpx">
|
||||
<picker @change="bindPickerChange" :value="sort" :range="array" v-if="curSub == 0">
|
||||
<view class="uni-input"
|
||||
>{{ array[sort] }}排序
|
||||
<uni-icons
|
||||
custom-prefix="iconfont"
|
||||
type="icon-paixu1"
|
||||
size="10"
|
||||
color="#2563EB"
|
||||
></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 卡片 -->
|
||||
<view
|
||||
class="event-list"
|
||||
v-if="curSub == 0"
|
||||
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
|
||||
>
|
||||
<!-- 循环渲染事件项 -->
|
||||
<uni-card
|
||||
class="event-item"
|
||||
:class="judgment(item.showName)"
|
||||
v-for="(item, index) in (store.data || []).filter((k) =>
|
||||
filterValue == '' ? k : k.showName == filterValue,
|
||||
)"
|
||||
:key="index"
|
||||
@click="jump(item)"
|
||||
>
|
||||
<!-- 头部:图标 + 信息 + 操作 -->
|
||||
<view class="event-header">
|
||||
<view class="event-icon">
|
||||
<!-- 动态图标:根据类型切换 -->
|
||||
<uni-icons
|
||||
:custom-prefix="judgment(item.showName) == 'interrupt' ? 'custom-icon' : 'iconfont'"
|
||||
:type="
|
||||
judgment(item.showName) == 'sag'
|
||||
? 'icon-xiajiang'
|
||||
: judgment(item.showName) == 'swell'
|
||||
? 'icon-shangsheng'
|
||||
: 'minus'
|
||||
"
|
||||
:color="
|
||||
judgment(item.showName) == 'sag'
|
||||
? '#2563eb '
|
||||
: judgment(item.showName) == 'swell'
|
||||
? '#e6a23c'
|
||||
: '#909399'
|
||||
"
|
||||
:size="judgment(item.showName) == 'interrupt' ? '50' : '25'"
|
||||
></uni-icons>
|
||||
<!-- 0未读 1已读 -->
|
||||
<view class="badge1" v-if="item.status == 0"> </view>
|
||||
</view>
|
||||
<view class="event-info">
|
||||
<view class="event-title">
|
||||
<text class="event-id">{{ item.equipmentName }}</text>
|
||||
<text class="event-tag" :class="`${judgment(item.showName)}-tag`">{{ item.showName }}</text>
|
||||
</view>
|
||||
<view class="event-desc">
|
||||
<text>工程名称:{{ item.engineeringName }}</text>
|
||||
<text>项目名称:{{ item.projectName }}</text>
|
||||
<text>监测点名称:{{ item.lineName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="event-action"> 🔍 </view>
|
||||
</view>
|
||||
<!-- 详情区域 -->
|
||||
<view class="event-detail">
|
||||
<text>
|
||||
发生时间:{{ item.startTime }},幅值:{{ item.evtParamVVaDepth }},持续时间:{{
|
||||
item.evtParamTm
|
||||
}},相别:{{ item.evtParamPhase }}
|
||||
</text>
|
||||
</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>
|
||||
</view>
|
||||
<!-- ITIC 列表 -->
|
||||
<ITIC
|
||||
v-if="subsectionList[curSub] == 'ITIC'"
|
||||
:store="store"
|
||||
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
|
||||
></ITIC>
|
||||
<!-- F47 列表 -->
|
||||
<F47
|
||||
v-if="subsectionList[curSub] == 'F47'"
|
||||
:store="store"
|
||||
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
|
||||
></F47>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import list from '@/common/js/list'
|
||||
import { queryUserPushConfig } from '@/common/api/mine'
|
||||
import ITIC from './comp/ITIC.vue'
|
||||
import F47 from './comp/F47.vue'
|
||||
export default {
|
||||
components: { ITIC, F47 },
|
||||
props: {
|
||||
navHeight: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
selectValue: {
|
||||
type: Object,
|
||||
// default: () => {},
|
||||
},
|
||||
},
|
||||
mixins: [list],
|
||||
data() {
|
||||
return {
|
||||
height: 0,
|
||||
filterValue: '',
|
||||
list: [
|
||||
{ value: 0, label: '暂态数量', key: '' },
|
||||
{ value: 0, label: '暂降', key: '电压暂降' },
|
||||
{ value: 0, label: '中断', key: '电压中断' },
|
||||
{ value: 0, label: '暂升', key: '电压暂升' },
|
||||
],
|
||||
curSub: 0,
|
||||
subsectionList: [], //'列表', 'ITIC', 'F47'
|
||||
status: 'noMore', //more加载前 loading加载中 noMore加载后
|
||||
sort: 0,
|
||||
// config: {},
|
||||
array: ['发生时间', '暂降深度', '持续时间'],
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
uni.createSelectorQuery()
|
||||
.select('.transientBox')
|
||||
.boundingClientRect((rect) => {
|
||||
//
|
||||
// #ifdef H5
|
||||
this.height = rect?.height + 12 || 0
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.height = rect?.height + 12 || 0
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 查詢
|
||||
init() {
|
||||
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
|
||||
this.store.params.type = 0
|
||||
this.store.params.pageSize = 10000
|
||||
this.store.params.sortField = this.sort
|
||||
this.store.params.engineeringid = this.selectValue.engineeringId
|
||||
this.store.params.projectId = this.selectValue.projectId
|
||||
this.store.params.deviceId = this.selectValue.deviceId
|
||||
this.store.params.lineId = this.selectValue.lineId
|
||||
this.store.params.startTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).firstDay
|
||||
this.store.params.endTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).lastDay
|
||||
this.store.loadedCallback = () => {
|
||||
this.getConfig()
|
||||
this.filterValue = ''
|
||||
this.loading = false
|
||||
}
|
||||
this.store.reload()
|
||||
},
|
||||
getConfig() {
|
||||
queryUserPushConfig().then((res) => {
|
||||
// this.config = res.data
|
||||
|
||||
this.subsectionList = [
|
||||
'列表',
|
||||
res.data.iticFunction == 1 ? 'ITIC' : '',
|
||||
res.data.f47Function == 1 ? 'F47' : '',
|
||||
].filter((item) => item)
|
||||
})
|
||||
},
|
||||
|
||||
judgment(val) {
|
||||
switch (val) {
|
||||
case '电压暂降':
|
||||
return 'sag'
|
||||
case '电压暂升':
|
||||
return 'swell'
|
||||
case '电压中断':
|
||||
return 'interrupt'
|
||||
}
|
||||
},
|
||||
// 点击查看详情
|
||||
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
|
||||
},
|
||||
},
|
||||
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';
|
||||
</style>
|
||||
Reference in New Issue
Block a user