统计数据的趋势

This commit is contained in:
978184212@qq.com 2026-08-25 10:06:06 +08:00
parent 81a0a7ba3d
commit 951dcbc568
1 changed files with 35 additions and 55 deletions

View File

@ -127,11 +127,11 @@
scorllheight: 0,
zt: '',
date: new Date().getFullYear().toString(),
array: [],
array: [], //
index: 0,
index1: 0,
array1: [],
arrays: [],
array1: [], //
arrays: [], //
list: [],
tabList: ['站点名称', '告警指标', '指标值', '告警时间'],
pjlist: [],
@ -186,9 +186,9 @@
total: 0,
yearStr: null,
stationName1: '',
stationCode1: null,
stationCode: '',
arrays1: [],
stationCode1: null, // ID
stationCode: '', //
arrays1: [], //
zxtdata: [],
timList: [{
value: 'yearMonth',
@ -208,7 +208,10 @@
datetwo: currentDate,
riqinumber: 'yearMonth',
startDate: '2000-01-01',
endDate: '2030-12-31'
endDate: '2030-12-31',
//
stationList: [], // [{label: '', value: ''}]
deviceList: [] // [{label: '', value: 'ID'}]
}
},
onLoad() {
@ -234,29 +237,21 @@
if (!val && val !== 0) return 0
return val
},
//
//
importWyw() {
this.stationList = []
this.array = []
this.arrays = []
this.arrays1 = [{
label: '全部监测设备',
value: ''
}]
this.$http.get('/applet/survStationInfo/list').then(res => {
for (var i = 0; i < res.data.data.length; i++) {
this.arrays.push({
this.stationList.push({
label: res.data.data[i].stationName,
value: res.data.data[i].stationCode
})
this.arrays1.push({
label: res.data.data[i].stationName,
value: res.data.data[i].stationCode
value: res.data.data[i].stationCode //
})
this.array.push(res.data.data[i].stationName)
}
//
if (this.array.length > 0) {
this.stationCode = this.arrays[0]?.value || ''
if (this.stationList.length > 0) {
this.stationCode = this.stationList[0]?.value || ''
//
setTimeout(() => {
this.qushicov()
@ -266,23 +261,15 @@
console.log('获取站点列表失败', err)
})
},
//
//
getazsurvMulchRecord() {
this.arrays = []
this.deviceList = []
this.array1 = ['全部监测设备']
this.arrays1 = [{
label: '全部监测设备',
value: ''
}]
this.$http.get('/applet/survDeviceDeploy/survDeviceList').then(res => {
for (var i = 0; i < res.data.data.length; i++) {
this.arrays.push({
this.deviceList.push({
label: res.data.data[i].fullDeviceName,
value: res.data.data[i].id
})
this.arrays1.push({
label: res.data.data[i].fullDeviceName,
value: res.data.data[i].id
value: res.data.data[i].id // ID
})
this.array1.push(res.data.data[i].fullDeviceName)
}
@ -295,7 +282,7 @@
let params = {}
params.pageNo = this.pageNo
params.pageSize = this.pageSize
params.deployId = this.stationCode1
params.deployId = this.stationCode1 // 使ID
params.yearStr = this.yearStr
uni.showLoading({
title: '加载中'
@ -352,7 +339,6 @@
this.isRefresher = false
}).catch(err => {
uni.hideLoading();
console.log('获取预警列表失败', err)
})
},
//
@ -369,7 +355,7 @@
let params = {}
params.pageNo = this.pageNo
params.pageSize = this.pageSize
params.deployId = this.stationCode1
params.deployId = this.stationCode1 // 使ID
params.yearStr = this.yearStr
this.$http.get('/applet/wxclient/alertRecord', {
params: params
@ -468,14 +454,13 @@
qushicov() {
// 使
if (!this.stationCode) {
console.log('站点编码为空,使用默认站点')
if (this.arrays.length > 0) {
this.stationCode = this.arrays[0].value
if (this.stationList.length > 0) {
this.stationCode = this.stationList[0].value
} else {
//
setTimeout(() => {
if (this.arrays.length > 0) {
this.stationCode = this.arrays[0].value
if (this.stationList.length > 0) {
this.stationCode = this.stationList[0].value
this.qushicov()
}
}, 500)
@ -486,17 +471,14 @@
let data = {
summrayMode: this.riqinumber,
startTime: this.dateqs,
stationCode: this.stationCode,
stationCode: this.stationCode, // 使
}
console.log('请求趋势数据参数:', data)
this.$http.post('/applet/survDeviceDeploy/waterIntegrateStatistic', data).then(iem => {
let lynum = iem.data.data
console.log('趋势数据返回:', lynum)
//
if (!lynum || !lynum.tableHead || !lynum.tableData2 || lynum.tableHead.length === 0) {
console.log('趋势数据为空')
this.chartData = {
categories: [],
series: []
@ -566,35 +548,33 @@
categories: displayCategories,
series: series
}
console.log('图表数据:', this.chartData)
}, 300)
}).catch(err => {
console.log('趋势数据请求失败', err)
this.chartData = {
categories: [],
series: []
}
})
},
// 线
// 线 - 使 stationList
bindPickerChange: function(e) {
this.index = e.detail.value
let stationName = this.array[this.index]
for (var i = 0; i < this.arrays.length; i++) {
if (stationName == this.arrays[i].label) {
this.stationCode = this.arrays[i].value
for (var i = 0; i < this.stationList.length; i++) {
if (stationName == this.stationList[i].label) {
this.stationCode = this.stationList[i].value // 使 stationList
break
}
}
this.qushicov()
},
//
// - 使 deviceList
bindPickerChange1: function(e) {
this.index1 = e.detail.value
this.stationName1 = this.array1[this.index1]
for (var i = 0; i < this.arrays1.length; i++) {
if (this.stationName1 == this.arrays1[i].label) {
this.stationCode1 = this.arrays1[i].value
for (var i = 0; i < this.deviceList.length; i++) {
if (this.stationName1 == this.deviceList[i].label) {
this.stationCode1 = this.deviceList[i].value // 使 deviceList ID
break
}
}