quanyawei
2024-01-15 c9fc948cfa3cf91c072a13787aed5cb50fb31669
fix:bug修复
6 files modified
930 ■■■■■ changed files
src/views/Equidata/index.vue 88 ●●●●● patch | view | raw | blame | history
src/views/Equipment/index.vue 135 ●●●● patch | view | raw | blame | history
src/views/Listdata/index.vue 99 ●●●● patch | view | raw | blame | history
src/views/contrast/index.vue 121 ●●●●● patch | view | raw | blame | history
src/views/reportForm/sensor.vue 140 ●●●● patch | view | raw | blame | history
src/views/reportForm/sensorday.vue 347 ●●●●● patch | view | raw | blame | history
src/views/Equidata/index.vue
@@ -26,23 +26,33 @@
        :picker-options="pickerOptions"
        end-placeholder="结束日期"
        style="margin-left: 1rem"
      >
      </el-date-picker>
      />
      <el-button type="primary" @click="toExcel()" style="margin-left: 20px"
        >导出</el-button
      <el-button
        type="primary"
        style="margin-left: 20px"
        @click="toExcel()"
      >
      <el-button @click="exportMon">查询</el-button>
        导出
      </el-button>
      <el-button @click="exportMon">
        查询
      </el-button>
    </div>
    <el-table :data="dateList" id="exportTab" style="margin-top: 20px" border max-height="800">
    <el-table
      id="exportTab"
      :data="dateList"
      style="margin-top: 20px"
      border
      max-height="800"
    >
      <el-table-column
        v-for="item in columnList"
        :key="item"
        :prop="item"
        :label="item"
        width="180px"
        :key="item"
      >
      </el-table-column>
      />
    </el-table>
  </div>
