区域基础数据导出
This commit is contained in:
@@ -61,7 +61,8 @@
|
|||||||
<a-space>
|
<a-space>
|
||||||
<a-button type="primary" @click="reload">查询</a-button>
|
<a-button type="primary" @click="reload">查询</a-button>
|
||||||
<a-button @click="reset" style="background: #FFA200FF; border-color: #FFA200FF;color: #FFFFFF">重置</a-button>
|
<a-button @click="reset" style="background: #FFA200FF; border-color: #FFA200FF;color: #FFFFFF">重置</a-button>
|
||||||
<a-button @click="exportFile" style="background: #2FA524FF; border-color: #2FA524FF;color: #FFFFFF">导出Excel</a-button>
|
<a-button @click="exportCityFile" style="background: #2FA524FF; border-color: #2FA524FF;color: #FFFFFF">市级模板导出</a-button>
|
||||||
|
<a-button @click="exportCountyFile" style="background: #2FA524FF; border-color: #2FA524FF;color: #FFFFFF">县级模板导出</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@@ -347,7 +348,134 @@ export default {
|
|||||||
};
|
};
|
||||||
this.reload();
|
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 = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: "行政区划代码",
|
title: "行政区划代码",
|
||||||
@@ -492,16 +620,16 @@ export default {
|
|||||||
dataIndex: "soundInstrumentCode",
|
dataIndex: "soundInstrumentCode",
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: "区域等级",
|
// title: "区域等级",
|
||||||
dataIndex: "regionLevel",
|
// dataIndex: "regionLevel",
|
||||||
sorter: true,
|
// sorter: true,
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: "备注",
|
// title: "备注",
|
||||||
dataIndex: "remark",
|
// dataIndex: "remark",
|
||||||
sorter: true,
|
// sorter: true,
|
||||||
},
|
// },
|
||||||
];
|
];
|
||||||
const arr = [];
|
const arr = [];
|
||||||
const th = columns.map((item) => item.title);
|
const th = columns.map((item) => item.title);
|
||||||
|
|||||||
Reference in New Issue
Block a user