Merge remote-tracking branch 'origin/master'

This commit is contained in:
710356044
2021-11-30 14:46:06 +08:00
8 changed files with 374 additions and 152 deletions

View File

@@ -1,6 +1,10 @@
import axios from 'axios'; import axios from 'axios';
// -------------------江河--水站水功能区数据列表----------------------- // -------------------江河--水站水功能区数据列表-----------------------
const pageBillUrl = '/surfaceWaterSection/waterSiteBill/page'; const pageBillUrl = '/surfaceWaterSection/waterSiteBill/page';
// 判断是否有重复数据
const saveJudgeInfoSite = function (data) {
return axios.post("/surfaceWaterSection/waterSiteBill/judgeInfo",data)
}
// 添加 // 添加
const saveRiverSiteBill = function (data) { const saveRiverSiteBill = function (data) {
return axios.post("/surfaceWaterSection/waterSiteBill/importBatch",data) return axios.post("/surfaceWaterSection/waterSiteBill/importBatch",data)
@@ -59,6 +63,7 @@ const getColumnOptions = function(column){
export { export {
pageBillUrl, pageBillUrl,
saveRiverSiteBill, saveRiverSiteBill,
saveJudgeInfoSite,
removeRiverStationBill, removeRiverStationBill,
updateRiverStationBill, updateRiverStationBill,
removeBatchRiverStationBill, removeBatchRiverStationBill,

View File

@@ -1,6 +1,10 @@
import axios from 'axios'; import axios from 'axios';
// -------------------区控水站水功能区数据列表----------------------- // -------------------区控水站水功能区数据列表-----------------------
const pageBillUrl = '/waterFunctionArea/waterStationWaterFunctionAreaBill/page'; const pageBillUrl = '/waterFunctionArea/waterStationWaterFunctionAreaBill/page';
// 判断是否有重复数据
const saveJudgeInfoStation = function (data) {
return axios.post("/waterFunctionArea/waterStationWaterFunctionAreaBill/judgeInfo",data)
}
// 添加 // 添加
const saveRiverStationBill = function (data) { const saveRiverStationBill = function (data) {
return axios.post("/waterFunctionArea/waterStationWaterFunctionAreaBill/batch",data) return axios.post("/waterFunctionArea/waterStationWaterFunctionAreaBill/batch",data)
@@ -72,6 +76,7 @@ const getGisArea = function(data){
} }
export { export {
pageBillUrl, pageBillUrl,
saveJudgeInfoStation,
saveRiverStationBill, saveRiverStationBill,
removeRiverStationBill, removeRiverStationBill,
updateRiverStationBill, updateRiverStationBill,

View File

@@ -1,6 +1,12 @@
import axios from 'axios'; import axios from 'axios';
// ----------------------列表----------------------- // ----------------------列表-----------------------
const pageBillUrl = '/surfaceWaterSection/surfaceWaterSectionBill/page'; const pageBillUrl = '/surfaceWaterSection/surfaceWaterSectionBill/page';
//判断数据是否重复
const saveJudgeInfo = function (data) {
return axios.post("/surfaceWaterSection/surfaceWaterSectionBill/judgeInfo",data)
}
// 添加 // 添加
const saveRiverBill = function (data) { const saveRiverBill = function (data) {
return axios.post("/surfaceWaterSection/surfaceWaterSectionBill/importBatch",data) return axios.post("/surfaceWaterSection/surfaceWaterSectionBill/importBatch",data)
@@ -63,6 +69,7 @@ const getColumnOptions = function(column){
export { export {
pageBillUrl, pageBillUrl,
saveJudgeInfo,
saveRiverBill, saveRiverBill,
removeRiverBill, removeRiverBill,
updateRiverBill, updateRiverBill,

View File

@@ -1,6 +1,10 @@
import axios from 'axios'; import axios from 'axios';
// ----------------------列表----------------------- // ----------------------列表-----------------------
const pageBillUrl = '/waterFunctionArea/nationalLevelWaterFunctionAreaBill/page'; const pageBillUrl = '/waterFunctionArea/nationalLevelWaterFunctionAreaBill/page';
// 判断是否有重复数据
const saveJudgeInfoWater = function (data) {
return axios.post("/waterFunctionArea/nationalLevelWaterFunctionAreaBill/judgeInfo",data)
}
// 添加 // 添加
const saveWaterFunctionAreaBill = function (data) { const saveWaterFunctionAreaBill = function (data) {
return axios.post("/waterFunctionArea/nationalLevelWaterFunctionAreaBill/importBatch",data) return axios.post("/waterFunctionArea/nationalLevelWaterFunctionAreaBill/importBatch",data)
@@ -73,6 +77,7 @@ const getGisArea = function(data){
export { export {
pageBillUrl, pageBillUrl,
saveWaterFunctionAreaBill, saveWaterFunctionAreaBill,
saveJudgeInfoWater,
removeWaterFunctionAreaBill, removeWaterFunctionAreaBill,
updateWaterFunctionAreaBill, updateWaterFunctionAreaBill,
removeBatchWaterFunctionAreaBill, removeBatchWaterFunctionAreaBill,

View File

@@ -11,12 +11,14 @@
<template #overlay> <template #overlay>
<a-menu> <a-menu>
<a-menu-item> <a-menu-item>
<a-upload :before-upload="importFileFunctionArea" @change="currentVal(1)" :showUploadList="false" accept=".xls,.xlsx,.csv"> <a-upload :before-upload="importFileFunctionArea" @change="currentVal(1)" :showUploadList="false"
accept=".xls,.xlsx,.csv">
国家级水功能 国家级水功能
</a-upload> </a-upload>
</a-menu-item> </a-menu-item>
<a-menu-item> <a-menu-item>
<a-upload :before-upload="importFileFunctionArea" @change="currentVal(2)" :showUploadList="false" accept=".xls,.xlsx,.csv"> <a-upload :before-upload="importFileFunctionArea" @change="currentVal(2)" :showUploadList="false"
accept=".xls,.xlsx,.csv">
区控水站水功能 区控水站水功能
</a-upload> </a-upload>
</a-menu-item> </a-menu-item>
@@ -30,16 +32,19 @@
<a-dropdown> <a-dropdown>
<template #overlay> <template #overlay>
<a-menu @click="handleMenuClick"> <a-menu @click="handleMenuClick">
<a-menu-item v-for="item in form" :key="item.waterStationPointId"> <a-menu-item v-for="item in form" :key="item.waterStationPointId">
{{ item.stationName }} {{ item.stationName }}
<a-upload :before-upload="importFileStation" @change="currentSel(item)" :showUploadList="false" accept=".xls,.xlsx,.csv"> <a-upload :before-upload="importFileStation" @change="currentSel(item)" :showUploadList="false"
水站数据导入 accept=".xls,.xlsx,.csv">
</a-upload> 水站数据导入
</a-menu-item> </a-upload>
</a-menu-item>
</a-menu> </a-menu>
</template> </template>
<a-button >水站导入 <DownOutlined /></a-button> <a-button>水站导入
</a-dropdown> <DownOutlined />
</a-button>
</a-dropdown>
<a-dropdown> <a-dropdown>
<template #overlay> <template #overlay>
<a-menu style="word-spacing:10px;"> <a-menu style="word-spacing:10px;">
@@ -69,6 +74,8 @@
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-card> </a-card>
<a-modal v-model:visible="visibleConfirm" ok-text="确认" cancel-text="取消" @ok="hideModal" title="confirmTitle">
</a-modal>
</div> </div>
</template> </template>
@@ -85,13 +92,16 @@
DownOutlined DownOutlined
} from "@ant-design/icons-vue"; } from "@ant-design/icons-vue";
import { import {
saveWaterFunctionAreaBill saveWaterFunctionAreaBill,
saveJudgeInfoWater,
} from "@/api/ecology/water-function-area" } from "@/api/ecology/water-function-area"
import { import {
saveRiverBill saveRiverBill,
saveJudgeInfo,
} from "@/api/ecology/river"; } from "@/api/ecology/river";
import { import {
saveRiverStationBill saveRiverStationBill,
saveJudgeInfoStation,
} from "@/api/ecology/river-station"; } from "@/api/ecology/river-station";
import { import {
@@ -99,7 +109,8 @@
} from "@/api/ecology/water/river-water"; } from "@/api/ecology/water/river-water";
import { import {
saveRiverSiteBill saveRiverSiteBill,
saveJudgeInfoSite,
} from "@/api/ecology/river-site"; } from "@/api/ecology/river-site";
import { import {
downloadTemplatexls, downloadTemplatexls,
@@ -120,40 +131,42 @@
visible: false, visible: false,
exportType: String, exportType: String,
visibleWater: false, visibleWater: false,
visibleConfirm: false,
confirmTitle: String,
form: [], form: [],
param: {} param: {}
}; };
}, },
created(){ created() {
this.form=[]; this.form = [];
listInfo().then((res) => { listInfo().then((res) => {
if (res.data.code == 0) { if (res.data.code == 0) {
console.log(res.data.data) console.log(res.data.data)
this.visibleWater = true; this.visibleWater = true;
res.data.data.forEach(e => { res.data.data.forEach(e => {
this.form.push(e); this.form.push(e);
}); });
console.log("this.form"+this.form[0].stationName) console.log("this.form" + this.form[0].stationName)
} else { } else {
this.$message.error(res.data.msg); this.$message.error(res.data.msg);
} }
}) })
}, },
methods: { methods: {
showModalWater(){ showModalWater() {
listInfo().then((res) => { listInfo().then((res) => {
if (res.data.code == 0) { if (res.data.code == 0) {
console.log(res.data.data) console.log(res.data.data)
this.visibleWater = true; this.visibleWater = true;
this.form = res.data.data this.form = res.data.data
console.log("this.form"+this.form.stationName) console.log("this.form" + this.form.stationName)
} else { } else {
this.$message.error(res.data.msg); this.$message.error(res.data.msg);
} }
}) })
}, },
//模板下载 //模板下载
download(filename, fileType) { download(filename, fileType) {
if (fileType == "xls") { if (fileType == "xls") {
@@ -175,6 +188,14 @@
showModal() { showModal() {
this.visible = true; this.visible = true;
}, },
// hideModal() {
// saveRiverBill({
// reportTime: new Date(reportDate).getTime(),
// billName: billName,
// regionLevel: "市级",
// surfaceWaterSectionList: billData,
// });
// },
/* 导入本地excel文件 */ /* 导入本地excel文件 */
importFileCity(file) { importFileCity(file) {
const hide = this.$message.loading("导入中..", 0); const hide = this.$message.loading("导入中..", 0);
@@ -215,44 +236,76 @@
} }
const tasks = []; const tasks = [];
if (billData.length > 0) { if (billData.length > 0) {
tasks.push( hide();
saveRiverBill({ saveJudgeInfo({
reportTime: new Date(reportDate).getTime(), surfaceWaterSectionList: billData,
billName: billName, }).then(resp => {
regionLevel: "市级", console.log('判断111' + resp.data.code);
surfaceWaterSectionList: billData, if (resp.data.code == 0) {
}) console.log('判断222' + resp.data.data);
); if (resp.data.data == "true") {
} Modal.confirm({
title: resp.data.msg + '有重复数据,确认是否覆盖?',
onOk() {
tasks.push(
saveRiverBill({
reportTime: new Date(reportDate).getTime(),
billName: billName,
regionLevel: "市级",
surfaceWaterSectionList: billData,
}).then((res) => {
console.log("res" + res.data.code)
if (res.data.code == 0) {
Modal.success({
title: "导入成功",
content: `成功导入${billData.length}条数据`,
});
this.$refs.water && this.$refs.water.reload();
} else {
Modal.error({
title: "导入失败",
content: "数据上传出错",
});
}
})
);
},
onCancel() {
console.log('Cancel');
},
});
} else {
saveRiverBill({
reportTime: new Date(reportDate).getTime(),
billName: billName,
regionLevel: "市级",
surfaceWaterSectionList: billData,
}).then((res) => {
console.log("res" + res.data.code)
if (res.data.code == 0) {
Modal.success({
title: "导入成功",
content: `成功导入${billData.length}条数据`,
});
this.$refs.water && this.$refs.water.reload();
} else {
Modal.error({
title: "导入失败",
content: "数据上传出错",
});
}
})
}
// 上传到服务器
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 { } else {
Modal.error({ Modal.error({
title: "导入失败", title: resp.data.msg,
content: "数据上传出错",
}); });
} }
})
}
})
.catch(() => {
Modal.error({
title: "导入失败",
content: "数据上传出错",
});
})
.finally(() => {
hide();
});
} catch (error) { } catch (error) {
hide(); hide();
Modal.error({ Modal.error({
@@ -282,7 +335,8 @@
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], { let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
header: 1, header: 1,
}); });
const riverList = aoa.filter( var riverList = [];
riverList = aoa.filter(
(item) => { (item) => {
console.log("export" + this.exportType) console.log("export" + this.exportType)
if (this.exportType == "1") { //国家级水功能 if (this.exportType == "1") { //国家级水功能
@@ -312,56 +366,141 @@
return; return;
} }
const tasks = []; const tasks = [];
var varType = this.exportType;
if (billData.length > 0) { if (billData.length > 0) {
if (this.exportType == "1") { if (this.exportType == "1") {
console.log(billName); hide();
tasks.push( saveJudgeInfoWater({
saveWaterFunctionAreaBill({ nationalLevelWaterFunctionAreaList: billData,
billName: billName, }).then(resp => {
regionLevel: this.exportType, if (resp.data.code == 0) {
nationalLevelWaterFunctionAreaList: billData, if (resp.data.data == "true") {
}) Modal.confirm({
); title: resp.data.msg + '有重复数据,确认是否覆盖?',
onOk() {
tasks.push(
saveWaterFunctionAreaBill({
billName: billName,
regionLevel: varType,
nationalLevelWaterFunctionAreaList: billData,
}).then((res) => {
console.log("res" + res.data.code)
if (res.data.code == 0) {
Modal.success({
title: "导入成功",
content: `成功导入${billData.length}条数据`,
});
this.$refs.water && this.$refs.water.reload();
} else {
Modal.error({
title: "导入失败",
content: "数据上传出错",
});
}
})
)
},
onCancel() {
console.log('Cancel');
},
});
} else {
saveWaterFunctionAreaBill({
billName: billName,
regionLevel: varType,
nationalLevelWaterFunctionAreaList: billData,
}).then((res) => {
console.log("res" + res.data.code)
if (res.data.code == 0) {
Modal.success({
title: "导入成功",
content: `成功导入${billData.length}条数据`,
});
this.$refs.water && this.$refs.water.reload();
} else {
Modal.error({
title: "导入失败",
content: "数据上传出错",
});
}
})
}
} else {
Modal.error({
title: resp.data.msg,
});
}
})
} else { } else {
console.log(billName); hide();
tasks.push( saveJudgeInfoStation({
saveRiverStationBill({ waterStationWaterFunctionAreaList: billData,
billName: billName, }).then(resp => {
regionLevel: this.exportType, if (resp.data.code == 0) {
waterStationWaterFunctionAreaList: billData, console.log('判断222' + resp.data.data);
}) if (resp.data.data == "true") {
); Modal.confirm({
title: resp.data.msg + '有重复数据,确认是否覆盖?',
onOk() {
tasks.push(
saveRiverStationBill({
billName: billName,
regionLevel: varType,
waterStationWaterFunctionAreaList: billData,
}).then((res) => {
console.log("res" + res.data.code)
if (res.data.code == 0) {
Modal.success({
title: "导入成功",
content: `成功导入${billData.length}条数据`,
});
this.$refs.water && this.$refs.water.reload();
} else {
Modal.error({
title: "导入失败",
content: "数据上传出错",
});
}
})
)
},
onCancel() {
console.log('Cancel');
},
});
} else {
saveRiverStationBill({
billName: billName,
regionLevel: varType,
waterStationWaterFunctionAreaList: billData,
}).then((res) => {
console.log("res" + res.data.code)
if (res.data.code == 0) {
Modal.success({
title: "导入成功",
content: `成功导入${billData.length}条数据`,
});
this.$refs.water && this.$refs.water.reload();
} else {
Modal.error({
title: "导入失败",
content: "数据上传出错",
});
}
})
}
} else {
Modal.error({
title:resp.data.msg,
});
}
})
} }
} }
// 上传到服务器
console.log(tasks);
Promise.all(tasks)
.then((res) => {
if (res[0].data.code == 0) {
Modal.success({
title: "导入成功",
content: `成功导入${billData.length}条数据`,
});
this.visible = false;
this.$refs.functionWater && this.$refs.functionWater.reload();
} else {
Modal.error({
title: "导入失败",
content: res[0].data.msg,
});
}
})
.catch(() => {
Modal.error({
title: "导入失败",
content: "数据上传出错",
});
})
.finally(() => {
hide();
});
} catch (error) { } catch (error) {
hide(); hide();
Modal.error({ Modal.error({
@@ -422,43 +561,74 @@
return; return;
} }
const tasks = []; const tasks = [];
var system = this.param.system;
if (billData.length > 0) { if (billData.length > 0) {
tasks.push( hide();
saveRiverSiteBill({ saveJudgeInfoSite({
billName: billName, waterSiteList: billData,
systemType: this.param.system, }).then(resp => {
waterSiteList: billData, if (resp.data.code == 0) {
}) if (resp.data.data == "true") {
); Modal.confirm({
} title: resp.data.msg + '有重复数据,确认是否覆盖?',
// 上传到服务器 onOk() {
tasks.push(
saveRiverSiteBill({
billName: billName,
systemType: system,
waterSiteList: billData,
}).then((res) => {
console.log("res" + res.data.code)
if (res.data.code == 0) {
Modal.success({
title: "导入成功",
content: `成功导入${billData.length}条数据`,
});
this.$refs.water && this.$refs.water.reload();
} else {
Modal.error({
title: "导入失败",
content: "数据上传出错",
});
}
})
)
},
onCancel() {
console.log('Cancel');
},
});
} else {
saveRiverSiteBill({
billName: billName,
systemType: system,
waterSiteList: billData,
}).then((res) => {
console.log("res" + res.data.code)
if (res.data.code == 0) {
Modal.success({
title: "导入成功",
content: `成功导入${billData.length}条数据`,
});
this.$refs.water && this.$refs.water.reload();
} else {
Modal.error({
title: "导入失败",
content: "数据上传出错",
});
}
})
}
Promise.all(tasks)
.then((res) => {
if (res[0].data.code == 0) {
Modal.success({
title: "导入成功",
content: `成功导入${billData.length}条数据`,
});
this.visibleWater = false;
this.$refs.station && this.$refs.station.reload();
} else { } else {
Modal.error({ Modal.error({
title: "导入失败", title: resp.data.msg,
content: "数据上传出错",
}); });
} }
})
}
})
.catch(() => {
Modal.error({
title: "导入失败",
content: "数据上传出错",
});
})
.finally(() => {
hide();
});
} catch (error) { } catch (error) {
hide(); hide();
Modal.error({ Modal.error({

View File

@@ -120,13 +120,17 @@ export default {
let year = date.getFullYear(); // 年 let year = date.getFullYear(); // 年
var time; var time;
var samplingTime=""; var samplingTime="";
console.log(item);
if(item[14]){ if(item[14]){
time = item[14].replace('月','-').replace('日','').trim(); time = item[14].replace('月','-').replace('日','').trim();
console.log(time);
samplingTime = year+"-"+time; samplingTime = year+"-"+time;
} }
console.log(samplingTime);
if(samplingTime != ''){ if(samplingTime != ''){
dataTime = samplingTime; dataTime = samplingTime;
} }
console.log(dataTime);
const row = { const row = {
waterSystem:item[1], waterSystem:item[1],
riverLakeLibrary:item[2], riverLakeLibrary:item[2],

View File

@@ -3,7 +3,7 @@
<div class="ele-body"> <div class="ele-body">
<a-card :bordered="false"> <a-card :bordered="false">
<!-- 搜索表单 --> <!-- 搜索表单 -->
<a-form :model="where" :label-col="{ md: { span: 8 }, sm: { span: 24 } }" <!-- <a-form :model="where" :label-col="{ md: { span: 8 }, sm: { span: 36 } }"
:wrapper-col="{ md: { span: 16 }, sm: { span: 24 } }"> :wrapper-col="{ md: { span: 16 }, sm: { span: 24 } }">
<a-row> <a-row>
<a-form-item label="断面名称"> <a-form-item label="断面名称">
@@ -29,7 +29,32 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form> -->
<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 23:59:59" v-model:value="where.timeEnd"></a-date-picker>
</a-form-item>
<a-form-item label="断面名称">
<a-select v-model:value="where.sectionName" allowClear showSearch style="width: 150px;">
<a-select-option v-for="item in sectionInfo" :key="item.sectionName">{{ item.sectionName }}
</a-select-option>
</a-select>
</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="surfaceWaterSectionId" :datasource="url" :columns="columns" :where="where" <ele-pro-table ref="table" row-key="surfaceWaterSectionId" :datasource="url" :columns="columns" :where="where"
:scroll="{ x: 'max-content' }" @done="(d) => (data = d.data)"> :scroll="{ x: 'max-content' }" @done="(d) => (data = d.data)">

View File

@@ -11,6 +11,7 @@ const tableColumns = [
{title: "化学需氧量", dataIndex: "cod", sorter: true,}, {title: "化学需氧量", dataIndex: "cod", sorter: true,},
{title: "五日生化需氧量", dataIndex: "fiveDayBod", sorter: true,}, {title: "五日生化需氧量", dataIndex: "fiveDayBod", sorter: true,},
{title: "氨氮", dataIndex: "ammonia", sorter: true,}, {title: "氨氮", dataIndex: "ammonia", sorter: true,},
{title: "总磷", dataIndex: "totalPhosphorus", sorter: true,},
{title: "铜", dataIndex: "cu", sorter: true,}, {title: "铜", dataIndex: "cu", sorter: true,},
{title: "锌", dataIndex: "zn", sorter: true,}, {title: "锌", dataIndex: "zn", sorter: true,},
{title: "氟化物", dataIndex: "f", sorter: true,}, {title: "氟化物", dataIndex: "f", sorter: true,},