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]
@@ -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) {