diff --git a/src/views/sound/function/statistic/base.vue b/src/views/sound/function/statistic/base.vue index 08dc960..1192203 100644 --- a/src/views/sound/function/statistic/base.vue +++ b/src/views/sound/function/statistic/base.vue @@ -74,7 +74,8 @@ 查询 重置 - 导出Excel + 市级模板导出 + 县级模板导出 @@ -379,7 +380,150 @@ export default { }; this.reload(); }, - exportFile() { + exportCityFile() { + const columns = [ + { + title: "监测日期及时间", + dataIndex: "monitorTime", + }, + { + title: "点位名称", + dataIndex: "place", + sorter: true, + }, + { + title: "点位编码", + dataIndex: "placeCode", + sorter: true, + }, + { + title: "功能区类别", + dataIndex: "functionType", + sorter: true, + }, + { + 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: "Lmax dB(A)", + dataIndex: "indexLmax", + }, + { + title: "Lmin dB(A)", + dataIndex: "indexLmin", + }, + + { + title: "测点经度", + dataIndex: "placeLng", + sorter: true, + }, + { + title: "测点纬度", + dataIndex: "placeLat", + sorter: true, + }, + { + title: "测点高度", + dataIndex: "placeHeight", + sorter: true, + }, + { + title: "测点参照物", + dataIndex: "refObj", + sorter: true, + }, + { + title: "功能区代码", + dataIndex: "functionCode", + sorter: true, + }, + // { + // 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, + }, + { + title: "区域等级", + dataIndex: "regionLevel", + sorter: true, + }, + ]; + const arr = []; + const th = columns.map((item) => item.title); + arr.push(th); + listAllFunctionNoise(this.where).then(res=>{ + if(res.data.code == 0){ + 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); + }else if(item.dataIndex == "monitorTime"){ + return moment(val).format("YYYY-MM-DD HH:mm") + } + 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: "行政区划代码", @@ -518,11 +662,11 @@ export default { dataIndex: "soundInstrumentCode", sorter: true, }, - { - title: "区域等级", - dataIndex: "regionLevel", - sorter: true, - }, + // { + // title: "区域等级", + // dataIndex: "regionLevel", + // sorter: true, + // }, { title: "备注", dataIndex: "remark",