年度对比
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<div class="ele-body">
|
<div class="ele-body">
|
||||||
<a-card :bordered="false">
|
<a-card :bordered="false">
|
||||||
<!-- 搜索表单 -->
|
<!-- 搜索表单 -->
|
||||||
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter"/>
|
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<ele-pro-table
|
<ele-pro-table
|
||||||
v-model:selection="selectionList"
|
v-model:selection="selectionList"
|
||||||
@@ -136,38 +136,42 @@ export default {
|
|||||||
filterData(data){
|
filterData(data){
|
||||||
let filterData = []
|
let filterData = []
|
||||||
let addCloumns = []
|
let addCloumns = []
|
||||||
console.log('data', data)
|
|
||||||
if(Array.isArray(data)){
|
if(Array.isArray(data)){
|
||||||
|
|
||||||
data.forEach((item,index)=>{
|
data.forEach((item,index)=>{
|
||||||
|
filterData[index] = {}
|
||||||
filterData[index].type = item.type;
|
filterData[index].type = item.type;
|
||||||
filterData[index].pointName = item.pointName;
|
filterData[index].pointName = item.pointName;
|
||||||
|
|
||||||
// 筛选出年份
|
// 筛选出年份
|
||||||
// if(Array.isArray(item.data)){
|
if(Array.isArray(item.data)){
|
||||||
// item.data.forEach((single,i)=>{
|
item.data.forEach((single,i)=>{
|
||||||
// filterData[index]['comprehensiveNutrition'+i] = single.comprehensiveNutrition;
|
filterData[index]['comprehensiveNutrition'+i] = single.comprehensiveNutrition;
|
||||||
// filterData[index]['level'+i] = single.level;
|
filterData[index]['level'+i] = single.level;
|
||||||
// filterData[index]['overflow'+i] = single.overflow;
|
filterData[index]['overflow'+i] = single.overflow;
|
||||||
// filterData[index]['waterType'+i] = single.waterType;
|
filterData[index]['waterType'+i] = single.waterType;
|
||||||
// filterData[index]['year'+i] = single.year;
|
filterData[index]['year'+i] = single.year;
|
||||||
|
|
||||||
// addCloumns[index].title = single.year
|
addCloumns[index] = {}
|
||||||
|
addCloumns[index].title = single.year
|
||||||
|
addCloumns[index].align = 'center'
|
||||||
|
if(i==0){
|
||||||
|
addCloumns[index].children = [
|
||||||
|
{ title: "水质类别", dataIndex: `waterType${i}`, sorter: true,align:'center' },
|
||||||
|
{ title: "综合营养状态指数", dataIndex: `comprehensiveNutrition${i}`, sorter: true,align:'center' },
|
||||||
|
{ title: "级别", dataIndex: `level${i}`, sorter: true,align:'center' },
|
||||||
|
{
|
||||||
|
title: "超标项目(超标倍数)",
|
||||||
|
align:'center',
|
||||||
|
dataIndex: `overflow${i}`,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
// if(i==0){
|
})
|
||||||
// addCloumns[index].children = [
|
}
|
||||||
// { title: "水质类别", dataIndex: `waterType${i}`, sorter: true },
|
|
||||||
// { title: "综合营养状态指数", dataIndex: `comprehensiveNutrition${i}`, sorter: true },
|
|
||||||
// { title: "级别", dataIndex: `level${i}`, sorter: true },
|
|
||||||
// {
|
|
||||||
// title: "超标项目(超标倍数)",
|
|
||||||
// dataIndex: `overflow${i}`,
|
|
||||||
// sorter: true,
|
|
||||||
// },
|
|
||||||
// ]
|
|
||||||
// }
|
|
||||||
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -177,7 +181,7 @@ console.log('filterData',filterData)
|
|||||||
|
|
||||||
this.columns = [
|
this.columns = [
|
||||||
{ title: "类别", dataIndex: "type", sorter: true },
|
{ title: "类别", dataIndex: "type", sorter: true },
|
||||||
{ title: "点位名称", dataIndex: "pointName", sorter: true },
|
{ title: "点位名称", dataIndex: "pointName", sorter: true},
|
||||||
...addCloumns
|
...addCloumns
|
||||||
]
|
]
|
||||||
this.datasource = filterData;
|
this.datasource = filterData;
|
||||||
@@ -215,4 +219,7 @@ console.log('filterData',filterData)
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
td{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user