统计代码优化

This commit is contained in:
shixiaoman
2021-12-07 20:21:25 +08:00
parent 95c8da8c1c
commit df51b0a57f
4 changed files with 14 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ import axios from 'axios';
const nationalWaterFunctionTotalUrl = '/waterFunctionArea/riverStatic/nationalPage';
//国家级水功能统计
const listNationalWaterFunctionTotal = function (data) {
return axios.PostMapping("/waterFunctionArea/riverStatic/nationalPage",data)
return axios.post("/waterFunctionArea/riverStatic/nationalPage",data)
}
// /自治区水功能统计
const listAutonomyWaterFunctionTotal = function (data) {

View File

@@ -54,6 +54,7 @@
</template>
<script>
import moment from "moment";
import {
listAutoYoy,
} from "@/api/ecology/river-statis";
@@ -82,8 +83,9 @@
},
{
title: "时间",
dataIndex: "monitorTime",
dataIndex: "samplingTime",
sorter: true,
customRender: ({text})=> moment(text,"YYYY/MM").format("YYYY-MM")
},
{
title: "水质目标",

View File

@@ -183,6 +183,7 @@
/* 刷新表格 */
reload() {
this.loading = true;
this.datasource = [];
listNationalStandard(this.where).then((res) => {
console.log(res.data.data);
if (res.data.code == 0) {

View File

@@ -54,6 +54,7 @@
</template>
<script>
import moment from "moment";
import {
listNationalYoy,
} from "@/api/ecology/river-statis";
@@ -69,7 +70,7 @@
return {
data: [],
locale,
datasource: {},
datasource: [],
// 表格数据接口
// url: autonomyWaterFunctionTotalUrl,
selection: [],
@@ -84,6 +85,7 @@
title: "时间",
dataIndex: "samplingTime",
sorter: true,
customRender: ({text})=> moment(text,"YYYY/MM").format("YYYY-MM")
},
{
title: "水质目标",
@@ -136,8 +138,13 @@
this.loading = true;
listNationalYoy(this.where).then((res) => {
console.log(res.data.data);
this.datasource = [];
if (res.data.code == 0) {
this.datasource = res.data.data;
if (res.data.data) {
res.data.data.forEach(e => {
this.datasource.push(e);
})
}
} else {
this.$message.error(res.data.msg);
}