From 5663e2b2bcee6de2ea7e47a267b45318317104e3 Mon Sep 17 00:00:00 2001
From: guoshipeng <3194674006@qq.com>
Date: Fri, 28 Jul 2023 17:29:42 +0800
Subject: [PATCH] fix
---
src/views/Monitoringstation/index.vue | 123 +++++++++++++++++++++++-----------------
1 files changed, 70 insertions(+), 53 deletions(-)
diff --git a/src/views/Monitoringstation/index.vue b/src/views/Monitoringstation/index.vue
index c84b88a..f3886b6 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"
@@ -87,12 +87,30 @@
startvalue: '',
endvalue: '',
options: [],
+ valueww: '',
columnList: [], //���������������
dateList: [],
- newMac1:[],
+ newMac1: [],
Monfactors: [],
tableData: [],
tableFields: {},
+ ddlist: [
+ {
+ 'PM2.5': '11',
+ PM10: 155,
+ ������: '2023-6-05',
+ },
+ {
+ 'PM2.5': '110',
+ PM10: 155,
+ ������: '2023-6-05',
+ },
+ {
+ 'PM2.5': '110',
+ PM10: 159,
+ ������: '2023-6-05',
+ },
+ ],
json_meta: [
[
{
@@ -119,41 +137,42 @@
//������������
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('���������������������')
+ console.log(this.valueww, '123')
+ 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 +182,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 +209,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 +289,4 @@
.zong {
padding: 20px;
}
-
</style>
\ No newline at end of file
--
Gitblit v1.8.0