统计代码优化

This commit is contained in:
shixiaoman
2021-11-26 10:13:34 +08:00
parent 07f7cf6b66
commit 028aa411ce
9 changed files with 419 additions and 244 deletions

View File

@@ -36,10 +36,10 @@
</a-form>
<!-- 表格 -->
<a-spin :spinning="loading">
<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>
<ele-pro-table ref="table" :datasource="datasource" bordered :columns="columns" :where="where"
:scroll="{ x: 'max-content' }" @done="(d) => (data = d.data)">
</ele-pro-table>
</a-spin>
</a-card>
</div>
<!-- 编辑弹窗 -->
@@ -71,62 +71,197 @@
selection: [],
// tableColumns,
// 表格列配置
columns: [
{
title: '所在河流名称',
columns: [{
title: ' ',
dataIndex: 'riverName',
key: 'riverName',
align:'center',
children: [{
title: '所在河流名称',
dataIndex: 'riverName',
key: 'riverName',
children: [{
title: '一',
dataIndex: 'riverName',
align: 'center',
}],
}]
},
{
title: '自动站名称',
dataIndex: 'stationName',
key: 'stationName',
title: ' ',
dataIndex: 'riverName',
key: 'riverName',
children: [{
title: '自动站名称',
dataIndex: 'stationName',
align:'center',
key: 'stationName',
children: [{
title: '《地表水环境质量标准》一类水质标准',
children: [{
title: '《地表水环境质量标准》二类水质标准',
children: [{
title: '《地表水环境质量标准》三类水质标准',
children: [{
title: '《地表水环境质量标准》四类水质标准',
}],
}],
}],
}],
}]
},
{
title: '水质考核目标',
dataIndex: 'waterTarget',
key: 'waterTarget',
},
{
title: '水质类别',
dataIndex: 'waterQualityType',
key: 'waterQualityType',
},
{
title: '水温(℃)',
dataIndex: 'waterTemperature',
key: 'waterTemperature',
},
{
title: 'pH (无量纲)',
dataIndex: 'ph',
key: 'ph',
},
{
title: '溶解氧(mg/L)',
dataIndex: 'dissolvedOxygen',
key: 'dissolvedOxygen',
},
{
title: '高锰酸盐指数 (mg/L)',
dataIndex: 'permanganateIndex',
key: 'permanganateIndex',
},
{
title: '氨氮 (mg/L)',
dataIndex: 'ammonia',
key: 'ammonia',
},
{
title: '总磷(mg/L)',
dataIndex: 'totalPhosphorus',
key: 'totalPhosphorus',
},
{
title: '总氮(mg/L)',
dataIndex: 'totalNitrogen',
key: 'totalNitrogen',
},
// {
// title: ' ',
// dataIndex: 'riverName',
// key: 'riverName',
// children: [{
// title: '水质考核目标',
// dataIndex: 'waterTarget',
// key: 'waterTarget',
// }]
// },
// {
// title: ' ',
// dataIndex: 'riverName',
// key: 'riverName',
// children: [{
// title: '水质类别',
// dataIndex: 'waterQualityType',
// key: 'waterQualityType',
// }],
// }
, {
title: '主要水质指标月均值',
dataIndex: 'index',
key: 'index',
align:'center',
children: [{
title: '水温(℃)',
dataIndex: 'waterTemperature',
key: 'waterTemperature',
align:'center',
children: [{
title: '一',
dataIndex: 'riverName',
align: 'center',
}]
},
{
title: 'pH (无量纲)',
dataIndex: 'ph',
key: 'ph',
align:'center',
children: [{
title: '6~9',
dataIndex: 'riverName',
align: 'center',
}]
},
{
title: '溶解氧(mg/L)',
dataIndex: 'dissolvedOxygen',
key: 'dissolvedOxygen',
align:'center',
children: [{
title: '≥7.5',
align:'center',
children: [{
title: '≥6',
align:'center',
children: [{
title: '≥5',
align:'center',
children: [{
title: '≥3',
align:'center',
}],
}],
}],
}],
},
{
title: '高锰酸盐指数 (mg/L)',
dataIndex: 'permanganateIndex',
key: 'permanganateIndex',
children: [{
title: '≤2',
align:'center',
children: [{
title: '≤4',
align:'center',
children: [{
title: '≤6',
align:'center',
children: [{
title: '≤10',
align:'center',
}],
}],
}],
}],
},
{
title: '氨氮 (mg/L)',
dataIndex: 'ammonia',
key: 'ammonia',
children: [{
title: '≤0.15',
align:'center',
children: [{
title: '≤0.5',
align:'center',
children: [{
title: '≤1.0',
align:'center',
children: [{
title: '≤1.5',
align:'center',
}],
}],
}],
}],
},
{
title: '总磷(mg/L)',
dataIndex: 'totalPhosphorus',
key: 'totalPhosphorus',
children: [{
title: '≤0.02',
align:'center',
children: [{
title: '≤0.1',
align:'center',
children: [{
title: '≤0.2',
align:'center',
children: [{
title: '≤0.3',
align:'center',
}],
}],
}],
}],
},
{
title: '总氮(mg/L)',
dataIndex: 'totalNitrogen',
key: 'totalNitrogen',
children: [{
title: '≤0.2',
children: [{
title: '≤0.5',
children: [{
title: '≤1.0',
children: [{
title: '≤1.5',
}],
}],
}],
}],
}
]
}
],
// 表格搜索条件
where: {},
@@ -149,7 +284,8 @@
methods: {
/* 刷新表格 */
reload() {
this.loading = true;
this.loading = true;
this.datasource = {};
listWaterSiteMonthTotal(this.where).then((res) => {
if (res.data.code == 0) {
this.$message.success(res.data.msg);