统计数据的趋势

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