From d16162b2c87381fab991e288f34b52a956a6456c Mon Sep 17 00:00:00 2001
From: yichenxi <yichenxi0601@163.com>
Date: Fri, 16 Dec 2022 16:51:57 +0800
Subject: [PATCH] 1、尘负荷走航路段多个时间添加
---
src/views/air/index.vue | 197 ++++++++-----------------------------------------
1 files changed, 32 insertions(+), 165 deletions(-)
diff --git a/src/views/air/index.vue b/src/views/air/index.vue
index 983023b..fa78f32 100644
--- a/src/views/air/index.vue
+++ b/src/views/air/index.vue
@@ -155,9 +155,8 @@
<div slot="tip" class="el-upload__tip">������������</div>
</el-upload>-->
<!-- <div style="position: absolute; bottom: 2%; right: 20%">-->
- <div style="position: absolute; right: 20%">
+ <div style="position: absolute; right: 20%;padding-top: 20px;">
<el-button v-if="value==='gx'" type="success" @click="submitUpload" size="small">������������</el-button>
-<!-- <el-button type="primary" @click="exportReport" size="small">������������</el-button>-->
</div>
</div>
<div class="exDown">
@@ -357,7 +356,7 @@
// ������
handleChange(file, fileList) {
if (file.raw.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
- this.$refs.upload.handleRemove(file)
+ this.$refs.upload1.handleRemove(file)
this.$message.warning(`���������������������������`)
return
}
@@ -487,7 +486,7 @@
if (res.code === 0) {
var reportInfo = res.data
this.value2 = [this.value3, this.value3]
- reportInfo.name = '���������������������������������' + reportInfo.time.split('-').join('')
+ reportInfo.name = '���������������������������������������' + reportInfo.time.split('-').join('')
this.tableData = [reportInfo]
}
}).catch(err => {
@@ -644,9 +643,9 @@
// ���������������������
getData.list1 = this.cityLast(getData.list1)
getData.list5 = this.cityLast(getData.list5)
- // ���������������������
- getData.list2 = this.cityFirst(getData.list2)
- getData.list3 = this.cityFirst(getData.list3)
+ // ���������/���������������������
+ getData.list2 = this.cityFirst2(getData.list2)
+ getData.list3 = this.cityFirst2(getData.list3)
getData.list4 = this.cityFirst(getData.list4)
this.airData = getData
var monthZero = res.data.time.split('���')[0]
@@ -661,7 +660,7 @@
} else {
this.airData.day = dayZero
}
- var arr = obj.time.split('-')
+ var arr = obj.date.split('-')
if (arr[2].substr(0, 1) === '0') {
arr[2] = arr[2].substr(1)
}
@@ -698,7 +697,9 @@
list.splice(i, 1)
}
})
- list.push(obj)
+ if (obj.place) {
+ list.push(obj)
+ }
return list
},
// ���������������������
@@ -710,7 +711,27 @@
list.splice(i, 1)
}
})
- list.unshift(obj)
+ if (obj.place) {
+ list.unshift(obj)
+ }
+ return list
+ },
+ // ���������������������������������������/���������
+ cityFirst2(list) {
+ var obj = {}
+ list.map((v, i) => {
+ if (v.place === '���������') {
+ obj = v
+ list.splice(i, 1)
+ }
+ if (v.place === '���������') {
+ obj = v
+ list.splice(i, 1)
+ }
+ })
+ if (obj.place) {
+ list.unshift(obj)
+ }
return list
},
// ���������������������
@@ -759,7 +780,7 @@
var code2 = res.data.code2.substr(0, 2) + '\n' + res.data.code2.substr(2)
var code4 = res.data.code4.substr(0, 2) + '\n' + res.data.code4.substr(2)
var table1Data = [['', '���������', '������', '������', '������'], ['', '', '', '', ''], ['���������', '300', res.data.code1, '', code2], ['', '', '', '', ''], ['PM2.5', '41', res.data.code3, '', code4], ['', '', '', '', '']]
- var table3Data = [['', '���������', '���������', '������', '������'], ['', '���������', '���������', '������', '������'], ['���������', '80', '80', res.data.code5, ''], ['', '', '', '', ''], ['PM2.5', '23', '23', res.data.code6, ''], ['', '', '', '', '']]
+ var table3Data = [['', '���������', '���������', '������', '������'], ['', '���������', '���������', '������', '������'], ['���������', '69', '69', res.data.code5, ''], ['', '', '', '', ''], ['PM2.5', '40', '40', res.data.code6, ''], ['', '', '', '', '']]
var table2Data = [
res.data.list.sy1,
res.data.list.sy2,
@@ -777,160 +798,6 @@
}).catch(err => {
console.log(err)
})
- },
- // ������������
- exportReport() {
- // ������excel������
- // table1������������
- /* var table1Data = [['', '���������', '������', '������', '������'], ['', '', '', '', ''], ['���������', '300', '215', '', '������\n11���'], ['', '', '', '', ''], ['PM2.5', '41', '33', '33', '������\n20.7%'], ['', '', '', '', '']]
- var table3Data = [['', '���������', '���������', '������', '������'], ['', '���������', '���������', '������', '������'], ['���������', '80', '80', '61', '61'], ['', '', '', '', ''], ['PM2.5', '23', '23', '18', '18'], ['', '', '', '', '']]
- var table2Data = [
- ['������������', '21', '25', '29', '27', '24', '26', '28', '18', '5', '', '', '', '215', '������9���'],
- ['PM2.5������������/������', '11', '30', '29', '27', '24', '26', '28', '18', '5', '', '', '', '215', '������17.9%'],
- ['������������', '21', '25', '29', '27', '24', '26', '28', '18', '5', '', '', '', '215', '������9���'],
- ['PM2.5������������/������', '22', '25', '23', '37', '34', '36', '38', '18', '5', '', '', '', '215', '������17.9%'],
- ['������������', '21', '25', '29', '27', '24', '26', '28', '18', '5', '', '', '', '215', '������9���'],
- ['PM2.5������������/������', '28', '69', '39', '27', '24', '26', '28', '18', '5', '', '', '', '215', '������17.9%'],
- ['������������', '21', '25', '29', '27', '24', '26', '28', '18', '5', '', '', '', '215', '������9���'],
- ['PM2.5������������/������', '32', '20', '29', '27', '24', '26', '28', '18', '5', '', '', '', '215', '������17.9%']
- ]
- var data = new Date()
- var currentYearData = data.getFullYear()
- var jd = '���'
- ExportHunnanExcel('������������������������', table1Data, table3Data, table2Data, currentYearData, jd)*/
-
- // ������word������
- // ������
- /* var arr = this.newTimeNotZero(this.value3).split('-')
- var currentTime = arr[0] + ' ���' + arr[1] + ' ���' + arr[2] + ' ���'
- var currentYear = arr[0]
- this.hunNanAirData.currentTime = currentTime
- this.hunNanAirData.currentYear = currentYear
- // ���������������������������
- var yearDate = '09���26���'
- var list1 = {
- sy: {
- AQI: 127,
- PM25: 38,
- PM10: 75,
- CO: 1.1,
- O38H: 21,
- SO2: 189,
- NO2: 20,
- ZH: 32,
- PaiM: '-'
- },
- hnd: {
- AQI: 71,
- PM25: 38,
- PM10: 75,
- CO: 1.1,
- O38H: 21,
- SO2: 189,
- NO2: 20,
- ZH: 32,
- PaiM: '-'
- },
- xxj: {
- AQI: 72,
- PM25: 38,
- PM10: 75,
- CO: 1.1,
- O38H: 21,
- SO2: 189,
- NO2: 20,
- ZH: 32,
- PaiM: '-'
- }
- }
- var hnd = {
- hnd1: {
- nd: '2022',
- yl: '226',
- excellent: '92',
- good: '134',
- slightPol: '36',
- moderatePol: '6',
- heavyPol: '1',
- seriousPol: '0'
- },
- hnd2: {
- nd: '2021',
- yl: '222',
- excellent: '92',
- good: '134',
- slightPol: '36',
- moderatePol: '6',
- heavyPol: '1',
- seriousPol: '0'
- },
- hnd3: {
- nd: '������������',
- yl: '4',
- excellent: '92',
- good: '134',
- slightPol: '36',
- moderatePol: '6',
- heavyPol: '1',
- seriousPol: '0'
- }
- }
- var xxj = {
- xxj1: {
- nd: '2022',
- yl: '226',
- excellent: '92',
- good: '134',
- slightPol: '36',
- moderatePol: '6',
- heavyPol: '1',
- seriousPol: '0'
- },
- xxj2: {
- nd: '2021',
- yl: '222',
- excellent: '92',
- good: '134',
- slightPol: '36',
- moderatePol: '6',
- heavyPol: '1',
- seriousPol: '0'
- },
- xxj3: {
- nd: '������������',
- yl: '4',
- excellent: '92',
- good: '134',
- slightPol: '36',
- moderatePol: '6',
- heavyPol: '1',
- seriousPol: '0'
- }
- }
- var datafor = {
- so2: '23%',
- no2: '25%',
- co: '-23'
- }
- // var airQua = '���������'
- var airQua = '���������'
- this.hunNanAirData.list1 = list1
- this.hunNanAirData.hnd = hnd
- this.hunNanAirData.xxj = xxj
- this.hunNanAirData.airQua = airQua
- // ������������������9���26���������������
- var month = yearDate.split('���')[0]
- if (month.substr(0, 1) === '0') {
- month = month.substr(1)
- }
- this.hunNanAirData.month = month
- var day = yearDate.split('���')[1].split('���')[0]
- if (day.substr(0, 1) === '0') {
- day = day.substr(1)
- }
- this.hunNanAirData.day = day
- this.hunNanAirData.datafor = datafor
- ExportBriefDataDocx('/HunnanReport.docx', this.hunNanAirData, `���������${month}���${day}���������������������������.docx`)*/
},
// ������������
selectReport(val) {
--
Gitblit v1.8.0