江河模块修改

This commit is contained in:
shixiaoman
2021-12-03 18:43:39 +08:00
parent bff3daa644
commit 8c224fe601
5 changed files with 283 additions and 88 deletions

View File

@@ -51,6 +51,13 @@ const listNationalStandard = function (data) {
}
const listAutoYoy = function (data) {
return axios.post("/waterFunctionArea/riverStatic/autoYoy",data)
}
const listNationalYoy = function (data) {
return axios.post("/waterFunctionArea/riverStatic/nationalYoy",data)
}
const listTargetInfo = function () {
@@ -69,5 +76,7 @@ export {
listAvgCompositeIndex,
listAvgWaterQualitySandard,
listAutoStandard,
listNationalStandard
listNationalStandard,
listAutoYoy,
listNationalYoy
}

View File

@@ -204,6 +204,8 @@
october:'',
november:'',
december:'',
standardRate:'',
standard:'',
};
arr.forEach(e => {
target.sectionName = e.sectionName;
@@ -244,8 +246,10 @@
if (month == '12') {
target.december = e.waterQualityCategory;
}
target.standardRate = e.standardRate;
target.standard = e.standard;
})
this.datasource.push(target);
}
} else {

View File

@@ -26,12 +26,11 @@
</a-select>
</a-form-item>
<a-form-item label="起始日期:">
<a-date-picker valueFormat="YYYY-MM-DD" v-model:value="where.startTime"></a-date-picker>
<a-date-picker valueFormat="YYYY-MM" v-model:value="where.startTime"></a-date-picker>
</a-form-item>
<a-form-item label="结束日期:">
<a-date-picker valueFormat="YYYY-MM-DD" v-model:value="where.endTime"></a-date-picker>
<a-date-picker valueFormat="YYYY-MM" v-model:value="where.endTime"></a-date-picker>
</a-form-item>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
@@ -45,7 +44,7 @@
</a-form>
<!-- 表格 -->
<a-spin :spinning="loading">
<ele-pro-table ref="table" :datasource="url" :columns="columns" :where="where"
<ele-pro-table ref="table" :datasource="datasource" :columns="columns" :where="where"
:scroll="{ x: 'max-content' }" @done="(d) => (data = d.data)">
</ele-pro-table>
</a-spin>
@@ -56,18 +55,15 @@
<script>
import {
autonomyWaterFunctionTotalUrl,
listAutoYoy,
} from "@/api/ecology/river-statis";
import {
listInfo
} from "@/api/ecology/water/river-autonomous";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import {
tableColumns
} from "./colums";
import XLSX from "xlsx";
export default {
name: "RiverCollectWater",
name: "AutoCollectWater",
components: {},
data() {
return {
@@ -75,12 +71,41 @@
locale,
datasource: {},
// 表格数据接口
url: autonomyWaterFunctionTotalUrl,
// url: autonomyWaterFunctionTotalUrl,
selection: [],
tableColumns,
// tableColumns,
// 表格列配置
columns: [
...tableColumns,
columns: [{
title: "监测断面名称",
dataIndex: "sectionName",
sorter: true,
},
{
title: "时间",
dataIndex: "monitorTime",
sorter: true,
},
{
title: "水质目标",
dataIndex: "waterQualityGoal",
sorter: true,
},
{
title: "水质类别",
dataIndex: "waterQualityCategory",
sorter: true,
},
{
title: "达标情况",
dataIndex: "standard",
sorter: true,
},
{
title: "达标率",
dataIndex: "standardRate",
sorter: true,
},
],
// 表格搜索条件
where: {},
@@ -90,13 +115,7 @@
waterSystemList: [],
};
},
mounted() {
this.loading = true;
this.$refs.table.reload({
where: this.where,
});
this.loading = false;
},
created() {
listInfo().then((res) => {
if (res.data.code == 0) {
@@ -116,11 +135,15 @@
/* 刷新表格 */
reload() {
this.loading = true;
console.log(this.where);
this.$refs.table.reload({
where: this.where,
listAutoYoy(this.where).then((res) => {
console.log(res.data.data);
if (res.data.code == 0) {
this.datasource = res.data.data;
} else {
this.$message.error(res.data.msg);
}
this.loading = false;
});
console.log(this.url);
this.loading = false;
},
/* 重置搜索 */

View File

@@ -42,7 +42,7 @@
</a-form>
<!-- 表格 -->
<a-spin :spinning="loading">
<ele-pro-table ref="table" :datasource="url" :columns="columns" :where="where"
<ele-pro-table ref="table" :datasource="datasource" :columns="columns" :where="where"
:scroll="{ x: 'max-content' }" @done="(d) => (data = d.data)">
</ele-pro-table>
</a-spin>
@@ -53,31 +53,107 @@
<script>
import {
autonomyWaterFunctionTotalUrl,
listNationalStandard,
} from "@/api/ecology/river-statis";
import {
listInfo
} from "@/api/ecology/water/river-autonomous";
} from "@/api/ecology/water/river-api-relate";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import {
tableColumns
} from "./colums";
import XLSX from "xlsx";
export default {
name: "RiverCollectWater",
name: "AutoCollectWater",
components: {},
data() {
return {
data: [],
locale,
datasource: {},
datasource: [],
// 表格数据接口
url: autonomyWaterFunctionTotalUrl,
// url: autonomyWaterFunctionTotalUrl,
selection: [],
tableColumns,
// tableColumns,
// 表格列配置
columns: [
...tableColumns,
columns: [{
title: "监测断面名称",
dataIndex: "sectionName",
sorter: true,
},
{
title: "水质目标",
dataIndex: "waterQualityGoal",
sorter: true,
},
{
title: "1月",
dataIndex: "january",
sorter: true,
},
{
title: "2月",
dataIndex: "february",
sorter: true,
},
{
title: "3月",
dataIndex: "march",
sorter: true,
},
{
title: "4月",
dataIndex: "april",
sorter: true,
},
{
title: "5月",
dataIndex: "may",
sorter: true,
},
{
title: "6月",
dataIndex: "june",
sorter: true,
},
{
title: "7月",
dataIndex: "july",
sorter: true,
},
{
title: "8月",
dataIndex: "august",
sorter: true,
},
{
title: "9月",
dataIndex: "september",
sorter: true,
},
{
title: "10月",
dataIndex: "october",
sorter: true,
},
{
title: "11月",
dataIndex: "november",
sorter: true,
},
{
title: "12月",
dataIndex: "december",
sorter: true,
},
{
title: "达标率",
dataIndex: "standardRate",
sorter: true,
},
{
title: "达标情况",
dataIndex: "standard",
sorter: true,
},
],
// 表格搜索条件
where: {},
@@ -87,20 +163,13 @@
waterSystemList: [],
};
},
mounted() {
this.loading = true;
this.$refs.table.reload({
where: this.where,
});
this.loading = false;
},
created() {
listInfo().then((res) => {
if (res.data.code == 0) {
console.log(res.data.data)
this.visibleWater = true;
this.sectionInfo = res.data.data
res.data.data.forEach((m) => {
this.waterSystemList.push(m.waterBody);
})
@@ -114,11 +183,79 @@ res.data.data.forEach((m) => {
/* 刷新表格 */
reload() {
this.loading = true;
console.log(this.where);
this.$refs.table.reload({
where: this.where,
listNationalStandard(this.where).then((res) => {
console.log(res.data.data);
if (res.data.code == 0) {
this.$message.success(res.data.msg);
for (var key in res.data.data) {
var arr = res.data.data[key];
console.log(arr);
var target = {
sectionName:'',
january:'',
february:'',
march:'',
april:'',
may:'',
june:'',
july:'',
august:'',
september:'',
october:'',
november:'',
december:'',
standardRate:'',
standard:'',
};
arr.forEach(e => {
target.sectionName = e.sectionName;
var month = e.samplingTime.split("-")[1];
if (month == '01') {
target.january = e.waterQualityCategory;
}
if (month == '02') {
target.february = e.waterQualityCategory;
}
if (month == '03') {
target.march = e.waterQualityCategory;
}
if (month == '04') {
target.april = e.waterQualityCategory;
}
if (month == '05') {
target.may = e.waterQualityCategory;
}
if (month == '06') {
target.june = e.waterQualityCategory;
}
if (month == '07') {
target.july = e.waterQualityCategory;
}
if (month == '08') {
target.august = e.waterQualityCategory;
}
if (month == '09') {
target.september = e.waterQualityCategory;
}
if (month == '10') {
target.october = e.waterQualityCategory;
}
if (month == '11') {
target.november = e.waterQualityCategory;
}
if (month == '12') {
target.december = e.waterQualityCategory;
}
target.standardRate = e.standardRate;
target.standard = e.standard;
})
this.datasource.push(target);
}
} else {
this.$message.error(res.data.msg);
}
this.loading = false;
});
console.log(this.url);
this.loading = false;
},
/* 重置搜索 */

View File

@@ -26,12 +26,11 @@
</a-select>
</a-form-item>
<a-form-item label="起始日期:">
<a-date-picker valueFormat="YYYY-MM-DD" v-model:value="where.startTime"></a-date-picker>
<a-date-picker valueFormat="YYYY-MM" v-model:value="where.startTime"></a-date-picker>
</a-form-item>
<a-form-item label="结束日期:">
<a-date-picker valueFormat="YYYY-MM-DD" v-model:value="where.endTime"></a-date-picker>
<a-date-picker valueFormat="YYYY-MM" v-model:value="where.endTime"></a-date-picker>
</a-form-item>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
@@ -45,7 +44,7 @@
</a-form>
<!-- 表格 -->
<a-spin :spinning="loading">
<ele-pro-table ref="table" :datasource="url" :columns="columns" :where="where"
<ele-pro-table ref="table" :datasource="datasource" :columns="columns" :where="where"
:scroll="{ x: 'max-content' }" @done="(d) => (data = d.data)">
</ele-pro-table>
</a-spin>
@@ -56,18 +55,15 @@
<script>
import {
autonomyWaterFunctionTotalUrl,
listNationalYoy,
} from "@/api/ecology/river-statis";
import {
listInfo
} from "@/api/ecology/water/river-autonomous";
} from "@/api/ecology/water/river-api-relate";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import {
tableColumns
} from "./colums";
import XLSX from "xlsx";
export default {
name: "RiverCollectWater",
name: "AutoCollectWater",
components: {},
data() {
return {
@@ -75,12 +71,40 @@
locale,
datasource: {},
// 表格数据接口
url: autonomyWaterFunctionTotalUrl,
// url: autonomyWaterFunctionTotalUrl,
selection: [],
tableColumns,
// tableColumns,
// 表格列配置
columns: [
...tableColumns,
columns: [{
title: "监测断面名称",
dataIndex: "sectionName",
sorter: true,
},
{
title: "时间",
dataIndex: "samplingTime",
sorter: true,
},
{
title: "水质目标",
dataIndex: "waterQualityGoal",
sorter: true,
},
{
title: "水质类别",
dataIndex: "waterQualityCategory",
sorter: true,
},
{
title: "达标情况",
dataIndex: "standard",
sorter: true,
},
{
title: "达标率",
dataIndex: "standardRate",
sorter: true,
},
],
// 表格搜索条件
where: {},
@@ -90,13 +114,7 @@
waterSystemList: [],
};
},
mounted() {
this.loading = true;
this.$refs.table.reload({
where: this.where,
});
this.loading = false;
},
created() {
listInfo().then((res) => {
if (res.data.code == 0) {
@@ -116,11 +134,15 @@
/* 刷新表格 */
reload() {
this.loading = true;
console.log(this.where);
this.$refs.table.reload({
where: this.where,
listNationalYoy(this.where).then((res) => {
console.log(res.data.data);
if (res.data.code == 0) {
this.datasource = res.data.data;
} else {
this.$message.error(res.data.msg);
}
this.loading = false;
});
console.log(this.url);
this.loading = false;
},
/* 重置搜索 */