统计代码优化

This commit is contained in:
shixiaoman
2021-11-26 17:11:50 +08:00
parent 03d769b835
commit fa9a4e4324
5 changed files with 113 additions and 226 deletions

View File

@@ -143,7 +143,7 @@
align:'center',
children: [{
title: '一',
dataIndex: 'riverName',
dataIndex: 'waterTemperature',
align: 'center',
}]
},
@@ -154,7 +154,7 @@
align:'center',
children: [{
title: '6~9',
dataIndex: 'riverName',
dataIndex: 'ph',
align: 'center',
}]
},
@@ -165,15 +165,19 @@
align:'center',
children: [{
title: '≥7.5',
dataIndex: 'dissolvedOxygen',
align:'center',
children: [{
title: '≥6',
dataIndex: 'dissolvedOxygen',
align:'center',
children: [{
title: '≥5',
dataIndex: 'dissolvedOxygen',
align:'center',
children: [{
title: '≥3',
dataIndex: 'dissolvedOxygen',
align:'center',
}],
}],
@@ -186,15 +190,19 @@
key: 'permanganateIndex',
children: [{
title: '≤2',
dataIndex: 'permanganateIndex',
align:'center',
children: [{
title: '≤4',
dataIndex: 'permanganateIndex',
align:'center',
children: [{
title: '≤6',
dataIndex: 'permanganateIndex',
align:'center',
children: [{
title: '≤10',
dataIndex: 'permanganateIndex',
align:'center',
}],
}],
@@ -207,15 +215,19 @@
key: 'ammonia',
children: [{
title: '≤0.15',
dataIndex: 'ammonia',
align:'center',
children: [{
title: '≤0.5',
dataIndex: 'ammonia',
align:'center',
children: [{
title: '≤1.0',
dataIndex: 'ammonia',
align:'center',
children: [{
title: '≤1.5',
dataIndex: 'ammonia',
align:'center',
}],
}],
@@ -228,15 +240,19 @@
key: 'totalPhosphorus',
children: [{
title: '≤0.02',
dataIndex: 'totalPhosphorus',
align:'center',
children: [{
title: '≤0.1',
dataIndex: 'totalPhosphorus',
align:'center',
children: [{
title: '≤0.2',
dataIndex: 'totalPhosphorus',
align:'center',
children: [{
title: '≤0.3',
dataIndex: 'totalPhosphorus',
align:'center',
}],
}],
@@ -249,12 +265,16 @@
key: 'totalNitrogen',
children: [{
title: '≤0.2',
dataIndex: 'totalNitrogen',
children: [{
title: '≤0.5',
dataIndex: 'totalNitrogen',
children: [{
title: '≤1.0',
dataIndex: 'totalNitrogen',
children: [{
title: '≤1.5',
dataIndex: 'totalNitrogen',
}],
}],
}],

View File

@@ -189,6 +189,8 @@
/* 刷新表格 */
reload() {
this.loading = true;
this.momData = [];
this.yoyData = [];
listWaterSiteYoy(this.where).then((res) => {
console.log(res.data.data);
if (res.data.code == 0) {

View File

@@ -13,10 +13,10 @@
</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-DD" 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-DD" v-model:value="where.endTime"></a-date-picker>
</a-form-item>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
@@ -32,7 +32,7 @@
</a-form>
<!-- 表格 -->
<a-spin :spinning="loading">
<ele-pro-table ref="table" :datasource="datasource" :columns="columns" :where="where"
<ele-pro-table ref="table" :datasource="url" :columns="columns" :where="where"
:scroll="{ x: 'max-content' }" @done="(d) => (data = d.data)">
</ele-pro-table>
</a-spin>
@@ -43,8 +43,7 @@
<script>
import {
// autonomyWaterFunctionTotalUrl,
autonomyWaterFunctionTotal
autonomyWaterFunctionTotalUrl,
} from "@/api/ecology/river-statis";
import {
listInfo
@@ -63,7 +62,7 @@
locale,
datasource: {},
// 表格数据接口
// url: autonomyWaterFunctionTotalUrl,
url: autonomyWaterFunctionTotalUrl,
selection: [],
tableColumns,
// 表格列配置
@@ -79,51 +78,10 @@
},
mounted() {
this.loading = true;
autonomyWaterFunctionTotal(this.where).then((res) => {
if (res.data.code == 0) {
if (res.data.data != null) {
res.data.data.forEach((e) => {
e.wTemp = "-1";
e.ph = "-1";
e.dissolvedOxygen = "-1";
e.cod = "-1";
e.fiveDayBod = "-1";
e.ammonia = "-1";
e.cu = "-1";
e.zn = "-1";
e.f = "-1";
e.se = "-1";
e.as = "-1";
e.hg = "-1";
e.cd = "-1";
e.cr6 = "-1";
e.pb = "-1";
e.cyanide = "-1";
e.vPhen = "-1";
e.oils = "-1";
e.anSaa = "-1";
e.s = "-1";
e.coloOrg = "-1";
e.so4 = "-1";
e.cl = "-1";
e.nitrateNitrogen = "-1";
e.fe = "-1";
e.mn = "-1";
e.nTotal = "-1";
e.transp = "-1";
e.chla = "-1";
e.ffeMajorOverStandardItemsMultiples = "-1";
e.lprlMajorOverStandardItemsMultiples = "-1";
})
this.datasource = res.data.data;
} else {
this.$message.success("未查询到数据");
}
} else {
this.$message.error(res.data.msg);
}
this.loading = false;
this.$refs.table.reload({
where: this.where,
});
this.loading = false;
},
created() {
listInfo().then((res) => {
@@ -141,51 +99,11 @@
reload() {
this.loading = true;
console.log(this.where);
autonomyWaterFunctionTotal(this.where).then((res) => {
if (res.data.code == 0) {
if (res.data.data != null) {
res.data.data.forEach((e) => {
e.wTemp = "-1";
e.ph = "-1";
e.dissolvedOxygen = "-1";
e.cod = "-1";
e.fiveDayBod = "-1";
e.ammonia = "-1";
e.cu = "-1";
e.zn = "-1";
e.f = "-1";
e.se = "-1";
e.as = "-1";
e.hg = "-1";
e.cd = "-1";
e.cr6 = "-1";
e.pb = "-1";
e.cyanide = "-1";
e.vPhen = "-1";
e.oils = "-1";
e.anSaa = "-1";
e.s = "-1";
e.coloOrg = "-1";
e.so4 = "-1";
e.cl = "-1";
e.nitrateNitrogen = "-1";
e.fe = "-1";
e.mn = "-1";
e.nTotal = "-1";
e.transp = "-1";
e.chla = "-1";
e.ffeMajorOverStandardItemsMultiples = "-1";
e.lprlMajorOverStandardItemsMultiples = "-1";
})
this.datasource = res.data.data;
} else {
this.$message.success("未查询到数据");
}
} else {
this.$message.error(res.data.msg);
}
this.loading = false;
this.$refs.table.reload({
where: this.where,
});
console.log(this.url);
this.loading = false;
},
/* 重置搜索 */
reset() {

View File

@@ -2,15 +2,17 @@ const tableColumns = [
{title: "水体类型", dataIndex: "waterBodyType", sorter: true,},
{title: "水资源一级区名称", dataIndex: "waterResourcesFirstLevelZoneName", sorter: true,},
{title: "水质目标", dataIndex: "waterQualityGoal", sorter: true,},
{title: "采样时间", dataIndex: "monitorTime", sorter: true,},
{title: "数据来源", dataIndex: "dataSources", sorter: true,},
{title: "断面名称", dataIndex: "sectionName", sorter: true,},
{title: "水温", dataIndex: "wTemp", sorter: true,},
{title: "水温", dataIndex: "wtemp", sorter: true,},
{title: "pH", dataIndex: "ph", sorter: true,},
{title: "溶解氧", dataIndex: "dissolvedOxygen", sorter: true,},
{title: "高锰酸盐指数", dataIndex: "permanganateIndex", sorter: true,},
{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,},
@@ -53,4 +55,61 @@ const tableColumns = [
];
export {tableColumns}
const nationalTableColumns = [
{title: "水体类型", dataIndex: "waterBodyType", sorter: true,},
{title: "水资源一级区名称", dataIndex: "waterResourcesFirstLevelZoneName", sorter: true,},
{title: "水质目标", dataIndex: "waterQualityGoal", sorter: true,},
{title: "采样时间", dataIndex: "samplingTime", sorter: true,},
{title: "数据来源", dataIndex: "dataSources", sorter: true,},
{title: "断面名称", dataIndex: "sectionName", sorter: true,},
{title: "水温", dataIndex: "wtemp", sorter: true,},
{title: "pH", dataIndex: "ph", sorter: true,},
{title: "溶解氧", dataIndex: "dissolvedOxygen", sorter: true,},
{title: "高锰酸盐指数", dataIndex: "permanganateIndex", sorter: true,},
{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,},
{title: "硒", dataIndex: "se", sorter: true,},
{title: "砷", dataIndex: "as", sorter: true,},
{title: "汞", dataIndex: "hg", sorter: true,},
{title: "镉", dataIndex: "cd", sorter: true,},
{title: "六价铬", dataIndex: "cr6", sorter: true,},
{title: "铅", dataIndex: "pb", sorter: true,},
{title: "氰化物", dataIndex: "cyanide", sorter: true,},
{title: "挥发酚", dataIndex: "vPhen", sorter: true,},
{title: "石油类", dataIndex: "oils", sorter: true,},
{title: "阴离子表面活性剂", dataIndex: "anSaa", sorter: true,},
{title: "硫化物", dataIndex: "s", sorter: true,},
{title: "粪大肠菌群", dataIndex: "coloOrg", sorter: true,},
{title: "硫酸盐", dataIndex: "so4", sorter: true,},
{title: "氯化物", dataIndex: "cl", sorter: true,},
{title: "硝酸盐氮", dataIndex: "nitrateNitrogen", sorter: true,},
{title: "铁", dataIndex: "fe", sorter: true,},
{title: "锰", dataIndex: "mn", sorter: true,},
{title: "总氮", dataIndex: "nTotal", sorter: true,},
{title: "透明度", dataIndex: "transp", sorter: true,},
{title: "叶绿素", dataIndex: "chla", sorter: true,},
{
title: "全因子评价", children: [
{title: "水功能区水质类别", dataIndex: "ffeWaterFunctionAreaWaterQualityCategory"},
{title: "达标评价结论", dataIndex: "ffeCompliantEvaluationConclusion"},
{title: "主要超标项目及其超标倍数", dataIndex: "ffeMajorOverStandardItemsMultiples"},
]
},
{
title: "水功能区限值纳污红线主要控制项目达标评价", children: [
{title: "水功能区水质类别", dataIndex: "lprlWaterFunctionAreaWaterQualityCategory"},
{title: "达标评价结论", dataIndex: "lprlCompliantEvaluationConclusion"},
{title: "主要超标项目及其超标倍数", dataIndex: "lprlMajorOverStandardItemsMultiples"},
]
},
{title: "系统编码", dataIndex: "systemCode", sorter: true,},
{title: "备注", dataIndex: "remark", sorter: true,},
];
export {tableColumns,nationalTableColumns}

View File

@@ -32,7 +32,7 @@
</a-form>
<!-- 表格 -->
<a-spin :spinning="loading">
<ele-pro-table ref="table" :datasource="datasource" :columns="columns" :where="where"
<ele-pro-table ref="table" :datasource="url" :columns="columns" :where="where"
:scroll="{ x: 'max-content' }" @done="(d) => (data = d.data)">
</ele-pro-table>
</a-spin>
@@ -43,15 +43,15 @@
<script>
import {
// nationalWaterFunctionTotalUrl,
nationalWaterFunctionTotal
nationalWaterFunctionTotalUrl,
// nationalWaterFunctionTotal
} from "@/api/ecology/river-statis";
import {
listInfo
} from "@/api/ecology/water/river-api-relate";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import {
tableColumns
nationalTableColumns
} from "./colums";
import XLSX from "xlsx";
export default {
@@ -60,46 +60,16 @@
data() {
return {
data: [],
datasource: {
wTemp: '-1',
ph: '-1',
dissolvedOxygen: '-1',
cod: '-1',
fiveDayBod: '-1',
ammonia: '-1',
cu: '-1',
zn: '-1',
f: '-1',
se: '-1',
as: '-1',
hg: '-1',
cd: '-1',
cr6: '-1',
pb: '-1',
cyanide: '-1',
vPhen: '-1',
oils: '-1',
anSaa: '-1',
s: '-1',
coloOrg: '-1',
so4: '-1',
cl: '-1',
nitrateNitrogen: '-1',
fe: '-1',
mn: '-1',
nTotal: '-1',
transp: '-1',
chla: '-1'
},
// datasource: {},
locale,
bill: {},
// 表格数据接口
// url: nationalWaterFunctionTotalUrl,
url: nationalWaterFunctionTotalUrl,
selection: [],
tableColumns,
nationalTableColumns,
// 表格列配置
columns: [
...tableColumns,
...nationalTableColumns,
],
// 表格搜索条件
where: {},
@@ -110,51 +80,10 @@
},
mounted() {
this.loading = true;
nationalWaterFunctionTotal(this.where).then((res) => {
if (res.data.code == 0) {
if (res.data.data != null) {
res.data.data.forEach((e) => {
e.wTemp = "-1";
e.ph = "-1";
e.dissolvedOxygen = "-1";
e.cod = "-1";
e.fiveDayBod = "-1";
e.ammonia = "-1";
e.cu = "-1";
e.zn = "-1";
e.f = "-1";
e.se = "-1";
e.as = "-1";
e.hg = "-1";
e.cd = "-1";
e.cr6 = "-1";
e.pb = "-1";
e.cyanide = "-1";
e.vPhen = "-1";
e.oils = "-1";
e.anSaa = "-1";
e.s = "-1";
e.coloOrg = "-1";
e.so4 = "-1";
e.cl = "-1";
e.nitrateNitrogen = "-1";
e.fe = "-1";
e.mn = "-1";
e.nTotal = "-1";
e.transp = "-1";
e.chla = "-1";
e.ffeMajorOverStandardItemsMultiples = "-1";
e.lprlMajorOverStandardItemsMultiples = "-1";
})
this.datasource = res.data.data;
} else {
this.$message.success("未查询到数据");
}
} else {
this.$message.error(res.data.msg);
}
this.loading = false;
})
this.$refs.table.reload({
where: this.where,
});
this.loading = false;
},
created() {
@@ -172,51 +101,10 @@
/* 刷新表格 */
reload() {
this.loading = true;
nationalWaterFunctionTotal(this.where).then((res) => {
if (res.data.code == 0) {
if (res.data.data != null) {
res.data.data.forEach((e) => {
e.wTemp = "-1";
e.ph = "-1";
e.dissolvedOxygen = "-1";
e.cod = "-1";
e.fiveDayBod = "-1";
e.ammonia = "-1";
e.cu = "-1";
e.zn = "-1";
e.f = "-1";
e.se = "-1";
e.as = "-1";
e.hg = "-1";
e.cd = "-1";
e.cr6 = "-1";
e.pb = "-1";
e.cyanide = "-1";
e.vPhen = "-1";
e.oils = "-1";
e.anSaa = "-1";
e.s = "-1";
e.coloOrg = "-1";
e.so4 = "-1";
e.cl = "-1";
e.nitrateNitrogen = "-1";
e.fe = "-1";
e.mn = "-1";
e.nTotal = "-1";
e.transp = "-1";
e.chla = "-1";
e.ffeMajorOverStandardItemsMultiples = "-1";
e.lprlMajorOverStandardItemsMultiples = "-1";
})
this.datasource = res.data.data;
} else {
this.$message.success("未查询到数据");
}
} else {
this.$message.error(res.data.msg);
}
this.loading = false;
})
this.$refs.table.reload({
where: this.where,
});
this.loading = false;
},
/* 重置搜索 */
reset() {