</template>
@@ -56,7 +66,7 @@
export default {
  // import 引入的组件需要注入到对象中才能使用props
  data() {
  data () {
    // 这里存放数据
    return {
      props: { multiple: true },
@@ -68,7 +78,7 @@
      // newMac2:'',
      newSensor: [],
      timevalue: [],
      columnList: [], //表头的数组
      columnList: [], // 表头的数组
      dateList: [],
      pickerOptions: {
        disabledDate: (time) => {
@@ -81,12 +91,12 @@
  computed: {},
  // 监控data中的数据变化
  watch: {
    newMac(newVal, oldval) {
    newMac (newVal, oldval) {
      this.newMac1 = []
      this.newMac1.push(newVal[1][1])
      this.getSensor()
    },
    value(n, o) {
    value (n, o) {
      this.value1 = []
      for (let i = 0; i < n.length; i++) {
        this.value1.push(n[i][0])
@@ -94,22 +104,22 @@
    },
  },
  // 生命周期 - 创建完成(可以访问当前 this 实例)
  created() {
  created () {
    this.getData()
  },
  // 生命周期 - 挂载完成(可以访问 DOM 元素)
  mounted() {},
  beforeCreate() {}, // 生命周期 - 创建之前
  beforeMount() {}, // 生命周期 - 挂载之前
  beforeUpdate() {}, // 生命周期 - 更新之前
  updated() {}, // 生命周期 - 更新之后
  beforeDestroy() {}, // 生命周期 - 销毁之前
  destroyed() {}, // 生命周期 - 销毁完成
  activated() {},
  mounted () {},
  beforeCreate () {}, // 生命周期 - 创建之前
  beforeMount () {}, // 生命周期 - 挂载之前
  beforeUpdate () {}, // 生命周期 - 更新之前
  updated () {}, // 生命周期 - 更新之后
  beforeDestroy () {}, // 生命周期 - 销毁之前
  destroyed () {}, // 生命周期 - 销毁完成
  activated () {},
  // 方法集合
  methods: {
    // 请求左侧设备数据
    getData() {
    getData () {
      this.$request({
        url: '/monitorPoint/queryMonitorPoints',
        method: 'get',
@@ -127,14 +137,16 @@
              label: this.defaultData[i].name,
            })
            this.options[i].children = []
            for (let j = 0; j < this.defaultData[i].devices.length; j++) {
              this.options[i].children.push({
                value: [
                  this.defaultData[i].devices[j].name,
                  this.defaultData[i].devices[j].mac,
                ],
                label: this.defaultData[i].devices[j].name,
              })
            if (this.defaultData[i].devices) {
              for (let j = 0; j < this.defaultData[i].devices.length; j++) {
                this.options[i].children.push({
                  value: [
                    this.defaultData[i].devices[j].name,
                    this.defaultData[i].devices[j].mac,
                  ],
                  label: this.defaultData[i].devices[j].name,
                })
              }
            }
          }
        })
@@ -143,7 +155,7 @@
        })
    },
    // 通过mac号获得因子
    getSensor() {
    getSensor () {
      this.$request({
        url: '/deviceInfo/getMacSensors',
        method: 'post',
@@ -163,7 +175,7 @@
          console.log(err)
        })
    },
    exportMon() {
    exportMon () {
      console.log(this.timevalue)
      if (this.newMac == '') {
        this.$message.warning('请选择站点')
@@ -173,7 +185,7 @@
        this.$message.warning('请选择因子')
        return
      }
      this.dateList = []
      this.columnList = []
      this.$request({
@@ -197,7 +209,7 @@
        }
      })
    },
    toExcel() {
    toExcel () {
      let wb = XLSX.utils.table_to_book(document.querySelector('#exportTab'), {
        sheet: '分组表',
      })
@@ -215,9 +227,9 @@
      }
      return ws
    },
    setExlStyle(data) {
    setExlStyle (data) {
      let borderAll = {
        //单元格外侧框线
        // 单元格外侧框线
        top: {
          style: 'thin',
        },
@@ -237,7 +249,7 @@
          data[key].s = {
            border: borderAll,
            alignment: {
              horizontal: 'center', //水平居中对齐
              horizontal: 'center', // 水平居中对齐
              vertical: 'center',
            },
            font: {
src/views/Equipment/index.vue
@@ -2,7 +2,10 @@
  <div style="padding: 20px">
    <el-card>
      <div style="display: flex">
        <div class="timee" style="margin-top: 0.5rem">
        <div
          class="timee"
          style="margin-top: 0.5rem"
        >
          {{ time }}
        </div>
        <div style="margin-left: 1.5rem">
@@ -13,10 +16,10 @@
            :props="props"
            collapse-tags
            clearable
            @change="changeYz"
            placeholder="选择设备"
            style="width: 25rem"
          ></el-cascader>
            @change="changeYz"
          />
        </div>
        <div style="margin-left: 1.5rem">
          <span>选择因子:</span>
@@ -27,14 +30,19 @@
            collapse-tags
            clearable
            @change="res"
          ></el-cascader>
          />
        </div>
        <div style="margin-left: 1.5rem">
          <el-button type="primary" @click="Equisel">查询</el-button>
          <el-button
            type="primary"
            @click="Equisel"
          >
            查询
          </el-button>
        </div>
      </div>
    </el-card>
     <el-table
    <el-table
      :data="dateList"
      style="margin-top: 20px"
      border
@@ -42,37 +50,36 @@
    >
      <el-table-column
        v-for="item in columnList"
        :key="item"
        :prop="item"
        :label="item"
        width="180px"
        :key="item"
      >
      </el-table-column>
      />
    </el-table>
  </div>
</template>
</template>
<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
// 例如:import《组件名称》from'《组件路径》';
export default {
  //import 引入的组件需要注入到对象中才能使用
  // import 引入的组件需要注入到对象中才能使用
  components: {},
  props: {},
  data() {
    //这里存放数据
  data () {
    // 这里存放数据
    return {
      time: '',
      props: { multiple: true },
      defaultData: [],
      options: [],
      newSensor:[],
      newMac:'',
      newMac1:[],
      value:'',
      value1:'',
      columnList: [], //表头的数组
      newSensor: [],
      newMac: '',
      newMac1: [],
      value: '',
      value1: '',
      columnList: [], // 表头的数组
      dateList: [],
    }
  },
@@ -80,7 +87,7 @@
  computed: {},
  // 监控data中的数据变化
  watch: {
     newMac(newVal, oldval) {
    newMac (newVal, oldval) {
      this.newMac1 = []
      for (let i = 0; i < newVal.length; i++) {
        // console.log(newVal[i], 111)
@@ -90,19 +97,33 @@
      this.getSensor()
      console.log(this.newMac1)
    },
     value(n, o) {
    value (n, o) {
      this.value1 = []
      for (let i = 0; i < n.length; i++) {
        this.value1.push(n[i][0])
      }
    },
  },
  //方法集合
  // 生命周期 - 创建完成(可以访问当前 this 实例)
  created () {
    this.time = this.dateTypeFormat('YYYY-mm-dd HH:MM:SS', new Date())
    this.getData()
  },
  // 生命周期 - 挂载完成(可以访问 DOM 元素)
  mounted () {},
  beforeCreate () {}, // 生命周期 - 创建之前
  beforeMount () {}, // 生命周期 - 挂载之前
  beforeUpdate () {}, // 生命周期 - 更新之前
  updated () {}, // 生命周期 - 更新之后
  beforeDestroy () {}, // 生命周期 - 销毁之前
  destroyed () {}, // 生命周期 - 销毁完成
  activated () {},
  // 方法集合
  methods: {
    res(res){
      console.log(res.toString());
    res (res) {
      console.log(res.toString())
    },
    getData() {
    getData () {
      this.$request({
        url: '/monitorPoint/queryMonitorPoints',
        method: 'get',
@@ -118,14 +139,16 @@
              label: this.defaultData[i].name,
            })
            this.options[i].children = []
            for (let j = 0; j < this.defaultData[i].devices.length; j++) {
              this.options[i].children.push({
                value: [
                  this.defaultData[i].devices[j].name,
                  this.defaultData[i].devices[j].mac,
                ],
                label: this.defaultData[i].devices[j].name,
              })
            if (this.defaultData[i].devices) {
              for (let j = 0; j < this.defaultData[i].devices.length; j++) {
                this.options[i].children.push({
                  value: [
                    this.defaultData[i].devices[j].name,
                    this.defaultData[i].devices[j].mac,
                  ],
                  label: this.defaultData[i].devices[j].name,
                })
              }
            }
          }
        })
@@ -133,10 +156,10 @@
          console.log(error)
        })
    },
    changeYz(){
      this.getSensor();
    changeYz () {
      this.getSensor()
    },
     getSensor() {
    getSensor () {
      this.$request({
        url: '/deviceInfo/getMacSensors',
        method: 'post',
@@ -145,7 +168,7 @@
        },
      })
        .then((result) => {
          console.log(result);
          console.log(result)
          var sensor = result.data
          for (var i in sensor) {
            this.newSensor.push({ value: i, label: sensor[i] })
@@ -155,17 +178,17 @@
          console.log(err)
        })
    },
    Equisel(){
    Equisel () {
      this.$request({
        url:'',
        method:'post',
        data:{
          time:this.time,
          zhan:this.newMac1,
          sensorCode:this.value1
        url: '',
        method: 'post',
        data: {
          time: this.time,
          zhan: this.newMac1,
          sensorCode: this.value1
        }
      }).then((res)=>{
        console.log(res);
      }).then((res) => {
        console.log(res)
        this.tableData = res.data
        console.log(this.tableData, 'this.tableData')
        for (let key in this.tableData[0]) {
@@ -176,22 +199,8 @@
        }
      })
    }
  },
  //生命周期 - 创建完成(可以访问当前 this 实例)
  created() {
    this.time = this.dateTypeFormat('YYYY-mm-dd HH:MM:SS', new Date())
    this.getData();
  },
  //生命周期 - 挂载完成(可以访问 DOM 元素)
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  }, // 如果页面有keep-alive缓存功能,这个函数会触发
}
</script>
<style scoped>
</style>
</style>
src/views/Listdata/index.vue
@@ -31,7 +31,7 @@
          :props="props"
          collapse-tags
          clearable
        ></el-cascader>
        />
      </div>
      <div>
        <el-select
@@ -44,15 +44,14 @@
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
          />
        </el-select>
      </div>
      <component
        :is="dataType"
        style="padding-left: 0; margin-left: 20px; width: 160px"
        @sendPickerChild="showPickerChild"
        class="select11"
        @sendPickerChild="showPickerChild"
      />
      <!-- <el-button type="primary" @click="toExcel()" style="margin-left: 20px"
@@ -69,32 +68,38 @@
      <el-dropdown
        split-button
        type="primary"
        style="margin-left: 20px"
        @click="toExcel()"
        @command="handleCommand"
        style="margin-left: 20px"
      >
        导出
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item command="expNew">导出(新)</el-dropdown-item>
          <el-dropdown-item command="expNew">
            导出(新)
          </el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
      <el-button @click="exportMon" style="margin-left: 10px">查询</el-button>
      <el-button
        style="margin-left: 10px"
        @click="exportMon"
      >
        查询
      </el-button>
    </div>
    <el-table
      :data="dateList"
      id="exportTab"
      :data="dateList"
      style="margin-top: 20px"
      border
      max-height="800"
    >
      <el-table-column
        v-for="item in columnList"
        :key="item"
        :prop="item"
        :label="item"
        width="180px"
        :key="item"
      >
      </el-table-column>
      />
      <!-- <el-table-column
        v-for="item in columnList"
        :prop="item.props"
@@ -130,7 +135,7 @@
    TimePicker1,
    HourPicker1,
  },
  data() {
  data () {
    // 这里存放数据
    return {
      props: { multiple: true },
@@ -139,7 +144,7 @@
      newMac: '',
      newMac1: [],
      newSensor: [] /* 因子数组 */,
      columnList: [], //表头的数组
      columnList: [], // 表头的数组
      dateList: [],
      timevalue: [],
      select1: '日报',
@@ -170,7 +175,7 @@
  computed: {},
  // 监控data中的数据变化
  watch: {
    select1(nv, ov) {
    select1 (nv, ov) {
      if (nv === '日报') {
        this.dataType = 'HourPicker'
        this.unit = 'day'
@@ -189,7 +194,7 @@
      }
    },
    // 监听设备的数据更新
    newMac(newVal, oldval) {
    newMac (newVal, oldval) {
      this.newMac1 = []
      for (let i = 0; i < newVal.length; i++) {
        // console.log(newVal[i], 111)
@@ -201,23 +206,23 @@
    // 监听dataType的数据更新
  },
  // 生命周期 - 创建完成(可以访问当前 this 实例)
  created() {
  created () {
    this.getData()
  },
  // 生命周期 - 挂载完成(可以访问 DOM 元素)
  // mounted() {
  //
  // },
  beforeCreate() {}, // 生命周期 - 创建之前
  beforeMount() {}, // 生命周期 - 挂载之前
  beforeUpdate() {}, // 生命周期 - 更新之前
  updated() {}, // 生命周期 - 更新之后
  beforeDestroy() {}, // 生命周期 - 销毁之前
  destroyed() {}, // 生命周期 - 销毁完成
  activated() {},
  beforeCreate () {}, // 生命周期 - 创建之前
  beforeMount () {}, // 生命周期 - 挂载之前
  beforeUpdate () {}, // 生命周期 - 更新之前
  updated () {}, // 生命周期 - 更新之后
  beforeDestroy () {}, // 生命周期 - 销毁之前
  destroyed () {}, // 生命周期 - 销毁完成
  activated () {},
  // 方法集合
  methods: {
    handleCommand(command) {
    handleCommand (command) {
      if (this.newMac1 == '') {
        this.$message.warning('请选择站点')
        return
@@ -245,10 +250,10 @@
        this.getOutExcel('列表数据导出.xlsx', res)
      })
    },
    getOutExcel(fileName, res) {
    getOutExcel (fileName, res) {
      let blob = new Blob([res], { type: 'application/x-xls' })
      if (window.navigator.msSaveOrOpenBlob) {
        //兼容 IE & EDGE
        // 兼容 IE & EDGE
        navigator.msSaveBlob(blob, fileName)
      } else {
        var link = document.createElement('a')
@@ -256,18 +261,18 @@
        const url = window.URL || window.webkitURL || window.moxURL
        // 创建下载链接
        link.href = url.createObjectURL(blob)
        //命名下载名称
        // 命名下载名称
        link.download = fileName
        //点击触发下载
        // 点击触发下载
        link.click()
        //下载完成进行释放
        // 下载完成进行释放
        url.revokeObjectURL(link.href)
      }
    },
    showPickerChild(data) {
    showPickerChild (data) {
      this.newData = data
    },
    getData() {
    getData () {
      this.$request({
        url: '/monitorPoint/queryMonitorPoints',
        method: 'get',
@@ -285,14 +290,16 @@
              label: this.defaultData[i].name,
            })
            this.options[i].children = []
            for (let j = 0; j < this.defaultData[i].devices.length; j++) {
              this.options[i].children.push({
                value: [
                  this.defaultData[i].devices[j].name,
                  this.defaultData[i].devices[j].mac,
                ],
                label: this.defaultData[i].devices[j].name,
              })
            if (this.defaultData[i].devices) {
              for (let j = 0; j < this.defaultData[i].devices.length; j++) {
                this.options[i].children.push({
                  value: [
                    this.defaultData[i].devices[j].name,
                    this.defaultData[i].devices[j].mac,
                  ],
                  label: this.defaultData[i].devices[j].name,
                })
              }
            }
          }
        })
@@ -301,7 +308,7 @@
        })
    },
    // 通过设备号获得因子数据
    getSensor() {
    getSensor () {
      this.newSensor = []
      this.$request({
        url: '/deviceInfo/getMacSensors',
@@ -322,7 +329,7 @@
          console.log(err)
        })
    },
    exportMon() {
    exportMon () {
      if (this.newMac1 == '') {
        this.$message.warning('请选择站点')
        return
@@ -345,7 +352,7 @@
          times: this.newData instanceof Array ? this.newData : [this.newData],
        },
      }).then((res) => {
        //console.log(res, 11)
        // console.log(res, 11)
        this.tableData = res.data
        for (let key in this.tableData[0]) {
          this.columnList.push(key)
@@ -372,7 +379,7 @@
        // }
      })
    },
    toExcel() {
    toExcel () {
      let wb = XLSX.utils.table_to_book(document.querySelector('#exportTab'), {
        sheet: '分组表',
      })
@@ -390,9 +397,9 @@
      }
      return ws
    },
    setExlStyle(data) {
    setExlStyle (data) {
      let borderAll = {
        //单元格外侧框线
        // 单元格外侧框线
        top: {
          style: 'thin',
        },
@@ -412,7 +419,7 @@
          data[key].s = {
            border: borderAll,
            alignment: {
              horizontal: 'center', //水平居中对齐
              horizontal: 'center', // 水平居中对齐
              vertical: 'center',
            },
            font: {
src/views/contrast/index.vue
@@ -1,9 +1,22 @@
<template>
  <div style="width: 100%; height: 100%; margin:0 auto">
    <div class="topSelect">
      <el-cascader v-model="newMac" :options="options" clearable placeholder="选择设备" style="width: 354px" />
      <el-cascader v-model="value" :options="newSensor" :props="props" collapse-tags clearable placeholder="选择因子"
        style="margin-left: 20px" />
      <el-cascader
        v-model="newMac"
        :options="options"
        clearable
        placeholder="选择设备"
        style="width: 354px"
      />
      <el-cascader
        v-model="value"
        :options="newSensor"
        :props="props"
        collapse-tags
        clearable
        placeholder="选择因子"
        style="margin-left: 20px"
      />
      <!-- <el-select v-model="value" placeholder="选择因子">
        <el-option
          v-for="item in newSensor"
@@ -18,20 +31,40 @@
      <!-- <el-radio-button label="年报" />
        <el-radio-button label="自定义" /> -->
      <!-- </el-radio-group>  -->
      <el-select v-model="radio1" placeholder="请选择" style="margin-left: 20px">
        <el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value">
        </el-option>
      <el-select
        v-model="radio1"
        placeholder="请选择"
        style="margin-left: 20px"
      >
        <el-option
          v-for="item in options1"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        />
      </el-select>
      <component :is="dataType" class="select11" style="padding-left: 0; margin-left: 20px; width: 160px"
        @sendPickerChild="showPickerChild" />
      <component
        :is="dataType"
        class="select11"
        style="padding-left: 0; margin-left: 20px; width: 160px"
        @sendPickerChild="showPickerChild"
      />
      <!--查询按钮-->
      <el-button @click="selectData" class="btn1">查询</el-button>
      <el-button
        class="btn1"
        @click="selectData"
      >
        查询
      </el-button>
    </div>
    <!-- <div class="topTitle">
      <div style="position:absolute">(单位:ug/m³)</div>
      <div style="text-align: center;width: 100%;">{{ newData }}·{{ newMac?newMac[0]:'' }}·{{ newMac?newMac[newMac.length - 1][0]:'' }}·{{ value |sensorFilter }}·趋势图</div>
    </div> -->
    <LineChart :chart-data="lineChartData" style="height: 40rem;" />
    <LineChart
      :chart-data="lineChartData"
      style="height: 40rem;"
    />
  </div>
</template>
@@ -83,7 +116,7 @@
  props: {
    // defaultData: Array
  },
  data() {
  data () {
    // 这里存放数据
    return {
      dataType: 'HourPicker',
@@ -129,7 +162,7 @@
  computed: {},
  // 监控data中的数据变化
  watch: {
    newMac(newVal, oldval) {
    newMac (newVal, oldval) {
      this.newMac1 = []
      // for (let i = 0; i < newVal.length; i++) {
      //   this.newMac1.push(newVal[i][1][1])
@@ -140,13 +173,13 @@
      //   this.getSensor()
      // }
    },
    value(n, o) {
    value (n, o) {
      this.value1 = []
      for (let i = 0; i < n.length; i++) {
        this.value1.push(n[i][0])
      }
    },
    radio1(nv, ov) {
    radio1 (nv, ov) {
      if (nv === '日报') {
        this.dataType = 'HourPicker'
        this.unit = 0
@@ -167,22 +200,22 @@
    },
  },
  // 生命周期 - 创建完成(可以访问当前 this 实例)
  created() {
  created () {
    this.getData()
  },
  // 生命周期 - 挂载完成(可以访问 DOM 元素)
  mounted() { },
  beforeCreate() { }, // 生命周期 - 创建之前
  beforeMount() { }, // 生命周期 - 挂载之前
  beforeUpdate() { }, // 生命周期 - 更新之前
  updated() { }, // 生命周期 - 更新之后
  beforeDestroy() { }, // 生命周期 - 销毁之前
  destroyed() { }, // 生命周期 - 销毁完成
  activated() { },
  mounted () { },
  beforeCreate () { }, // 生命周期 - 创建之前
  beforeMount () { }, // 生命周期 - 挂载之前
  beforeUpdate () { }, // 生命周期 - 更新之前
  updated () { }, // 生命周期 - 更新之后
  beforeDestroy () { }, // 生命周期 - 销毁之前
  destroyed () { }, // 生命周期 - 销毁完成
  activated () { },
  // 方法集合
  methods: {
    // 请求左侧设备数据
    getData() {
    getData () {
      this.$request({
        url: '/monitorPoint/queryMonitorPoints',
        method: 'get',
@@ -200,14 +233,16 @@
              label: this.defaultData[i].name,
            })
            this.options[i].children = []
            for (let j = 0; j < this.defaultData[i].devices.length; j++) {
              this.options[i].children.push({
                value: [
                  this.defaultData[i].devices[j].name,
                  this.defaultData[i].devices[j].mac,
                ],
                label: this.defaultData[i].devices[j].name,
              })
            if (this.defaultData[i].devices) {
              for (let j = 0; j < this.defaultData[i].devices.length; j++) {
                this.options[i].children.push({
                  value: [
                    this.defaultData[i].devices[j].name,
                    this.defaultData[i].devices[j].mac,
                  ],
                  label: this.defaultData[i].devices[j].name,
                })
              }
            }
          }
        })
@@ -216,7 +251,7 @@
        })
    },
    // 通过mac号获得因子
    getSensor() {
    getSensor () {
      // stringMacs.su
      // var newMac = this.newMac[this.newMac.length - 1][this.newMac[this.newMac.length - 1].length - 1]
      // this.newMac1 = this.newMac[this.newMac.length - 1][this.newMac[this.newMac.length - 1].length - 1]
@@ -243,7 +278,7 @@
        })
    },
    // 查询
    selectData() {
    selectData () {
      var newLineChartData = {
        series: [],
        xAxis: [],
@@ -275,12 +310,16 @@
          }
          for (var i = 0; i < data.length; i++) {
            newLineChartData.series.push({
              data: [], name: '', type: 'line', triggerLineEvent: true,
              emphasis: { focus: 'series' }, lineStyle: { width: 4 }
              data: [],
              name: '',
              type: 'line',
              triggerLineEvent: true,
              emphasis: { focus: 'series' },
              lineStyle: { width: 4 }
            })
            // newLineChartData.yAxis.push({})
            newLineChartData.series[i].name = data[i].name
            newLineChartData.title.push(data[i].name);
            newLineChartData.title.push(data[i].name)
            for (var j = 0; j < data[i].timeValueList.length; j++) {
              newLineChartData.series[i].data.push(data[i].timeValueList[j].value)
            }
@@ -363,7 +402,7 @@
        })
    },
    // 获得子组件时间选择器传递的数据
    showPickerChild(data) {
    showPickerChild (data) {
      // var newLineChartData = {
      //   series: [],
      //   xAxis: [],
@@ -449,12 +488,12 @@
      // })
    },
    // 获取最大值
    getMaxValue(arr) {
    getMaxValue (arr) {
      // return Math.max.apply(null, arr)
      return Math.max(...arr)
    },
    // 对比排序函数
    compare(property, desc) {
    compare (property, desc) {
      return (a, b) => {
        var value1 = a[property]
        var value2 = b[property]
@@ -466,7 +505,7 @@
      }
    },
    // 过滤图表因子名称
    filterSensorName() {
    filterSensorName () {
      this.chartSensorName = this.$options.filters.sensorFilter(
        this.chartSensorKey[0].sensorCode
      )
src/views/reportForm/sensor.vue
@@ -12,7 +12,10 @@
          style="width: 21rem"
        />
        <div>
          <el-radio-group v-model="select1" style="margin-left: 20px">
          <el-radio-group
            v-model="select1"
            style="margin-left: 20px"
          >
            <el-radio-button label="小时报" />
            <el-radio-button label="日报" />
            <el-radio-button label="周报" />
@@ -23,8 +26,8 @@
        <component
          :is="dataType"
          style="padding-left: 0; margin-left: 30px"
          @sendPickerChild="showPickerChild"
          class="select11"
          @sendPickerChild="showPickerChild"
        />
        <el-date-picker
          v-if="dateDisplay"
@@ -38,11 +41,17 @@
        />
        <el-button
          type="primary"
          @click="getReportForm()"
          style="margin-left: 10px"
          >查询</el-button
          @click="getReportForm()"
        >
        <el-button type="primary" @click="exportExcel()">报表导出</el-button>
          查询
        </el-button>
        <el-button
          type="primary"
          @click="exportExcel()"
        >
          报表导出
        </el-button>
      </div>
    </div>
    <div class="topTitle">
@@ -56,7 +65,11 @@
        :stripe="true"
        @sort-change="changeTableSort"
      >
        <el-table-column prop="rank" label="排名" align="center" />
        <el-table-column
          prop="rank"
          label="排名"
          align="center"
        />
        <el-table-column
          prop="deviceName"
          label="设备"
@@ -69,8 +82,18 @@
          width="180"
          align="center"
        />
        <el-table-column prop="time" label="时间" width="180" align="center" />
        <el-table-column prop="aqi" label="AQI" sortable align="center" />
        <el-table-column
          prop="time"
          label="时间"
          width="180"
          align="center"
        />
        <el-table-column
          prop="aqi"
          label="AQI"
          sortable
          align="center"
        />
        <el-table-column
          prop="comIndex"
          label="综合指数"
@@ -78,13 +101,48 @@
          sortable
          align="center"
        />
        <el-table-column prop="a34004" label="PM2.5" sortable align="center" />
        <el-table-column prop="a34002" label="PM10" sortable align="center" />
        <el-table-column prop="a21026" label="SO2" sortable align="center" />
        <el-table-column prop="a21004" label="NO2" sortable align="center" />
        <el-table-column prop="a21005" label="CO" sortable align="center" />
        <el-table-column prop="a05024" label="O3_8H" sortable align="center" />
        <el-table-column prop="a99054" label="TVOC" sortable align="center" />
        <el-table-column
          prop="a34004"
          label="PM2.5"
          sortable
          align="center"
        />
        <el-table-column
          prop="a34002"
          label="PM10"
          sortable
          align="center"
        />
        <el-table-column
          prop="a21026"
          label="SO2"
          sortable
          align="center"
        />
        <el-table-column
          prop="a21004"
          label="NO2"
          sortable
          align="center"
        />
        <el-table-column
          prop="a21005"
          label="CO"
          sortable
          align="center"
        />
        <el-table-column
          prop="a05024"
          label="O3_8H"
          sortable
          align="center"
        />
        <el-table-column
          prop="a99054"
          label="TVOC"
          sortable
          align="center"
        />
      </el-table>
    </div>
  </div>
@@ -117,7 +175,7 @@
    weekPicker,
  },
  props: {},
  data() {
  data () {
    // 这里存放数据
    return {
      newData: [],
@@ -152,7 +210,7 @@
  computed: {},
  // 监控data中的数据变化
  watch: {
    select1(nv, ov) {
    select1 (nv, ov) {
      if (nv === '日报') {
        this.dataType = 'HourPicker'
        this.unit = 1
@@ -175,7 +233,7 @@
        this.dateDisplay = false
      }
    },
    newMac(newVal, oldval) {
    newMac (newVal, oldval) {
      this.newMac1 = []
      for (let i = 0; i < newVal.length; i++) {
        // console.log(newVal[i], 111)
@@ -186,25 +244,25 @@
  },
  // 生命周期 - 创建完成(可以访问当前 this 实例)
  created() {
  created () {
    this.getData()
  },
  // 生命周期 - 挂载完成(可以访问 DOM 元素)
  mounted() {},
  beforeCreate() {}, // 生命周期 - 创建之前
  beforeMount() {}, // 生命周期 - 挂载之前
  beforeUpdate() {}, // 生命周期 - 更新之前
  updated() {}, // 生命周期 - 更新之后
  beforeDestroy() {}, // 生命周期 - 销毁之前
  destroyed() {}, // 生命周期 - 销毁完成
  activated() {},
  mounted () {},
  beforeCreate () {}, // 生命周期 - 创建之前
  beforeMount () {}, // 生命周期 - 挂载之前
  beforeUpdate () {}, // 生命周期 - 更新之前
  updated () {}, // 生命周期 - 更新之后
  beforeDestroy () {}, // 生命周期 - 销毁之前
  destroyed () {}, // 生命周期 - 销毁完成
  activated () {},
  // 方法集合
  methods: {
    showPickerChild(data) {
    showPickerChild (data) {
      this.newData = data
    },
    // 重新添加rank排名(当表格的排序条件发生变化的时候会触发该事件)
    changeTableSort() {
    changeTableSort () {
      var sortTableData = this.$refs.mytable.tableData
      // console.log(this.$refs.mytable.tableData, 111)
      for (let i = 0; i < sortTableData.length; i++) {
@@ -213,7 +271,7 @@
    },
    // 导出报表
    exportExcel() {
    exportExcel () {
      /* generate workbook object from table */
      var xlsxParam = { raw: true } // 导出的内容只做解析,不进行格式转换
      var wb = XLSX.utils.table_to_book(
@@ -240,7 +298,7 @@
      return wbout
    },
    // 请求站点信息
    getData() {
    getData () {
      this.$request({
        url: '/monitorPoint/queryMonitorPoints',
        method: 'get',
@@ -258,14 +316,16 @@
              label: this.defaultData[i].name,
            })
            this.options[i].children = []
            for (let j = 0; j < this.defaultData[i].devices.length; j++) {
              this.options[i].children.push({
                value: [
                  this.defaultData[i].devices[j].name,
                  this.defaultData[i].devices[j].mac,
                ],
                label: this.defaultData[i].devices[j].name,
              })
            if (this.defaultData[i].devices) {
              for (let j = 0; j < this.defaultData[i].devices.length; j++) {
                this.options[i].children.push({
                  value: [
                    this.defaultData[i].devices[j].name,
                    this.defaultData[i].devices[j].mac,
                  ],
                  label: this.defaultData[i].devices[j].name,
                })
              }
            }
          }
        })
@@ -274,7 +334,7 @@
        })
    },
    // 请求报表数据
    getReportForm() {
    getReportForm () {
      this.$request({
        url: '/dataDisplay/monitorPointDataDisplay',
        method: 'post',
src/views/reportForm/sensorday.vue
@@ -12,7 +12,10 @@
          style="width: 21rem"
        />
        <div>
          <el-radio-group v-model="select1" style="margin-left: 20px">
          <el-radio-group
            v-model="select1"
            style="margin-left: 20px"
          >
            <el-radio-button label="日报" />
            <el-radio-button label="周报" />
            <el-radio-button label="月报" />
@@ -22,8 +25,8 @@
        <component
          :is="dataType"
          style="padding-left: 0; margin-left: 30px"
          @sendPickerChild="showPickerChild"
          class="select11"
          @sendPickerChild="showPickerChild"
        />
        <el-date-picker
          v-if="dateDisplay"
@@ -37,28 +40,46 @@
        />
        <el-button
          type="primary"
          @click="getReportForm()"
          style="margin-left: 10px"
          >查询</el-button
          @click="getReportForm()"
        >
        <el-button type="primary" @click="exportExcel()">报表导出</el-button>
          查询
        </el-button>
        <el-button
          type="primary"
          @click="exportExcel()"
        >
          报表导出
        </el-button>
      </div>
    </div>
    <div class="topTitle">
      <el-table
        :data="tableData"
        id="exportTabs"
        :data="tableData"
        max-height="730"
        @sort-change="changeTableSort"
        style="width: 100%"
        @sort-change="changeTableSort"
      >
        <el-table-column prop="name" label="站点名称" align="center">
        </el-table-column>
        <el-table-column label="综合指数" align="center">
          <el-table-column prop="composite" label="指数" align="center">
            <template slot-scope="scope">{{
              scope.row.composite !== 0 ? scope.row.composite : '--'
            }}</template>
        <el-table-column
          prop="name"
          label="站点名称"
          align="center"
        />
        <el-table-column
          label="综合指数"
          align="center"
        >
          <el-table-column
            prop="composite"
            label="指数"
            align="center"
          >
            <template slot-scope="scope">
              {{
                scope.row.composite !== 0 ? scope.row.composite : '--'
              }}
            </template>
          </el-table-column>
          <el-table-column
            label="排名"
@@ -66,93 +87,207 @@
            prop="compositeNum"
            sortable
          >
            <template slot-scope="scope">{{
              scope.row.compositeNum !== 0 ? scope.row.compositeNum : '--'
            }}</template>
            <template slot-scope="scope">
              {{
                scope.row.compositeNum !== 0 ? scope.row.compositeNum : '--'
              }}
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column label="PM2.5" align="center">
          <el-table-column prop="pm25" label="浓度" align="center">
            <template slot-scope="scope">{{
              scope.row.pm25 !== 0 ? scope.row.pm25 : '--'
            }}</template>
        <el-table-column
          label="PM2.5"
          align="center"
        >
          <el-table-column
            prop="pm25"
            label="浓度"
            align="center"
          >
            <template slot-scope="scope">
              {{
                scope.row.pm25 !== 0 ? scope.row.pm25 : '--'
              }}
            </template>
          </el-table-column>
          <el-table-column label="排名" align="center" prop="pm25Num" sortable>
            <template slot-scope="scope">{{
              scope.row.pm25Num !== 0 ? scope.row.pm25Num : '--'
            }}</template>
          <el-table-column
            label="排名"
            align="center"
            prop="pm25Num"
            sortable
          >
            <template slot-scope="scope">
              {{
                scope.row.pm25Num !== 0 ? scope.row.pm25Num : '--'
              }}
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column label="PM10" align="center">
          <el-table-column prop="pm10" label="浓度" align="center">
            <template slot-scope="scope">{{
              scope.row.pm10 !== 0 ? scope.row.pm10 : '--'
            }}</template>
        <el-table-column
          label="PM10"
          align="center"
        >
          <el-table-column
            prop="pm10"
            label="浓度"
            align="center"
          >
            <template slot-scope="scope">
              {{
                scope.row.pm10 !== 0 ? scope.row.pm10 : '--'
              }}
            </template>
          </el-table-column>
          <el-table-column label="排名" align="center" prop="pm10Num" sortable>
            <template slot-scope="scope">{{
              scope.row.pm10Num !== 0 ? scope.row.pm10Num : '--'
            }}</template>
          <el-table-column
            label="排名"
            align="center"
            prop="pm10Num"
            sortable
          >
            <template slot-scope="scope">
              {{
                scope.row.pm10Num !== 0 ? scope.row.pm10Num : '--'
              }}
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column label="SO2" align="center">
          <el-table-column prop="so2" label="浓度" align="center">
            <template slot-scope="scope">{{
              scope.row.so2 !== 0 ? scope.row.so2 : '--'
            }}</template>
        <el-table-column
          label="SO2"
          align="center"
        >
          <el-table-column
            prop="so2"
            label="浓度"
            align="center"
          >
            <template slot-scope="scope">
              {{
                scope.row.so2 !== 0 ? scope.row.so2 : '--'
              }}
            </template>
          </el-table-column>
          <el-table-column label="排名" align="center" prop="so2Num" sortable>
            <template slot-scope="scope">{{
              scope.row.so2Num !== 0 ? scope.row.so2Num : '--'
            }}</template>
          <el-table-column
            label="排名"
            align="center"
            prop="so2Num"
            sortable
          >
            <template slot-scope="scope">
              {{
                scope.row.so2Num !== 0 ? scope.row.so2Num : '--'
              }}
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column label="NO2" align="center">
          <el-table-column prop="no2" label="浓度" align="center">
            <template slot-scope="scope">{{
              scope.row.no2 !== 0 ? scope.row.no2 : '--'
            }}</template>
        <el-table-column
          label="NO2"
          align="center"
        >
          <el-table-column
            prop="no2"
            label="浓度"
            align="center"
          >
            <template slot-scope="scope">
              {{
                scope.row.no2 !== 0 ? scope.row.no2 : '--'
              }}
            </template>
          </el-table-column>
          <el-table-column label="排名" align="center" prop="no2Num" sortable>
            <template slot-scope="scope">{{
              scope.row.no2Num !== 0 ? scope.row.no2Num : '--'
            }}</template>
          <el-table-column
            label="排名"
            align="center"
            prop="no2Num"
            sortable
          >
            <template slot-scope="scope">
              {{
                scope.row.no2Num !== 0 ? scope.row.no2Num : '--'
              }}
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column label="CO" align="center">
          <el-table-column prop="co" label="浓度" align="center">
            <template slot-scope="scope">{{
              scope.row.co !== 0 ? scope.row.co : '--'
            }}</template>
        <el-table-column
          label="CO"
          align="center"
        >
          <el-table-column
            prop="co"
            label="浓度"
            align="center"
          >
            <template slot-scope="scope">
              {{
                scope.row.co !== 0 ? scope.row.co : '--'
              }}
            </template>
          </el-table-column>
          <el-table-column label="排名" align="center" prop="conum" sortable>
            <template slot-scope="scope">{{
              scope.row.conum !== 0 ? scope.row.conum : '--'
            }}</template>
          <el-table-column
            label="排名"
            align="center"
            prop="conum"
            sortable
          >
            <template slot-scope="scope">
              {{
                scope.row.conum !== 0 ? scope.row.conum : '--'
              }}
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column label="O3" align="center">
          <el-table-column prop="o3" label="浓度" align="center">
            <template slot-scope="scope">{{
              scope.row.o3 !== 0 ? scope.row.o3 : '--'
            }}</template>
        <el-table-column
          label="O3"
          align="center"
        >
          <el-table-column
            prop="o3"
            label="浓度"
            align="center"
          >
            <template slot-scope="scope">
              {{
                scope.row.o3 !== 0 ? scope.row.o3 : '--'
              }}
            </template>
          </el-table-column>
          <el-table-column label="排名" align="center" prop="o3Num" sortable>
            <template slot-scope="scope">{{
              scope.row.o3Num !== 0 ? scope.row.o3Num : '--'
            }}</template>
          <el-table-column
            label="排名"
            align="center"
            prop="o3Num"
            sortable
          >
            <template slot-scope="scope">
              {{
                scope.row.o3Num !== 0 ? scope.row.o3Num : '--'
              }}
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column label="TVOC" align="center">
          <el-table-column prop="tovc" label="浓度" align="center">
            <template slot-scope="scope">{{
              scope.row.tovc !== 0 ? scope.row.tovc : '--'
            }}</template>
        <el-table-column
          label="TVOC"
          align="center"
        >
          <el-table-column
            prop="tovc"
            label="浓度"
            align="center"
          >
            <template slot-scope="scope">
              {{
                scope.row.tovc !== 0 ? scope.row.tovc : '--'
              }}
            </template>
          </el-table-column>
          <el-table-column label="排名" align="center" prop="tovcnum" sortable>
            <template slot-scope="scope">{{
              scope.row.tovcnum !== 0 ? scope.row.tovcnum : '--'
            }}</template>
          <el-table-column
            label="排名"
            align="center"
            prop="tovcnum"
            sortable
          >
            <template slot-scope="scope">
              {{
                scope.row.tovcnum !== 0 ? scope.row.tovcnum : '--'
              }}
            </template>
          </el-table-column>
        </el-table-column>
      </el-table>
@@ -187,7 +322,7 @@
    weekPicker,
  },
  props: {},
  data() {
  data () {
    // 这里存放数据
    return {
      newData: [],
@@ -222,7 +357,7 @@
  computed: {},
  // 监控data中的数据变化
  watch: {
    select1(nv, ov) {
    select1 (nv, ov) {
      if (nv === '日报') {
        this.dataType = 'HourPicker'
        this.unit = 1
@@ -242,7 +377,7 @@
        this.dateDisplay = false
      }
    },
    newMac(newVal, oldval) {
    newMac (newVal, oldval) {
      this.newMac1 = []
      for (let i = 0; i < newVal.length; i++) {
        // console.log(newVal[i], 111)
@@ -253,25 +388,25 @@
  },
  // 生命周期 - 创建完成(可以访问当前 this 实例)
  created() {
  created () {
    this.getData()
  },
  // 生命周期 - 挂载完成(可以访问 DOM 元素)
  mounted() {},
  beforeCreate() {}, // 生命周期 - 创建之前
  beforeMount() {}, // 生命周期 - 挂载之前
  beforeUpdate() {}, // 生命周期 - 更新之前
  updated() {}, // 生命周期 - 更新之后
  beforeDestroy() {}, // 生命周期 - 销毁之前
  destroyed() {}, // 生命周期 - 销毁完成
  activated() {},
  mounted () {},
  beforeCreate () {}, // 生命周期 - 创建之前
  beforeMount () {}, // 生命周期 - 挂载之前
  beforeUpdate () {}, // 生命周期 - 更新之前
  updated () {}, // 生命周期 - 更新之后
  beforeDestroy () {}, // 生命周期 - 销毁之前
  destroyed () {}, // 生命周期 - 销毁完成
  activated () {},
  // 方法集合
  methods: {
    showPickerChild(data) {
    showPickerChild (data) {
      this.newData = data
    },
    // 重新添加rank排名(当表格的排序条件发生变化的时候会触发该事件)
    changeTableSort() {
    changeTableSort () {
      var sortTableData = this.$refs.mytable.tableData
      // console.log(this.$refs.mytable.tableData, 111)
      for (let i = 0; i < sortTableData.length; i++) {
@@ -280,7 +415,7 @@
    },
    // 导出报表
    exportExcel() {
    exportExcel () {
      /* generate workbook object from table */
      var xlsxParam = { raw: true } // 导出的内容只做解析,不进行格式转换
      var wb = XLSX.utils.table_to_book(
@@ -307,7 +442,7 @@
      return wbout
    },
    // 请求站点信息
    getData() {
    getData () {
      this.$request({
        url: '/monitorPoint/queryMonitorPoints',
        method: 'get',
@@ -325,14 +460,16 @@
              label: this.defaultData[i].name,
            })
            this.options[i].children = []
            for (let j = 0; j < this.defaultData[i].devices.length; j++) {
              this.options[i].children.push({
                value: [
                  this.defaultData[i].devices[j].name,
                  this.defaultData[i].devices[j].mac,
                ],
                label: this.defaultData[i].devices[j].name,
              })
            if (this.defaultData[i].devices) {
              for (let j = 0; j < this.defaultData[i].devices.length; j++) {
                this.options[i].children.push({
                  value: [
                    this.defaultData[i].devices[j].name,
                    this.defaultData[i].devices[j].mac,
                  ],
                  label: this.defaultData[i].devices[j].name,
                })
              }
            }
          }
        })
@@ -341,7 +478,7 @@
        })
    },
    // 请求报表数据
    getReportForm() {
    getReportForm () {
      console.log(this.newData)
      this.$request({
        // url: '/monitorPoint/listMonitoring',