From eb07bc16cb0b06f3b96a4f59d74f82b62195f096 Mon Sep 17 00:00:00 2001 From: yichenxi <yichenxi0601@163.com> Date: Mon, 12 Dec 2022 13:56:47 +0800 Subject: [PATCH] 1、尘负荷走航路段报告 --- src/views/Monitoringstation/index.vue | 104 +++++++++++++++++++++++++-------------------------- 1 files changed, 51 insertions(+), 53 deletions(-) diff --git a/src/views/Monitoringstation/index.vue b/src/views/Monitoringstation/index.vue index c84b88a..4d3e070 100644 --- a/src/views/Monitoringstation/index.vue +++ b/src/views/Monitoringstation/index.vue @@ -1,6 +1,6 @@ <template> - <div class="zong" > - <div style="display: flex;"> + <div class="zong"> + <div style="display: flex"> <el-select v-model="value" placeholder="���������������������" @@ -50,13 +50,13 @@ > <el-button @click="exportMon">������</el-button> </div> - + <el-table :data="dateList" - style="margin-top: 20px;" + style="margin-top: 20px" id="exportTab" border - max-height="800" + max-height="800" > <el-table-column v-for="item in columnList" @@ -89,7 +89,7 @@ options: [], columnList: [], //��������������� dateList: [], - newMac1:[], + newMac1: [], Monfactors: [], tableData: [], tableFields: {}, @@ -119,41 +119,41 @@ //������������ name: 'exporName', methods: { - getMonitor(res){ - this.Monfactors=[] + getMonitor(res) { + this.Monfactors = [] this.$request({ - url:'sensor/getSensorsByMonitorPointIds', - method:'get', - params:{ - monitorPointIds:res - } - }).then((res)=>{ - console.log(res); - this.Monfactors=res.data + url: 'sensor/getSensorsByMonitorPointIds', + method: 'get', + params: { + monitorPointIds: res, + }, + }).then((res) => { + console.log(res) + this.Monfactors = res.data }) }, exportMon() { - if(this.value===""){ - this.$message.warning('���������������������') + if (this.value === '') { + this.$message.warning('���������������������') return } - if(this.value1===""){ - this.$message.warning('���������������') + if (this.value1 === '') { + this.$message.warning('���������������') return } - if(this.startvalue===""){ - this.$message.warning('���������������������') + if (this.startvalue === '') { + this.$message.warning('���������������������') return } - if(this.endvalue===""){ - this.$message.warning('���������������������') + if (this.endvalue === '') { + this.$message.warning('���������������������') return } this.dateList = [] this.columnList = [] this.$request({ url: '/monitorPoint/getHourlyDataByMonitorPoint', - method: 'get', + method: 'get', params: { monitorPointId: this.value, sensors: this.value1.toString(), @@ -163,15 +163,15 @@ }).then((res) => { console.log(res, 11) this.tableData = res.data - console.log(this.tableData, 'this.tableData') - for (let key in this.tableData[0]) { + console.log(this.tableData, 'this.tableData') + for (let key in this.tableData[0]) { this.columnList.push(key) } for (let item of this.tableData) { this.dateList.push(item) } }) - console.log(1); + console.log(1) }, getMonitorPointId() { this.$request({ @@ -190,71 +190,70 @@ label: res.data[i].name, }) } - console.log(this.options); - + console.log(this.options) }) .catch((err) => { console.log(err) }) - }, toExcel() { - let wb = XLSX.utils.table_to_book(document.querySelector('#exportTab'), { sheet: "���������" }); - this.setExlStyle(wb["Sheets"]["���������"]); + let wb = XLSX.utils.table_to_book(document.querySelector('#exportTab'), { + sheet: '���������', + }) + this.setExlStyle(wb['Sheets']['���������']) var ws = XLSX2.write(wb, { - type: "buffer", - }); + type: 'buffer', + }) try { FileSaver.saveAs( - new Blob([ws], { type: "application/octet-stream" }), + new Blob([ws], { type: 'application/octet-stream' }), `���������������������.xlsx` - ); + ) } catch (e) { - if (typeof console !== "undefined") console.log(e, ws); + if (typeof console !== 'undefined') console.log(e, ws) } - return ws; + return ws }, setExlStyle(data) { let borderAll = { //��������������������� top: { - style: "thin", + style: 'thin', }, bottom: { - style: "thin", + style: 'thin', }, left: { - style: "thin", + style: 'thin', }, right: { - style: "thin", + style: 'thin', }, - }; - data["!cols"] = []; + } + data['!cols'] = [] for (let key in data) { if (data[key] instanceof Object) { data[key].s = { border: borderAll, alignment: { - horizontal: "center", //������������������ - vertical: "center", + horizontal: 'center', //������������������ + vertical: 'center', }, font: { sz: 11, }, bold: true, numFmt: 0, - }; - data["!cols"].push({ wpx: 200 }); + } + data['!cols'].push({ wpx: 200 }) } } - return data; + return data }, - }, //������������ - ��������������������������������� this ��������� created() { - this.getMonitorPointId(); + this.getMonitorPointId() }, //������������ - ��������������������������� DOM ��������� mounted() {}, @@ -271,5 +270,4 @@ .zong { padding: 20px; } - </style> \ No newline at end of file -- Gitblit v1.8.0