导入跳转
This commit is contained in:
@@ -1,31 +1,79 @@
|
||||
const tableColumns = [
|
||||
{title: "监测时间",dataIndex: "monitorTime",sorter: true,},
|
||||
{title: "点位名称",dataIndex: "pointName",sorter: true,},
|
||||
{title: "水温(℃)",dataIndex: "waterTemperature",sorter: true,},
|
||||
{title: "pH值(无量纲)",dataIndex: "ph",sorter: true,},
|
||||
{title: "透明度(cm)",dataIndex: "transparency",sorter: true,},
|
||||
{title: "溶解氧饱和度(﹪)",dataIndex: "dissolvedOxygenSaturation",sorter: true,},
|
||||
{title: "溶解氧",dataIndex: "dissolvedOxygen",sorter: true,},
|
||||
{title: "高锰酸盐指数",dataIndex: "permanganateIndex",sorter: true,},
|
||||
// {title: "监测时间",dataIndex: "monitorTime",sorter: true,},
|
||||
{title: "五日生化需氧量",dataIndex: "fiveDayBod",sorter: true,},
|
||||
{title: "总氮 ",dataIndex: "totalNitrogen",sorter: true,},
|
||||
{title: "氨氮",dataIndex: "ammonia",sorter: true,},
|
||||
{title: "挥发酚",dataIndex: "volatilePhenol",sorter: true,},
|
||||
{title: "砷",dataIndex: "as",sorter: true,},
|
||||
{title: "汞",dataIndex: "hg",sorter: true,},
|
||||
{title: "六价铬",dataIndex: "cr6",sorter: true,},
|
||||
{title: "铅(℃)",dataIndex: "pb",sorter: true,},
|
||||
{title: "镉",dataIndex: "cd",sorter: true,},
|
||||
{title: "总磷",dataIndex: "totalPhosphorus",sorter: true,},
|
||||
{title: "石油类",dataIndex: "petro",sorter: true,},
|
||||
{title: "粪大肠菌群(MPN/L)",dataIndex: "fecalColiforms",sorter: true,},
|
||||
{title: "化学需氧量",dataIndex: "cod",sorter: true,},
|
||||
{title: "叶绿素a(mg/m3)",dataIndex: "chlA",sorter: true,},
|
||||
{title: "阴离子表面活性剂",dataIndex: "anSaa",sorter: true,},
|
||||
{title: "硫化物",dataIndex: "s",sorter: true,},
|
||||
{title: "氧化还原电位(mV)",dataIndex: "oxidationReductionPotential",sorter: true,},
|
||||
{title: "备注",dataIndex: "remark",sorter: true,},
|
||||
];
|
||||
const innerTableColumns = [
|
||||
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
|
||||
{title: "断面名称", dataIndex: "pointName", sorter: true,},
|
||||
{title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,},
|
||||
{title: "pH值(无量纲)", dataIndex: "ph", sorter: true,},
|
||||
{title: "透明度(cm)", dataIndex: "transparency", sorter: true,},
|
||||
{title: "溶解氧饱和度(﹪)", dataIndex: "dissolvedOxygenSaturation", sorter: true,},
|
||||
{title: "溶解氧", dataIndex: "dissolvedOxygen", sorter: true,},
|
||||
{title: "高锰酸盐指数", dataIndex: "permanganateIndex", sorter: true,},
|
||||
// {title: "监测时间",dataIndex: "monitorTime",sorter: true,},
|
||||
{title: "五日生化需氧量", dataIndex: "fiveDayBod", sorter: true,},
|
||||
{title: "总氮 ", dataIndex: "totalNitrogen", sorter: true,},
|
||||
{title: "氨氮", dataIndex: "ammonia", sorter: true,},
|
||||
{title: "挥发酚", dataIndex: "volatilePhenol", sorter: true,},
|
||||
{title: "砷", dataIndex: "as", sorter: true,},
|
||||
{title: "汞", dataIndex: "hg", sorter: true,},
|
||||
{title: "六价铬", dataIndex: "cr6", sorter: true,},
|
||||
{title: "铅(℃)", dataIndex: "pb", sorter: true,},
|
||||
{title: "镉", dataIndex: "cd", sorter: true,},
|
||||
{title: "总磷", dataIndex: "totalPhosphorus", sorter: true,},
|
||||
{title: "石油类", dataIndex: "petro", sorter: true,},
|
||||
{title: "粪大肠菌群(MPN/L)", dataIndex: "fecalColiforms", sorter: true,},
|
||||
{title: "化学需氧量", dataIndex: "cod", sorter: true,},
|
||||
{title: "叶绿素a(mg/m3)", dataIndex: "chlA", sorter: true,},
|
||||
{title: "阴离子表面活性剂", dataIndex: "anSaa", sorter: true,},
|
||||
{title: "硫化物", dataIndex: "s", sorter: true,},
|
||||
{title: "氧化还原电位(mV)", dataIndex: "oxidationReductionPotential", sorter: true,},
|
||||
{title: "备注", dataIndex: "remark", sorter: true,},
|
||||
];
|
||||
const specialTableColumns = [
|
||||
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
|
||||
{title: "测站名称", dataIndex: "stationName", sorter: true,},
|
||||
{title: "测站代码", dataIndex: "stationCode", sorter: true,},
|
||||
{title: "湖库名称", dataIndex: "lakeLibraryName", sorter: true,},
|
||||
{title: "湖库代码", dataIndex: "lakeLibraryCode", sorter: true,},
|
||||
{title: "断面名称", dataIndex: "sectionName", sorter: true,},
|
||||
{title: "断面代码", dataIndex: "sectionCode", sorter: true,},
|
||||
{title: "控制属性", dataIndex: "controlAttributes", sorter: true,},
|
||||
{title: "所属流域", dataIndex: "watershed", sorter: true,},
|
||||
{title: "水期代码", dataIndex: "waterPeriodCode", sorter: true,},
|
||||
|
||||
export {tableColumns}
|
||||
{title: "浊度(NTU)", dataIndex: "turbidity", sorter: true,},
|
||||
{title: "水温(℃)", dataIndex: "wTemp", sorter: true,},
|
||||
{title: "水位(m)", dataIndex: "wd", sorter: true,},
|
||||
{title: "pH值", dataIndex: "ph", sorter: true,},
|
||||
{title: "电导率(ms/m)", dataIndex: "wCond", sorter: true,},
|
||||
{title: "透明度(cm)", dataIndex: "transp", sorter: true,},
|
||||
{title: "溶解氧 (mg/L)", dataIndex: "dissolvedOxygen", sorter: true,},
|
||||
{title: "高锰酸盐指数 (mg/L)", dataIndex: "codmn", sorter: true,},
|
||||
{title: "氨氮 (mg/L)", dataIndex: "nh4N", sorter: true,},
|
||||
{title: "石油类 (mg/L)", dataIndex: "oils", sorter: true,},
|
||||
{title: "总氮 (mg/L)", dataIndex: "nTotal", sorter: true,},
|
||||
{title: "总磷 (mg/L)", dataIndex: "pTotal", sorter: true,},
|
||||
{title: "叶绿素 (mg/L)", dataIndex: "chlA", sorter: true,},
|
||||
{title: "挥发酚 (mg/L)", dataIndex: "vPhen", sorter: true,},
|
||||
{title: "汞 (mg/L)", dataIndex: "wHg", sorter: true,},
|
||||
{title: "铅 (mg/L)", dataIndex: "wPb", sorter: true,},
|
||||
{title: "化学需氧量 (mg/L)", dataIndex: "codcr", sorter: true,},
|
||||
{title: "铜 (mg/L)", dataIndex: "wCu", sorter: true,},
|
||||
{title: "锌 (mg/L)", dataIndex: "wZn", sorter: true,},
|
||||
{title: "氟化物 (mg/L)", dataIndex: "f", sorter: true,},
|
||||
{title: "硒 (mg/L)", dataIndex: "se", sorter: true,},
|
||||
{title: "砷 (mg/L)", dataIndex: "as", sorter: true,},
|
||||
{title: "镉 (mg/L)", dataIndex: "cd", sorter: true,},
|
||||
{title: "六价铬 (mg/L)", dataIndex: "cr6", sorter: true,},
|
||||
{title: "氰化物 (mg/L)", dataIndex: "cnTotal", sorter: true,},
|
||||
{title: "阴离子表面活性剂 (mg/L)", dataIndex: "anSaa", sorter: true,},
|
||||
{title: "硫化物 (mg/L)", dataIndex: "s", sorter: true,},
|
||||
{title: "粪大肠菌群 (mg/L)", dataIndex: "coloOrg", sorter: true,},
|
||||
{title: "硫酸盐 (mg/L)", dataIndex: "so4", sorter: true,},
|
||||
{title: "氯化物 (mg/L)", dataIndex: "cl", sorter: true,},
|
||||
{title: "硝酸盐 (mg/L)", dataIndex: "no3N", sorter: true,},
|
||||
{title: "铁 (mg/L)", dataIndex: "wFe", sorter: true,},
|
||||
{title: "锰 (mg/L)", dataIndex: "wMn", sorter: true,},
|
||||
{title: "水质类别", dataIndex: "waterQualityCategory", sorter: true,},
|
||||
{title: "系统编码", dataIndex: "systemCode", sorter: true,},
|
||||
{title: "备注", dataIndex: "remark", sorter: true,},
|
||||
];
|
||||
export {innerTableColumns, specialTableColumns}
|
||||
|
||||
@@ -1,42 +1,63 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card style="width: 100%" :bordered="false">
|
||||
<template #title>
|
||||
<a-space>
|
||||
<a-upload
|
||||
:before-upload="importFileInnerCity"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
>
|
||||
<a-button>城市内湖导入</a-button>
|
||||
</a-upload>
|
||||
<a-upload
|
||||
:before-upload="importFileWuxiang"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
>
|
||||
<a-button>五象湖导入</a-button>
|
||||
</a-upload>
|
||||
|
||||
<a-upload
|
||||
:before-upload="importFileSpecial"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
>
|
||||
<a-button>专项湖库导入</a-button>
|
||||
</a-upload>
|
||||
</a-space>
|
||||
</template>
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane tab="城市内湖" key="water">
|
||||
<water-bill ref="water"></water-bill>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane tab="专项湖库" key="special">
|
||||
<special-bill ref="special"></special-bill>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-card>
|
||||
</div>
|
||||
<div class="ele-body">
|
||||
<a-card style="width: 100%" :bordered="false">
|
||||
<template #title>
|
||||
<a-space>
|
||||
<a-upload
|
||||
:before-upload="importFileInnerCity"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
ref="otherInnerLakeUpload"
|
||||
v-show="false"
|
||||
id="otherInnerLakeUpload"
|
||||
>
|
||||
<a-button>城市内湖导入</a-button>
|
||||
</a-upload>
|
||||
<a-upload
|
||||
:before-upload="importFileWuxiang"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
ref="wuxaingInnerLakeUpload"
|
||||
v-show="false"
|
||||
id="wuxaingInnerLakeUpload"
|
||||
>
|
||||
<a-button>五象湖导入</a-button>
|
||||
</a-upload>
|
||||
<a-dropdown>
|
||||
<template #overlay>
|
||||
<a-menu @click="handleMenuClick">
|
||||
<a-menu-item key="wuxaingInnerLakeUpload">
|
||||
五象湖
|
||||
</a-menu-item>
|
||||
<a-menu-item key="otherInnerLakeUpload">
|
||||
其他内湖
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>
|
||||
城市内湖导入
|
||||
<DownOutlined/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<a-upload
|
||||
:before-upload="importFileSpecial"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
>
|
||||
<a-button>专项湖库导入</a-button>
|
||||
</a-upload>
|
||||
</a-space>
|
||||
</template>
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane tab="城市内湖" key="water">
|
||||
<water-bill ref="water"></water-bill>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane tab="专项湖库" key="special">
|
||||
<special-bill ref="special"></special-bill>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -49,274 +70,277 @@ import {saveLakeBill} from "@/api/ecology/lake";
|
||||
import {saveLakeBill as saveSpecialLake} from "@/api/ecology/special-lake";
|
||||
|
||||
export default {
|
||||
name: "LakeCollectIndex",
|
||||
components: {
|
||||
WaterBill,
|
||||
SpecialBill
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeKey: "water",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
/* 导入本地excel文件 */
|
||||
importFileInnerCity(file) {
|
||||
const hide = this.$message.loading("导入中..", 0);
|
||||
|
||||
let reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
let data = new Uint8Array(e.target.result);
|
||||
let workbook = XLSX.read(data, {
|
||||
type: "array",
|
||||
});
|
||||
//0.昼间数据 1.夜间数据 2.其他信息
|
||||
let sheetNames = workbook.SheetNames;
|
||||
// 解析成二维数组
|
||||
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
|
||||
header: 1,
|
||||
});
|
||||
|
||||
const reportDate = aoa[2][0].replace(/[^\d]+/g, "-");
|
||||
|
||||
const lakeList = aoa.filter(
|
||||
(item) => {
|
||||
return item.length >= 24 && item[0] && !item[0].includes("点位名称");
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// 解析成对象数组
|
||||
const billName = file.name;
|
||||
const billData = utils.toInnerCityLakeObjData(lakeList,reportDate);
|
||||
if (!billData || billData.length == 0) {
|
||||
hide()
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "找不到数据",
|
||||
});
|
||||
return;
|
||||
}
|
||||
const tasks = [];
|
||||
if (billData.length > 0) {
|
||||
tasks.push(
|
||||
saveLakeBill({
|
||||
reportTime: new Date(reportDate).getTime(),
|
||||
billName: billName,
|
||||
regionLevel: "市级",
|
||||
lakeLibraryInnerCityList: billData,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// 上传到服务器
|
||||
|
||||
Promise.all(tasks)
|
||||
.then((res) => {
|
||||
if (res[0].data.code == 0) {
|
||||
Modal.success({
|
||||
title: "导入成功",
|
||||
content: `成功导入${billData.length}条数据`,
|
||||
});
|
||||
this.$refs.water && this.$refs.water.reload();
|
||||
} else {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
} catch (error) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: error.message,
|
||||
});
|
||||
}
|
||||
// console.log(billData);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
|
||||
return false;
|
||||
name: "LakeCollectIndex",
|
||||
components: {
|
||||
WaterBill,
|
||||
SpecialBill
|
||||
},
|
||||
importFileWuxiang(file) {
|
||||
const hide = this.$message.loading("导入中..", 0);
|
||||
|
||||
let reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
let data = new Uint8Array(e.target.result);
|
||||
let workbook = XLSX.read(data, {
|
||||
type: "array",
|
||||
});
|
||||
let sheetNames = workbook.SheetNames;
|
||||
// 解析成二维数组
|
||||
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
|
||||
header: 1,
|
||||
});
|
||||
const lakeList = aoa.filter(
|
||||
(item) => {
|
||||
return item.length >= 24 && item[0] && !item[0].includes("点位名称");
|
||||
}
|
||||
);
|
||||
// 解析成对象数组
|
||||
const billName = file.name;
|
||||
const billData = utils.toWuxiangLakeObjData(lakeList);
|
||||
if (!billData || billData.length == 0) {
|
||||
hide()
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "找不到数据",
|
||||
});
|
||||
return;
|
||||
}
|
||||
const tasks = [];
|
||||
if (billData.length > 0) {
|
||||
tasks.push(
|
||||
saveLakeBill({
|
||||
billName: billName,
|
||||
lakeLibraryInnerCityList: billData,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// 上传到服务器
|
||||
|
||||
Promise.all(tasks)
|
||||
.then((res) => {
|
||||
if (res[0].data.code == 0) {
|
||||
Modal.success({
|
||||
title: "导入成功",
|
||||
content: `成功导入${billData.length}条数据`,
|
||||
});
|
||||
this.$refs.water && this.$refs.water.reload();
|
||||
} else {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
} catch (error) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: error.message,
|
||||
});
|
||||
}
|
||||
// console.log(billData);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
|
||||
return false;
|
||||
data() {
|
||||
return {
|
||||
activeKey: "water",
|
||||
};
|
||||
},
|
||||
importFileSpecial(file) {
|
||||
const hide = this.$message.loading("导入中..", 0);
|
||||
methods: {
|
||||
handleMenuClick(e) {
|
||||
document.getElementById(e.key).click()
|
||||
},
|
||||
/* 导入本地excel文件 */
|
||||
importFileInnerCity(file) {
|
||||
const hide = this.$message.loading("导入中..", 0);
|
||||
|
||||
let reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
let data = new Uint8Array(e.target.result);
|
||||
let workbook = XLSX.read(data, {
|
||||
type: "array",
|
||||
});
|
||||
let sheetNames = workbook.SheetNames;
|
||||
// 解析成二维数组
|
||||
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
|
||||
header: 1,
|
||||
});
|
||||
const lakeList = aoa.filter(
|
||||
(item) => {
|
||||
return item.length >= 24 && item[1] && !item[1].includes("测站名称");
|
||||
}
|
||||
);
|
||||
// 解析成对象数组
|
||||
const billName = file.name;
|
||||
const billData = utils.toSpecialLakeData(lakeList);
|
||||
if (!billData || billData.length == 0) {
|
||||
hide()
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "找不到数据",
|
||||
});
|
||||
return;
|
||||
}
|
||||
const tasks = [];
|
||||
if (billData.length > 0) {
|
||||
tasks.push(
|
||||
saveSpecialLake({
|
||||
billName: billName,
|
||||
lakeLibrarySpecialList: billData,
|
||||
})
|
||||
);
|
||||
}
|
||||
let reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
let data = new Uint8Array(e.target.result);
|
||||
let workbook = XLSX.read(data, {
|
||||
type: "array",
|
||||
});
|
||||
//0.昼间数据 1.夜间数据 2.其他信息
|
||||
let sheetNames = workbook.SheetNames;
|
||||
// 解析成二维数组
|
||||
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
|
||||
header: 1,
|
||||
});
|
||||
|
||||
const reportDate = aoa[2][0].replace(/[^\d]+/g, "-");
|
||||
|
||||
const lakeList = aoa.filter(
|
||||
(item) => {
|
||||
return item.length >= 24 && item[0] && !item[0].includes("点位名称");
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// 上传到服务器
|
||||
// 解析成对象数组
|
||||
const billName = file.name;
|
||||
const billData = utils.toInnerCityLakeObjData(lakeList, reportDate);
|
||||
if (!billData || billData.length == 0) {
|
||||
hide()
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "找不到数据",
|
||||
});
|
||||
return;
|
||||
}
|
||||
const tasks = [];
|
||||
if (billData.length > 0) {
|
||||
tasks.push(
|
||||
saveLakeBill({
|
||||
reportTime: new Date(reportDate).getTime(),
|
||||
billName: billName,
|
||||
regionLevel: "市级",
|
||||
lakeLibraryInnerCityList: billData,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
Promise.all(tasks)
|
||||
.then((res) => {
|
||||
if (res[0].data.code == 0) {
|
||||
Modal.success({
|
||||
title: "导入成功",
|
||||
content: `成功导入${billData.length}条数据`,
|
||||
});
|
||||
this.$refs.special && this.$refs.special.reload();
|
||||
} else {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
} catch (error) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: error.message,
|
||||
});
|
||||
}
|
||||
// console.log(billData);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
// 上传到服务器
|
||||
|
||||
Promise.all(tasks)
|
||||
.then((res) => {
|
||||
if (res[0].data.code == 0) {
|
||||
Modal.success({
|
||||
title: "导入成功",
|
||||
content: `成功导入${billData.length}条数据`,
|
||||
});
|
||||
this.$refs.water && this.$refs.water.reload();
|
||||
} else {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
} catch (error) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: error.message,
|
||||
});
|
||||
}
|
||||
// console.log(billData);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
|
||||
return false;
|
||||
},
|
||||
importFileWuxiang(file) {
|
||||
const hide = this.$message.loading("导入中..", 0);
|
||||
|
||||
let reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
let data = new Uint8Array(e.target.result);
|
||||
let workbook = XLSX.read(data, {
|
||||
type: "array",
|
||||
});
|
||||
let sheetNames = workbook.SheetNames;
|
||||
// 解析成二维数组
|
||||
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
|
||||
header: 1,
|
||||
});
|
||||
const lakeList = aoa.filter(
|
||||
(item) => {
|
||||
return item.length >= 24 && item[0] && !item[0].includes("点位名称");
|
||||
}
|
||||
);
|
||||
// 解析成对象数组
|
||||
const billName = file.name;
|
||||
const billData = utils.toWuxiangLakeObjData(lakeList);
|
||||
if (!billData || billData.length == 0) {
|
||||
hide()
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "找不到数据",
|
||||
});
|
||||
return;
|
||||
}
|
||||
const tasks = [];
|
||||
if (billData.length > 0) {
|
||||
tasks.push(
|
||||
saveLakeBill({
|
||||
billName: billName,
|
||||
lakeLibraryInnerCityList: billData,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// 上传到服务器
|
||||
|
||||
Promise.all(tasks)
|
||||
.then((res) => {
|
||||
if (res[0].data.code == 0) {
|
||||
Modal.success({
|
||||
title: "导入成功",
|
||||
content: `成功导入${billData.length}条数据`,
|
||||
});
|
||||
this.$refs.water && this.$refs.water.reload();
|
||||
} else {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
} catch (error) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: error.message,
|
||||
});
|
||||
}
|
||||
// console.log(billData);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
|
||||
return false;
|
||||
},
|
||||
importFileSpecial(file) {
|
||||
const hide = this.$message.loading("导入中..", 0);
|
||||
|
||||
let reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
let data = new Uint8Array(e.target.result);
|
||||
let workbook = XLSX.read(data, {
|
||||
type: "array",
|
||||
});
|
||||
let sheetNames = workbook.SheetNames;
|
||||
// 解析成二维数组
|
||||
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
|
||||
header: 1,
|
||||
});
|
||||
const lakeList = aoa.filter(
|
||||
(item) => {
|
||||
return item.length >= 24 && item[1] && !item[1].includes("测站名称");
|
||||
}
|
||||
);
|
||||
// 解析成对象数组
|
||||
const billName = file.name;
|
||||
const billData = utils.toSpecialLakeData(lakeList);
|
||||
if (!billData || billData.length == 0) {
|
||||
hide()
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "找不到数据",
|
||||
});
|
||||
return;
|
||||
}
|
||||
const tasks = [];
|
||||
if (billData.length > 0) {
|
||||
tasks.push(
|
||||
saveSpecialLake({
|
||||
billName: billName,
|
||||
lakeLibrarySpecialList: billData,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// 上传到服务器
|
||||
|
||||
Promise.all(tasks)
|
||||
.then((res) => {
|
||||
if (res[0].data.code == 0) {
|
||||
Modal.success({
|
||||
title: "导入成功",
|
||||
content: `成功导入${billData.length}条数据`,
|
||||
});
|
||||
this.$refs.special && this.$refs.special.reload();
|
||||
} else {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
} catch (error) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: error.message,
|
||||
});
|
||||
}
|
||||
// console.log(billData);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -7,12 +7,6 @@
|
||||
|
||||
<!-- 搜索表单 -->
|
||||
<a-form layout="inline" :model="where" :labelCol="{ offset: 1}">
|
||||
<a-form-item label="区域等级:">
|
||||
<a-select v-model:value="where.regionLevel" allowClear placeholder="未选择">
|
||||
<a-select-option :value="'市级'">市级</a-select-option>
|
||||
<a-select-option :value="'县级'">县级</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="审核状态:">
|
||||
<a-select v-model:value="where.checked" allowClear placeholder="未选择">
|
||||
<a-select-option :value="1">已审核</a-select-option>
|
||||
|
||||
@@ -143,7 +143,7 @@ import {
|
||||
} from "@/api/ecology/special-lake";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
import moment from "moment";
|
||||
import { tableColumns } from "./colums";
|
||||
import { specialTableColumns } from "./colums";
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "LakeCollectWater",
|
||||
@@ -156,10 +156,10 @@ export default {
|
||||
// 表格数据接口
|
||||
url: pageLakeUrl,
|
||||
selection: [],
|
||||
tableColumns,
|
||||
tableColumns: specialTableColumns,
|
||||
// 表格列配置
|
||||
columns: [
|
||||
...tableColumns,
|
||||
...specialTableColumns,
|
||||
{
|
||||
title: "创建人",
|
||||
dataIndex: "userName",
|
||||
|
||||
@@ -1,39 +1,40 @@
|
||||
import moment from "moment";
|
||||
|
||||
export default {
|
||||
// 城市内湖导入
|
||||
toInnerCityLakeObjData(excelData,reportDate) {
|
||||
toInnerCityLakeObjData(excelData, reportDate) {
|
||||
|
||||
return excelData.map(item => {
|
||||
const monitorTime = new Date(reportDate);
|
||||
const monitorTime = new Date(reportDate);
|
||||
const row = {
|
||||
monitorTime: monitorTime.getTime(),
|
||||
province: "广西壮族自治区",
|
||||
city: "南宁",
|
||||
pointName: item[0],
|
||||
waterTemperature: item[1],
|
||||
ph: item[2],
|
||||
transparency:item [3],
|
||||
dissolvedOxygenSaturation:item [4],
|
||||
dissolvedOxygen:item [5],
|
||||
permanganateIndex:item [6],
|
||||
fiveDayBod:item [7],
|
||||
totalNitrogen:item [8],
|
||||
ammonia:item [9],
|
||||
volatilePhenol:item [10],
|
||||
as:item [11],
|
||||
hg:item [12],
|
||||
cr6:item [13],
|
||||
pb:item [14],
|
||||
cd:item [15],
|
||||
totalPhosphorus:item [16],
|
||||
petro:item [17],
|
||||
fecalColiforms:item [18],
|
||||
cod:item [19],
|
||||
chlA:item [20],
|
||||
anSaa:item [21],
|
||||
s:item [22],
|
||||
oxidationReductionPotential:item [23],
|
||||
remark:item [23],
|
||||
monitorTime: monitorTime.getTime(),
|
||||
province: "广西壮族自治区",
|
||||
city: "南宁",
|
||||
pointName: item[0],
|
||||
waterTemperature: item[1],
|
||||
ph: item[2],
|
||||
transparency: item [3],
|
||||
dissolvedOxygenSaturation: item [4],
|
||||
dissolvedOxygen: item [5],
|
||||
permanganateIndex: item [6],
|
||||
fiveDayBod: item [7],
|
||||
totalNitrogen: item [8],
|
||||
ammonia: item [9],
|
||||
volatilePhenol: item [10],
|
||||
as: item [11],
|
||||
hg: item [12],
|
||||
cr6: item [13],
|
||||
pb: item [14],
|
||||
cd: item [15],
|
||||
totalPhosphorus: item [16],
|
||||
petro: item [17],
|
||||
fecalColiforms: item [18],
|
||||
cod: item [19],
|
||||
chlA: item [20],
|
||||
anSaa: item [21],
|
||||
s: item [22],
|
||||
oxidationReductionPotential: item [23],
|
||||
remark: item [24],
|
||||
|
||||
}
|
||||
return row;
|
||||
@@ -41,100 +42,101 @@ export default {
|
||||
|
||||
},
|
||||
// 五象湖
|
||||
toWuxiangLakeObjData(excelData) {
|
||||
return excelData.map(item => {
|
||||
const row = {
|
||||
province: "广西壮族自治区",
|
||||
city: "南宁",
|
||||
pointName: item[0],
|
||||
monitorTime: moment(item[1],"YYYY年M月D日").valueOf(),
|
||||
waterTemperature: item[2],
|
||||
dissolvedOxygen:item [3],
|
||||
dissolvedOxygenSaturation:item [4],
|
||||
transparency:item [5],
|
||||
ph:item [6],
|
||||
fiveDayBod:item [7],
|
||||
permanganateIndex:item [8],
|
||||
cod:item [9],
|
||||
ammonia:item [10],
|
||||
chlA:item [11],
|
||||
oxidationReductionPotential:item [12],
|
||||
cr6:item [13],
|
||||
hg:item [14],
|
||||
pb:item [15],
|
||||
as:item [16],
|
||||
cd:item [17],
|
||||
totalPhosphorus:item [18],
|
||||
s:item [19],
|
||||
petro:item [20],
|
||||
totalNitrogen:item [21],
|
||||
fecalColiforms:item [22],
|
||||
anSaa:item [23],
|
||||
remark:item [24],
|
||||
toWuxiangLakeObjData(excelData) {
|
||||
return excelData.map(item => {
|
||||
const row = {
|
||||
province: "广西壮族自治区",
|
||||
city: "南宁",
|
||||
pointName: item[0],
|
||||
monitorTime: moment(item[1], "YYYY年M月D日").valueOf(),
|
||||
waterTemperature: item[2],
|
||||
dissolvedOxygen: item [3],
|
||||
dissolvedOxygenSaturation: item [4],
|
||||
transparency: item [5],
|
||||
ph: item [6],
|
||||
fiveDayBod: item [7],
|
||||
permanganateIndex: item [8],
|
||||
cod: item [9],
|
||||
ammonia: item [10],
|
||||
chlA: item [11],
|
||||
oxidationReductionPotential: item [12],
|
||||
cr6: item [13],
|
||||
hg: item [14],
|
||||
pb: item [15],
|
||||
as: item [16],
|
||||
cd: item [17],
|
||||
totalPhosphorus: item [18],
|
||||
s: item [19],
|
||||
petro: item [20],
|
||||
totalNitrogen: item [21],
|
||||
fecalColiforms: item [22],
|
||||
anSaa: item [23],
|
||||
remark: item [24],
|
||||
|
||||
}
|
||||
return row;
|
||||
})
|
||||
}
|
||||
return row;
|
||||
})
|
||||
|
||||
},
|
||||
// 专项湖库
|
||||
toSpecialLakeData(excelData) {
|
||||
return excelData.map(item => {
|
||||
const row = {
|
||||
province: "广西壮族自治区",
|
||||
city: "南宁",
|
||||
// nothing: item[0],
|
||||
stationName: item[1],
|
||||
stationCode: item[2],
|
||||
lakeLibraryName:item [3],
|
||||
lakeLibraryCode:item [4],
|
||||
sectionName:item [5],
|
||||
sectionCode:item [6],
|
||||
controlAttributes:item [7],
|
||||
watershed:item [8],
|
||||
monitorTime:item [9],
|
||||
waterPeriodCode:item [10],
|
||||
turbidity:item [11],
|
||||
wTemp:item [12],
|
||||
wd:item [13],
|
||||
ph:item [14],
|
||||
wCond:item [15],
|
||||
transp:item [16],
|
||||
dissolvedOxygen:item [17],
|
||||
codmn:item [18],
|
||||
bod5:item [19],
|
||||
nh4N:item [20],
|
||||
oils:item [21],
|
||||
nTotal:item [22],
|
||||
pTotal:item [23],
|
||||
chlA:item [24],
|
||||
vPhen:item [25],
|
||||
wHg:item [26],
|
||||
wPb:item [27],
|
||||
codcr:item [28],
|
||||
wCu:item [29],
|
||||
wZn:item [30],
|
||||
f:item [31],
|
||||
se:item [32],
|
||||
as:item [33],
|
||||
cd:item [34],
|
||||
cr6:item [35],
|
||||
cnTotal:item [36],
|
||||
anSaa:item [37],
|
||||
s:item [38],
|
||||
coloOrg:item [39],
|
||||
so4:item [40],
|
||||
cl:item [41],
|
||||
no3N:item [42],
|
||||
wFe:item [43],
|
||||
wMn:item [44],
|
||||
waterQualityCategory:item [45],
|
||||
remark:item [49],
|
||||
systemCode:item[47],
|
||||
}
|
||||
return row;
|
||||
})
|
||||
},
|
||||
// 专项湖库
|
||||
toSpecialLakeData(excelData) {
|
||||
return excelData.map(item => {
|
||||
const row = {
|
||||
province: "广西壮族自治区",
|
||||
city: "南宁",
|
||||
// nothing: item[0],
|
||||
stationName: item[1],
|
||||
stationCode: item[2],
|
||||
lakeLibraryName: item [3],
|
||||
lakeLibraryCode: item [4],
|
||||
sectionName: item [5],
|
||||
sectionCode: item [6],
|
||||
controlAttributes: item [7],
|
||||
watershed: item [8],
|
||||
monitorTime: new Date(item[9]).getTime(),
|
||||
waterPeriodCode: item [10],
|
||||
turbidity: item [11],
|
||||
wTemp: item [12],
|
||||
wd: item [13],
|
||||
ph: item [14],
|
||||
wCond: item [15],
|
||||
transp: item [16],
|
||||
dissolvedOxygen: item [17],
|
||||
codmn: item [18],
|
||||
bod5: item [19],
|
||||
nh4N: item [20],
|
||||
oils: item [21],
|
||||
nTotal: item [22],
|
||||
pTotal: item [23],
|
||||
chlA: item [24],
|
||||
vPhen: item [25],
|
||||
wHg: item [26],
|
||||
wPb: item [27],
|
||||
codcr: item [28],
|
||||
wCu: item [29],
|
||||
wZn: item [30],
|
||||
f: item [31],
|
||||
se: item [32],
|
||||
as: item [33],
|
||||
cd: item [34],
|
||||
cr6: item [35],
|
||||
cnTotal: item [36],
|
||||
anSaa: item [37],
|
||||
s: item [38],
|
||||
coloOrg: item [39],
|
||||
so4: item [40],
|
||||
cl: item [41],
|
||||
no3N: item [42],
|
||||
wFe: item [43],
|
||||
wMn: item [44],
|
||||
waterQualityCategory: item [45],
|
||||
remark: item [46],
|
||||
systemCode: item[47],
|
||||
|
||||
},
|
||||
}
|
||||
return row;
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@@ -7,12 +7,6 @@
|
||||
|
||||
<!-- 搜索表单 -->
|
||||
<a-form layout="inline" :model="where" :labelCol="{ offset: 1}">
|
||||
<a-form-item label="区域等级:">
|
||||
<a-select v-model:value="where.regionLevel" allowClear placeholder="未选择">
|
||||
<a-select-option :value="'市级'">市级</a-select-option>
|
||||
<a-select-option :value="'县级'">县级</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="审核状态:">
|
||||
<a-select v-model:value="where.checked" allowClear placeholder="未选择">
|
||||
<a-select-option :value="1">已审核</a-select-option>
|
||||
|
||||
@@ -143,7 +143,7 @@ import {
|
||||
} from "@/api/ecology/lake";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
import moment from "moment";
|
||||
import { tableColumns } from "./colums";
|
||||
import { innerTableColumns } from "./colums";
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "SpecialLakeCollectWater",
|
||||
@@ -156,10 +156,10 @@ export default {
|
||||
// 表格数据接口
|
||||
url: pageLakeUrl,
|
||||
selection: [],
|
||||
tableColumns,
|
||||
tableColumns: innerTableColumns,
|
||||
// 表格列配置
|
||||
columns: [
|
||||
...tableColumns,
|
||||
...innerTableColumns,
|
||||
{
|
||||
title: "创建人",
|
||||
dataIndex: "userName",
|
||||
|
||||
@@ -1,213 +0,0 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 搜索表单 -->
|
||||
<a-form
|
||||
:model="where"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-row>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="年份">
|
||||
<a-select v-model:value="where.year" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="item in yearOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<!-- <a-button @click="reset">重置</a-button> -->
|
||||
<a-button @click="exportFile">导出Excel</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
row-key="area"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:needPage="false"
|
||||
:initLoad="false"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import _ from "lodash";
|
||||
import XLSX from "xlsx";
|
||||
import { pageZoneNoiseStatisticUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "StatisticSoundZoneAverage",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: pageZoneNoiseStatisticUrl,
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "噪声源分类",
|
||||
dataIndex: "source",
|
||||
},
|
||||
{
|
||||
title: "测点数(个)",
|
||||
dataIndex: "count",
|
||||
},
|
||||
{
|
||||
title: "声源占比(%)",
|
||||
dataIndex: "rate",
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
},
|
||||
{
|
||||
title: "监测结果",
|
||||
children: [
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "leq",
|
||||
},
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "l10",
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "l50",
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "l90",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
// 表格搜索条件
|
||||
where: {},
|
||||
yearOptions: [],
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadOptionData();
|
||||
},
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("monitor_year").then((res) => {
|
||||
this.yearOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
const columns = [
|
||||
{
|
||||
title: "城区",
|
||||
dataIndex: "area"
|
||||
}
|
||||
]
|
||||
this.yearOptions.forEach(item=>{
|
||||
const {startYear,endYear} = this.where;
|
||||
if((startYear&& Number(startYear)>Number(item.value))|| (endYear&&Number(endYear)<Number(item.value))){
|
||||
console.log("");
|
||||
}else{
|
||||
columns.push({
|
||||
title: item.value + "年噪声值",
|
||||
dataIndex: item.value + "Leq"
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
this.columns = columns;
|
||||
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const columns = [
|
||||
{
|
||||
title: "噪声源分类",
|
||||
dataIndex: "source",
|
||||
},
|
||||
{
|
||||
title: "测点数(个)",
|
||||
dataIndex: "count",
|
||||
},
|
||||
{
|
||||
title: "声源占比(%)",
|
||||
dataIndex: "rate",
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
},
|
||||
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "leq",
|
||||
},
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "l10",
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "l50",
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "l90",
|
||||
},
|
||||
];
|
||||
const arr = [];
|
||||
const th = columns.map((item) => item.title);
|
||||
arr.push(th);
|
||||
this.data.forEach((d) => {
|
||||
const td = columns.map((item) => d[item.dataIndex]);
|
||||
arr.push(td);
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
</style>
|
||||
@@ -1,476 +0,0 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 搜索表单 -->
|
||||
<a-form
|
||||
:model="where"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-row>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="区域等级:">
|
||||
<a-select v-model:value="where.regionLevel" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in regionLevelOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="测点名称:">
|
||||
<a-select v-model:value="where.place" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in palceOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="城区">
|
||||
<a-select v-model:value="where.area" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in areaOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
<a-button @click="exportFile">导出Excel</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
row-key="zoneNoiseId"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
<template #Leq="{ text,record }">
|
||||
<a-tag v-if="(record.timeSlot == '昼' && text <= 68) || (record.timeSlot == '夜' && text <= 58)" color="green">{{text}}</a-tag>
|
||||
<a-tag v-else-if="(record.timeSlot == '昼' && text > 68 && text <=70) || (record.timeSlot == '夜' && text > 58 && text <=60)" color="blue">{{text}}</a-tag>
|
||||
<a-tag v-else-if="(record.timeSlot == '昼' && text > 70 && text <=72) || (record.timeSlot == '夜' && text > 60 && text <=62)" color="red">{{text}}</a-tag>
|
||||
<a-tag v-else-if="(record.timeSlot == '昼' && text > 62 && text <=74) || (record.timeSlot == '夜' && text > 62 && text <=64)" color="red">{{text}}</a-tag>
|
||||
<a-tag v-else-if="(record.timeSlot == '昼' && text > 74 ) || (record.timeSlot == '夜' && text > 64)" color="red">{{text}}</a-tag>
|
||||
<template v-else color="#FFF">{{text}}</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import _ from "lodash";
|
||||
import XLSX from "xlsx";
|
||||
import { pageZoneNoiseUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
import moment from "moment";
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "StatisticSoundZoneBase",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: pageZoneNoiseUrl,
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "监测日期",
|
||||
dataIndex: "monitorTime",
|
||||
sorter: true,
|
||||
customRender: ({text})=> moment(text,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD HH:mm")
|
||||
},
|
||||
{
|
||||
title: "测点名称",
|
||||
dataIndex: "place",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "所属城区",
|
||||
dataIndex: "area",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "网格长(米)",
|
||||
dataIndex: "gridLength",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "网格宽(米)",
|
||||
dataIndex: "gridWidth",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "网格点号",
|
||||
dataIndex: "gridNo",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "主要声源",
|
||||
dataIndex: "source",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
sorter: true,
|
||||
},
|
||||
// {
|
||||
// title: '月',
|
||||
// dataIndex: 'monitorMonth',
|
||||
// sorter: true
|
||||
// },
|
||||
// {
|
||||
// title: '日',
|
||||
// dataIndex: 'monitorDay',
|
||||
// sorter: true
|
||||
// },
|
||||
// {
|
||||
// title: '时',
|
||||
// dataIndex: 'monitorHour',
|
||||
// sorter: true
|
||||
// },
|
||||
// {
|
||||
// title: '分',
|
||||
// dataIndex: 'monitorMinute',
|
||||
// sorter: true
|
||||
// },
|
||||
{
|
||||
title: "LeqdB(A)",
|
||||
dataIndex: "indexLeq",
|
||||
slots: {customRender: "Leq"},
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "SDdB(A)",
|
||||
dataIndex: "indexSd",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "L10dB(A)",
|
||||
dataIndex: "indexL10",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "L50dB(A)",
|
||||
dataIndex: "indexL50",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "L90dB(A)",
|
||||
dataIndex: "indexL90",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "LmindB(A)",
|
||||
dataIndex: "indexLmin",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "LmaxdB(A)",
|
||||
dataIndex: "indexLmax",
|
||||
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,
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
dataIndex: "remark",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "创建人",
|
||||
dataIndex: "username",
|
||||
sorter: true,
|
||||
},
|
||||
],
|
||||
palceOptions: [],
|
||||
areaOptions: [],
|
||||
regionLevelOptions: [],
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
checked: 1,
|
||||
},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadOptionData();
|
||||
},
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("place").then((res) => {
|
||||
this.palceOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
getColumnOptions("area").then((res) => {
|
||||
this.areaOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
getColumnOptions("region_level").then((res) => {
|
||||
this.regionLevelOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.where = {
|
||||
checked: 1,
|
||||
};
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const columns = [
|
||||
{
|
||||
title: "行政区划代码",
|
||||
dataIndex: "regionCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测年度",
|
||||
dataIndex: "monitorYear",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "点位编码",
|
||||
dataIndex: "placeCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点名称",
|
||||
dataIndex: "place",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点经度",
|
||||
dataIndex: "placeLng",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点纬度",
|
||||
dataIndex: "placeLat",
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "测点参照物",
|
||||
dataIndex: "refObj",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "网格边长",
|
||||
dataIndex: "gridLength",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "网格覆盖人口(万)",
|
||||
dataIndex: "people",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "功能区代码",
|
||||
dataIndex: "functionCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "月",
|
||||
dataIndex: "monitorMonth",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "日",
|
||||
dataIndex: "monitorDay",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "时",
|
||||
dataIndex: "monitorHour",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "分",
|
||||
dataIndex: "monitorMinute",
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "indexLeq",
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "indexL10",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "indexL50",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "indexL90",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "最大值",
|
||||
dataIndex: "indexLmax",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "最小值",
|
||||
dataIndex: "indexLmin",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "标准差(SD)",
|
||||
dataIndex: "indexSd",
|
||||
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,
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
dataIndex: "remark",
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
const arr = [];
|
||||
const th = columns.map((item) => item.title);
|
||||
arr.push(th);
|
||||
this.data.forEach((d) => {
|
||||
const td = columns.map((item) => d[item.dataIndex]);
|
||||
arr.push(td);
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
</style>
|
||||
@@ -2,51 +2,34 @@
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane key="base" tab="数据总览">
|
||||
<base-statistic></base-statistic>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="source-statistic" tab="声源">
|
||||
<source-statistic></source-statistic>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="average" tab="城区">
|
||||
<average-statistic></average-statistic>
|
||||
</a-tab-pane>
|
||||
<!-- <a-tab-pane key="quarter" tab="季度报告">
|
||||
<quarter-statistic></quarter-statistic>
|
||||
</a-tab-pane> -->
|
||||
<a-tab-pane key="year-compare" tab="市">
|
||||
<year-statistic></year-statistic>
|
||||
<a-tab-pane key="inner" tab="城市内湖">
|
||||
<inner-lake></inner-lake>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="special" tab="专项湖库">
|
||||
<special-lake></special-lake>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="special-avg" tab="专项湖库均值">
|
||||
<special-avg></special-avg>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
import BaseStatistic from "./base.vue";
|
||||
// import QuarterStatistic from "./quarter.vue";
|
||||
// import Compare from "./compare.vue";
|
||||
import AverageStatistic from "./average.vue";
|
||||
import SourceStatistic from "./source.vue";
|
||||
import YearStatistic from "./year.vue";
|
||||
|
||||
import SpecialLake from "./special-lake.vue";
|
||||
import InnerLake from "./inner-lake.vue";
|
||||
import SpecialAvg from "./special-avg"
|
||||
export default {
|
||||
name: 'StatisticSoundZone',
|
||||
name: 'StatisticLake',
|
||||
components: {
|
||||
BaseStatistic,
|
||||
SourceStatistic,
|
||||
// Compare,
|
||||
AverageStatistic,
|
||||
YearStatistic
|
||||
SpecialLake,
|
||||
InnerLake,
|
||||
SpecialAvg
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeKey: 'base'
|
||||
activeKey: 'inner'
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
158
src/views/water/lake/statistic/inner-lake.vue
Normal file
158
src/views/water/lake/statistic/inner-lake.vue
Normal file
@@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 搜索表单 -->
|
||||
<a-form
|
||||
:model="where"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-row>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="测点名称:">
|
||||
<a-select v-model:value="where.place" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in palceOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}
|
||||
</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="城区">
|
||||
<a-select v-model:value="where.area" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in areaOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}
|
||||
</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
<a-button @click="exportFile">导出Excel</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
row-key="lakeLibrarySpecialId"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import _ from "lodash";
|
||||
import XLSX from "xlsx";
|
||||
import {pageLakeUrl, getColumnOptions} from "@/api/ecology/lake";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
// import moment from "moment";
|
||||
import {innerTableColumns} from "../collect/colums"
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "StatisticInnerLakeBase",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: pageLakeUrl,
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: innerTableColumns,
|
||||
palceOptions: [],
|
||||
areaOptions: [],
|
||||
regionLevelOptions: [],
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
checked: 1,
|
||||
},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadOptionData();
|
||||
},
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("place").then((res) => {
|
||||
this.palceOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
getColumnOptions("area").then((res) => {
|
||||
this.areaOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
getColumnOptions("region_level").then((res) => {
|
||||
this.regionLevelOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.where = {
|
||||
checked: 1,
|
||||
};
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const columns = this.columns;
|
||||
const arr = [];
|
||||
const th = columns.map((item) => item.title);
|
||||
arr.push(th);
|
||||
this.data.forEach((d) => {
|
||||
const td = columns.map((item) => d[item.dataIndex]);
|
||||
arr.push(td);
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
</style>
|
||||
@@ -1,195 +0,0 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 搜索表单 -->
|
||||
<a-form
|
||||
:model="where"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-row>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="年份">
|
||||
<a-select v-model:value="where.year" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="item in yearOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<!-- <a-button @click="reset">重置</a-button> -->
|
||||
<a-button @click="exportFile">导出Excel</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
:row-key="(record) => record.source + record.timeSlot"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:needPage="false"
|
||||
:initLoad="false"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import _ from "lodash";
|
||||
import XLSX from "xlsx";
|
||||
import { statisticSourceUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "StatisticSoundZoneSource",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: statisticSourceUrl,
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "噪声源分类",
|
||||
dataIndex: "source",
|
||||
},
|
||||
{
|
||||
title: "测点数(个)",
|
||||
dataIndex: "count",
|
||||
},
|
||||
{
|
||||
title: "声源占比(%)",
|
||||
dataIndex: "rate",
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
},
|
||||
{
|
||||
title: "监测结果",
|
||||
children: [
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "leq",
|
||||
},
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "l10",
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "l50",
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "l90",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
// 表格搜索条件
|
||||
where: {},
|
||||
yearOptions: [],
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadOptionData();
|
||||
},
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("monitor_year").then((res) => {
|
||||
this.yearOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
|
||||
this.where.year = this.yearOptions[0].value;
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const columns = [
|
||||
{
|
||||
title: "噪声源分类",
|
||||
dataIndex: "source",
|
||||
},
|
||||
{
|
||||
title: "测点数(个)",
|
||||
dataIndex: "count",
|
||||
},
|
||||
{
|
||||
title: "声源占比(%)",
|
||||
dataIndex: "rate",
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
},
|
||||
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "leq",
|
||||
},
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "l10",
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "l50",
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "l90",
|
||||
},
|
||||
];
|
||||
const arr = [];
|
||||
const th = columns.map((item) => item.title);
|
||||
arr.push(th);
|
||||
this.data.forEach((d) => {
|
||||
const td = columns.map((item) => d[item.dataIndex]);
|
||||
arr.push(td);
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
</style>
|
||||
201
src/views/water/lake/statistic/special-avg.vue
Normal file
201
src/views/water/lake/statistic/special-avg.vue
Normal file
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 搜索表单 -->
|
||||
<a-form :model="where" layout="inline">
|
||||
<a-form-item label="起始日期:">
|
||||
<a-date-picker valueFormat="YYYY-MM-DD 00:00:00" v-model:value="where.timeStart"></a-date-picker>
|
||||
</a-form-item>
|
||||
<a-form-item label="结束日期:">
|
||||
<a-date-picker valueFormat="YYYY-MM-DD 00:00:00" v-model:value="where.timeEnd"></a-date-picker>
|
||||
</a-form-item>
|
||||
|
||||
<a-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
<a-button @click="exportFile">导出Excel</a-button>
|
||||
</a-space>
|
||||
|
||||
</a-form>
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
ref="table"
|
||||
row-key="ambientAirId"
|
||||
:need-page="false"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
:init-load="false"
|
||||
@done="(d) => (data = d.data)"
|
||||
method="POST"
|
||||
>
|
||||
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import _ from "lodash";
|
||||
import XLSX from "xlsx";
|
||||
import {avgUrl, getColumnOptions} from "@/api/ecology/special-lake";
|
||||
// import { Modal } from "ant-design-vue";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
import moment from "moment";
|
||||
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "StatisticAirAreaBase",
|
||||
components: {},
|
||||
data() {
|
||||
const year = new Date().getFullYear();
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: avgUrl,
|
||||
selection: [],
|
||||
modelOptions: [
|
||||
{label: "市", value: "city"},
|
||||
{label: "县", value: "county"},
|
||||
{label: "站点", value: "place"},
|
||||
|
||||
],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{title: "测站名称", dataIndex: "stationName", sorter: true,},
|
||||
{title: "测站代码", dataIndex: "stationCode", sorter: true,},
|
||||
{title: "湖库名称", dataIndex: "lakeLibraryName", sorter: true,},
|
||||
{title: "湖库代码", dataIndex: "lakeLibraryCode", sorter: true,},
|
||||
{title: "断面名称", dataIndex: "sectionName", sorter: true,},
|
||||
{title: "断面代码", dataIndex: "sectionCode", sorter: true,},
|
||||
{title: "控制属性", dataIndex: "controlAttributes", sorter: true,},
|
||||
{title: "所属流域", dataIndex: "watershed", sorter: true,},
|
||||
{title: "水期代码", dataIndex: "waterPeriodCode", sorter: true,},
|
||||
|
||||
{title: "浊度(NTU)", dataIndex: "turbidity", sorter: true,},
|
||||
{title: "水温(℃)", dataIndex: "wTemp", sorter: true,},
|
||||
{title: "水位(m)", dataIndex: "wd", sorter: true,},
|
||||
{title: "pH值", dataIndex: "ph", sorter: true,},
|
||||
{title: "电导率(ms/m)", dataIndex: "wCond", sorter: true,},
|
||||
{title: "透明度(cm)", dataIndex: "transp", sorter: true,},
|
||||
{title: "溶解氧 (mg/L)", dataIndex: "dissolvedOxygen", sorter: true,},
|
||||
{title: "高锰酸盐指数 (mg/L)", dataIndex: "codmn", sorter: true,},
|
||||
{title: "氨氮 (mg/L)", dataIndex: "nh4N", sorter: true,},
|
||||
{title: "石油类 (mg/L)", dataIndex: "oils", sorter: true,},
|
||||
{title: "总氮 (mg/L)", dataIndex: "nTotal", sorter: true,},
|
||||
{title: "总磷 (mg/L)", dataIndex: "pTotal", sorter: true,},
|
||||
{title: "叶绿素 (mg/L)", dataIndex: "chlA", sorter: true,},
|
||||
{title: "挥发酚 (mg/L)", dataIndex: "vPhen", sorter: true,},
|
||||
{title: "汞 (mg/L)", dataIndex: "wHg", sorter: true,},
|
||||
{title: "铅 (mg/L)", dataIndex: "wPb", sorter: true,},
|
||||
{title: "化学需氧量 (mg/L)", dataIndex: "codcr", sorter: true,},
|
||||
{title: "铜 (mg/L)", dataIndex: "wCu", sorter: true,},
|
||||
{title: "锌 (mg/L)", dataIndex: "wZn", sorter: true,},
|
||||
{title: "氟化物 (mg/L)", dataIndex: "f", sorter: true,},
|
||||
{title: "硒 (mg/L)", dataIndex: "se", sorter: true,},
|
||||
{title: "砷 (mg/L)", dataIndex: "as", sorter: true,},
|
||||
{title: "镉 (mg/L)", dataIndex: "cd", sorter: true,},
|
||||
{title: "六价铬 (mg/L)", dataIndex: "cr6", sorter: true,},
|
||||
{title: "氰化物 (mg/L)", dataIndex: "cnTotal", sorter: true,},
|
||||
{title: "阴离子表面活性剂 (mg/L)", dataIndex: "anSaa", sorter: true,},
|
||||
{title: "硫化物 (mg/L)", dataIndex: "s", sorter: true,},
|
||||
{title: "粪大肠菌群 (mg/L)", dataIndex: "coloOrg", sorter: true,},
|
||||
{title: "硫酸盐 (mg/L)", dataIndex: "so4", sorter: true,},
|
||||
{title: "氯化物 (mg/L)", dataIndex: "cl", sorter: true,},
|
||||
{title: "硝酸盐 (mg/L)", dataIndex: "no3N", sorter: true,},
|
||||
{title: "铁 (mg/L)", dataIndex: "wFe", sorter: true,},
|
||||
{title: "锰 (mg/L)", dataIndex: "wMn", sorter: true,},
|
||||
{title: "水质类别", dataIndex: "waterQualityCategory", sorter: true,},
|
||||
],
|
||||
regionLevelOptions: [],
|
||||
time: [],
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
regionLevel: "place",
|
||||
timeStart: moment(`${year}-01-01 00:00:00`).format("YYYY-MM-DD 00:00:00"),
|
||||
timeEnd: moment().format("YYYY-MM-DD 00:00:00")
|
||||
},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.loadOptionData();
|
||||
this.reload();
|
||||
},
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("region_level").then((res) => {
|
||||
this.regionLevelOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
const where = _.cloneDeep(this.where);
|
||||
this.$refs.table.reload({
|
||||
where
|
||||
});
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.where = {
|
||||
regionLevel: "place",
|
||||
};
|
||||
this.time = undefined;
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const arr = [];
|
||||
const th1 = [];
|
||||
const th2 = [];
|
||||
const merges = []; // 合并
|
||||
const columnsTemp = []; // 树形结构整理成list
|
||||
this.columns.forEach((item, index) => {
|
||||
if (item.children) {
|
||||
item.children.forEach((citem) => {
|
||||
th1.push(item.title)
|
||||
th2.push(citem.title)
|
||||
columnsTemp.push(citem)
|
||||
})
|
||||
merges.push({s: {r: 0, c: th1.length - item.children.length}, e: {r: 0, c: th1.length - 1}})
|
||||
} else {
|
||||
th1.push(item.title)
|
||||
th2.push("")
|
||||
columnsTemp.push(item)
|
||||
merges.push({s: {r: 0, c: index}, e: {r: 1, c: index}})
|
||||
}
|
||||
})
|
||||
arr.push(th1, th2);
|
||||
this.data.forEach((d) => {
|
||||
const td = columnsTemp.map((item) => {
|
||||
if(item.customRender){
|
||||
return item.customRender({text:d[item.dataIndex]});
|
||||
}
|
||||
return d[item.dataIndex];
|
||||
});
|
||||
arr.push(td);
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
sheet['!merges'] = merges;
|
||||
|
||||
this.$util.exportSheet(XLSX, sheet, moment(this.where.timeStart).format("YYYY年MM月DD日") + "至" + moment(this.where.timeEnd).format("YYYY年MM月DD日"));
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
</style>
|
||||
333
src/views/water/lake/statistic/special-lake.vue
Normal file
333
src/views/water/lake/statistic/special-lake.vue
Normal file
@@ -0,0 +1,333 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 搜索表单 -->
|
||||
<a-form
|
||||
:model="where"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-row>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="测点名称:">
|
||||
<a-select v-model:value="where.place" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in palceOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}
|
||||
</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="城区">
|
||||
<a-select v-model:value="where.area" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in areaOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}
|
||||
</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
<a-button @click="exportFile">导出Excel</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
row-key="zoneNoiseId"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
<template #Leq="{ text,record }">
|
||||
<a-tag v-if="(record.timeSlot == '昼' && text <= 68) || (record.timeSlot == '夜' && text <= 58)"
|
||||
color="green">{{ text }}
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-else-if="(record.timeSlot == '昼' && text > 68 && text <=70) || (record.timeSlot == '夜' && text > 58 && text <=60)"
|
||||
color="blue">{{ text }}
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-else-if="(record.timeSlot == '昼' && text > 70 && text <=72) || (record.timeSlot == '夜' && text > 60 && text <=62)"
|
||||
color="red">{{ text }}
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-else-if="(record.timeSlot == '昼' && text > 62 && text <=74) || (record.timeSlot == '夜' && text > 62 && text <=64)"
|
||||
color="red">{{ text }}
|
||||
</a-tag>
|
||||
<a-tag v-else-if="(record.timeSlot == '昼' && text > 74 ) || (record.timeSlot == '夜' && text > 64)"
|
||||
color="red">{{ text }}
|
||||
</a-tag>
|
||||
<template v-else color="#FFF">{{ text }}</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import _ from "lodash";
|
||||
import XLSX from "xlsx";
|
||||
import {pageLakeUrl, getColumnOptions} from "@/api/ecology/special-lake";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
// import moment from "moment";
|
||||
import {specialTableColumns} from "../collect/colums"
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "StatisticSoundZoneBase",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: pageLakeUrl,
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: specialTableColumns,
|
||||
palceOptions: [],
|
||||
areaOptions: [],
|
||||
regionLevelOptions: [],
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
checked: 1,
|
||||
},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadOptionData();
|
||||
},
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("place").then((res) => {
|
||||
this.palceOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
getColumnOptions("area").then((res) => {
|
||||
this.areaOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
getColumnOptions("region_level").then((res) => {
|
||||
this.regionLevelOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.where = {
|
||||
checked: 1,
|
||||
};
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const columns = [
|
||||
{
|
||||
title: "行政区划代码",
|
||||
dataIndex: "regionCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测年度",
|
||||
dataIndex: "monitorYear",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "点位编码",
|
||||
dataIndex: "placeCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点名称",
|
||||
dataIndex: "place",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点经度",
|
||||
dataIndex: "placeLng",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点纬度",
|
||||
dataIndex: "placeLat",
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "测点参照物",
|
||||
dataIndex: "refObj",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "网格边长",
|
||||
dataIndex: "gridLength",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "网格覆盖人口(万)",
|
||||
dataIndex: "people",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "功能区代码",
|
||||
dataIndex: "functionCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "月",
|
||||
dataIndex: "monitorMonth",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "日",
|
||||
dataIndex: "monitorDay",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "时",
|
||||
dataIndex: "monitorHour",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "分",
|
||||
dataIndex: "monitorMinute",
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "indexLeq",
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "indexL10",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "indexL50",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "indexL90",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "最大值",
|
||||
dataIndex: "indexLmax",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "最小值",
|
||||
dataIndex: "indexLmin",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "标准差(SD)",
|
||||
dataIndex: "indexSd",
|
||||
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,
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
dataIndex: "remark",
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
const arr = [];
|
||||
const th = columns.map((item) => item.title);
|
||||
arr.push(th);
|
||||
this.data.forEach((d) => {
|
||||
const td = columns.map((item) => d[item.dataIndex]);
|
||||
arr.push(td);
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
</style>
|
||||
@@ -1,224 +0,0 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 搜索表单 -->
|
||||
<a-form
|
||||
:model="where"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-row>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="起始年份">
|
||||
<a-select v-model:value="where.startYear" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="item in yearOptions"
|
||||
:disabled="item.value > where.endYear"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="结束年份">
|
||||
<a-select v-model:value="where.endYear" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="item in yearOptions"
|
||||
:disabled="item.value < where.startYear"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<!-- <a-button @click="reset">重置</a-button> -->
|
||||
<a-button @click="exportFile">导出Excel</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
:row-key="(record) => record.source + record.timeSlot"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:needPage="false"
|
||||
:initLoad="false"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import _ from "lodash";
|
||||
import XLSX from "xlsx";
|
||||
import { statisticYearUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "StatisticSoundZoneSource",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: statisticYearUrl,
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "年份",
|
||||
dataIndex: "year",
|
||||
},
|
||||
{
|
||||
title: "网格长(米)",
|
||||
dataIndex: "gridLength",
|
||||
},
|
||||
{
|
||||
title: "网格宽(米)",
|
||||
dataIndex: "gridWidth",
|
||||
},
|
||||
{
|
||||
title: "网格总数",
|
||||
dataIndex: "gridCount",
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
},
|
||||
{
|
||||
title: "监测结果",
|
||||
children: [
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "leq",
|
||||
},
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "l10",
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "l50",
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "l90",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "质量等级",
|
||||
dataIndex: "level",
|
||||
},
|
||||
],
|
||||
// 表格搜索条件
|
||||
where: {},
|
||||
yearOptions: [],
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadOptionData();
|
||||
},
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("monitor_year").then((res) => {
|
||||
this.yearOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const columns = [
|
||||
{
|
||||
title: "年份",
|
||||
dataIndex: "year",
|
||||
},
|
||||
{
|
||||
title: "网格长(米)",
|
||||
dataIndex: "gridLength",
|
||||
},
|
||||
{
|
||||
title: "网格宽(米)",
|
||||
dataIndex: "gridWidth",
|
||||
},
|
||||
{
|
||||
title: "网格总数",
|
||||
dataIndex: "gridCount",
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
},
|
||||
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "leq",
|
||||
},
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "l10",
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "l50",
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "l90",
|
||||
},
|
||||
|
||||
{
|
||||
title: "质量等级",
|
||||
dataIndex: "level",
|
||||
},
|
||||
];
|
||||
|
||||
const arr = [];
|
||||
const th = columns.map((item) => item.title);
|
||||
arr.push(th);
|
||||
this.data.forEach((d) => {
|
||||
const td = columns.map((item) => d[item.dataIndex]);
|
||||
arr.push(td);
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
</style>
|
||||
Reference in New Issue
Block a user