统计代码优化
This commit is contained in:
@@ -4,7 +4,7 @@ import axios from 'axios';
|
|||||||
const nationalWaterFunctionTotalUrl = '/waterFunctionArea/riverStatic/nationalPage';
|
const nationalWaterFunctionTotalUrl = '/waterFunctionArea/riverStatic/nationalPage';
|
||||||
//国家级水功能统计
|
//国家级水功能统计
|
||||||
const listNationalWaterFunctionTotal = function (data) {
|
const listNationalWaterFunctionTotal = function (data) {
|
||||||
return axios.PostMapping("/waterFunctionArea/riverStatic/nationalPage",data)
|
return axios.post("/waterFunctionArea/riverStatic/nationalPage",data)
|
||||||
}
|
}
|
||||||
// /自治区水功能统计
|
// /自治区水功能统计
|
||||||
const listAutonomyWaterFunctionTotal = function (data) {
|
const listAutonomyWaterFunctionTotal = function (data) {
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import moment from "moment";
|
||||||
import {
|
import {
|
||||||
listAutoYoy,
|
listAutoYoy,
|
||||||
} from "@/api/ecology/river-statis";
|
} from "@/api/ecology/river-statis";
|
||||||
@@ -82,8 +83,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "时间",
|
title: "时间",
|
||||||
dataIndex: "monitorTime",
|
dataIndex: "samplingTime",
|
||||||
sorter: true,
|
sorter: true,
|
||||||
|
customRender: ({text})=> moment(text,"YYYY/MM").format("YYYY-MM")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "水质目标",
|
title: "水质目标",
|
||||||
|
|||||||
@@ -183,6 +183,7 @@
|
|||||||
/* 刷新表格 */
|
/* 刷新表格 */
|
||||||
reload() {
|
reload() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
this.datasource = [];
|
||||||
listNationalStandard(this.where).then((res) => {
|
listNationalStandard(this.where).then((res) => {
|
||||||
console.log(res.data.data);
|
console.log(res.data.data);
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import moment from "moment";
|
||||||
import {
|
import {
|
||||||
listNationalYoy,
|
listNationalYoy,
|
||||||
} from "@/api/ecology/river-statis";
|
} from "@/api/ecology/river-statis";
|
||||||
@@ -69,7 +70,7 @@
|
|||||||
return {
|
return {
|
||||||
data: [],
|
data: [],
|
||||||
locale,
|
locale,
|
||||||
datasource: {},
|
datasource: [],
|
||||||
// 表格数据接口
|
// 表格数据接口
|
||||||
// url: autonomyWaterFunctionTotalUrl,
|
// url: autonomyWaterFunctionTotalUrl,
|
||||||
selection: [],
|
selection: [],
|
||||||
@@ -84,6 +85,7 @@
|
|||||||
title: "时间",
|
title: "时间",
|
||||||
dataIndex: "samplingTime",
|
dataIndex: "samplingTime",
|
||||||
sorter: true,
|
sorter: true,
|
||||||
|
customRender: ({text})=> moment(text,"YYYY/MM").format("YYYY-MM")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "水质目标",
|
title: "水质目标",
|
||||||
@@ -136,8 +138,13 @@
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
listNationalYoy(this.where).then((res) => {
|
listNationalYoy(this.where).then((res) => {
|
||||||
console.log(res.data.data);
|
console.log(res.data.data);
|
||||||
|
this.datasource = [];
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
this.datasource = res.data.data;
|
if (res.data.data) {
|
||||||
|
res.data.data.forEach(e => {
|
||||||
|
this.datasource.push(e);
|
||||||
|
})
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.data.msg);
|
this.$message.error(res.data.msg);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user