From 3275d9a30311f9509f8eed15bb7bae481be2f1f2 Mon Sep 17 00:00:00 2001 From: weicw <594098497@qq.com> Date: Fri, 28 Jan 2022 07:00:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E5=9F=BA=E7=A1=80=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/sound/zone/statistic/base.vue | 152 ++++++++++++++++++++++-- 1 file changed, 140 insertions(+), 12 deletions(-) diff --git a/src/views/sound/zone/statistic/base.vue b/src/views/sound/zone/statistic/base.vue index b665b21..7d8f12f 100644 --- a/src/views/sound/zone/statistic/base.vue +++ b/src/views/sound/zone/statistic/base.vue @@ -61,7 +61,8 @@ 查询 重置 - 导出Excel + 市级模板导出 + 县级模板导出 @@ -347,7 +348,134 @@ export default { }; this.reload(); }, - exportFile() { + exportCityFile() { + const columns = [ + { + title: "年", + dataIndex: "monitorYear", + }, + { + title: "网格长(米)", + dataIndex: "gridLength", + }, + { + title: "网格宽(米)", + dataIndex: "gridWidth", + }, + { + title: "测点名称", + dataIndex: "place", + }, + { + title: "点位编码", + dataIndex: "placeCode", + }, + {title: "所属区域",dataIndex: "area",}, + {title: "主要声源",dataIndex: "source",}, + { + title: "月", + dataIndex: "monitorMonth", + }, + { + title: "日", + dataIndex: "monitorDay", + }, + { + title: "时", + dataIndex: "monitorHour", + }, + { + title: "分", + dataIndex: "monitorMinute", + }, + { + title: "Leq dB(A)", + dataIndex: "indexLeq", + }, + { + title: "SD", + dataIndex: "indexSd", + }, + + { + title: "L10 dB(A)", + dataIndex: "indexL10", + }, + { + title: "L50 dB(A)", + dataIndex: "indexL50", + }, + { + title: "L90 dB(A)", + dataIndex: "indexL90", + }, + { + title: "Lmin dB(A)", + dataIndex: "indexLmin", + }, + { + title: "Lmax dB(A)", + dataIndex: "indexLmax", + }, + { + title: "监测站名", + dataIndex: "station", + sorter: true, + }, + { + title: "监测仪器型号", + dataIndex: "monitorInstrumentModel", + sorter: true, + }, + { + title: "监测仪器编号", + dataIndex: "monitorInstrumentCode", + sorter: true, + }, + { + title: "监测前校准值", + dataIndex: "beforeMonitorValue", + sorter: true, + }, + { + title: "声校准器测量声压值", + dataIndex: "soundPressureValue", + sorter: true, + }, + { + title: "声校准仪器型号", + dataIndex: "soundInstrumentModel", + sorter: true, + }, + { + title: "声校准仪器编号", + dataIndex: "soundInstrumentCode", + sorter: true, + }, + ]; + const arr = []; + const th = columns.map((item) => item.title); + arr.push(th); + listALlZoneNoise(this.where).then(res=>{ + res.data.data.forEach((d) => { + const td = columns.map((item) => { + let val = d[item.dataIndex]; + if(["indexLeq","indexL10","indexL50","indexL90","indexLmax","indexLmin","indexSd"].includes(item.dataIndex)){ + val = Number(val).toFixed(1); + } + return val; + }); + + arr.push(td); + }); + let sheet = XLSX.utils.aoa_to_sheet(arr); + this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString()); + }) + + + }, + + exportCountyFile() { const columns = [ { title: "行政区划代码", @@ -492,16 +620,16 @@ export default { dataIndex: "soundInstrumentCode", sorter: true, }, - { - title: "区域等级", - dataIndex: "regionLevel", - sorter: true, - }, - { - title: "备注", - dataIndex: "remark", - sorter: true, - }, + // { + // title: "区域等级", + // dataIndex: "regionLevel", + // sorter: true, + // }, + // { + // title: "备注", + // dataIndex: "remark", + // sorter: true, + // }, ]; const arr = []; const th = columns.map((item) => item.title);