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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -3,7 +3,7 @@
<div class="ele-body">
<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 } }">
<a-row>
<a-form-item label="断面名称">
@@ -29,6 +29,31 @@
</a-form-item>
</a-col>
</a-row>
</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"

View File

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