diff --git a/src/views/water/lake/statistic/inner/component/avg-nutritional.vue b/src/views/water/lake/statistic/inner/component/avg-nutritional.vue
index e822539..7185ef3 100644
--- a/src/views/water/lake/statistic/inner/component/avg-nutritional.vue
+++ b/src/views/water/lake/statistic/inner/component/avg-nutritional.vue
@@ -59,13 +59,13 @@ export default {
selection: [],
// 表格列配置
columns: [
- {
- key: 'index',
- dataIndex: 'index',
- width: 48,
- align: 'center',
- customRender: ({index}) => index + 1
- },
+ // {
+ // key: 'index',
+ // dataIndex: 'index',
+ // width: 48,
+ // align: 'center',
+ // customRender: ({index}) => index + 1
+ // },
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "类别", dataIndex: "type", sorter: true,},
{title: "点位名称", dataIndex: "pointName", sorter: true,},
diff --git a/src/views/water/lake/statistic/inner/component/com-nutritional.vue b/src/views/water/lake/statistic/inner/component/com-nutritional.vue
index 45575d7..ca962e0 100644
--- a/src/views/water/lake/statistic/inner/component/com-nutritional.vue
+++ b/src/views/water/lake/statistic/inner/component/com-nutritional.vue
@@ -60,13 +60,13 @@ export default {
selection: [],
// 表格列配置
columns: [
- {
- key: 'index',
- dataIndex: 'index',
- width: 48,
- align: 'center',
- customRender: ({index}) => index + 1
- },
+ // {
+ // key: 'index',
+ // dataIndex: 'index',
+ // width: 48,
+ // align: 'center',
+ // customRender: ({index}) => index + 1
+ // },
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "类别", dataIndex: "type", sorter: true,},
{title: "点位名称", dataIndex: "pointName", sorter: true,},
diff --git a/src/views/water/lake/statistic/inner/component/comparison.vue b/src/views/water/lake/statistic/inner/component/comparison.vue
index 8202442..3633320 100644
--- a/src/views/water/lake/statistic/inner/component/comparison.vue
+++ b/src/views/water/lake/statistic/inner/component/comparison.vue
@@ -147,34 +147,34 @@ export default {
// 筛选出年份
if(Array.isArray(item.data)){
- item.data.forEach((single,i)=>{
- filterData[index]['comprehensiveNutrition'+i] = single.comprehensiveNutrition;
- filterData[index]['level'+i] = single.level;
- filterData[index]['overflow'+i] = single.overflow;
- filterData[index]['waterType'+i] = single.waterType;
- filterData[index]['year'+i] = single.year;
+ item.data.forEach((single)=>{
+ // 生成格式化数据
+ filterData[index]['comprehensiveNutrition'+single.year] = single.comprehensiveNutrition;
+ filterData[index]['level'+single.year] = single.level;
+ filterData[index]['overflow'+single.year] = single.overflow;
+ filterData[index]['waterType'+single.year] = single.waterType;
+ filterData[index]['year'+single.year] = single.year;
-
- if(i==0 && index==0){
- addCloumns[index] = {}
- addCloumns[index].title = single.year
- addCloumns[index].align = 'center'
+ // 只拿第一条数据的年份做循环生成表头
+ if(index==0){
+ // 生成导出用的扁平化表头
+ addSCloumns = [...addSCloumns, {dataIndex: `waterType${single.year}`},
+ { dataIndex: `comprehensiveNutrition${single.year}`},
+ {dataIndex: `level${single.year}`},
+ {dataIndex: `overflow${single.year}`}]
- addSCloumns = [
- {dataIndex: `waterType${i}`},
- { dataIndex: `comprehensiveNutrition${i}`},
- {dataIndex: `level${i}`},
- {dataIndex: `overflow${i}`}
- ]
-
- 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' },
+ // 页面展示所需表头
+ addCloumns[single.year] = {}
+ addCloumns[single.year].title = single.year
+ addCloumns[single.year].align = 'center'
+ addCloumns[single.year].children = [
+ { title: "水质类别", dataIndex: `waterType${single.year}`, sorter: true,align:'center' },
+ { title: "综合营养状态指数", dataIndex: `comprehensiveNutrition${single.year}`, sorter: true,align:'center' },
+ { title: "级别", dataIndex: `level${single.year}`, sorter: true,align:'center' },
{
title: "超标项目(超标倍数)",
align:'center',
- dataIndex: `overflow${i}`,
+ dataIndex: `overflow${single.year}`,
sorter: true,
},
]
@@ -186,13 +186,14 @@ export default {
})
}
this.columns = [
- {
- key: 'index',
- dataIndex: 'index',
- width: 48,
- align: 'center',
- customRender: ({index}) => index + 1
- },
+ // {
+ // title: "序号",
+ // key: 'index',
+ // dataIndex: 'index',
+ // width: 48,
+ // align: 'center',
+ // customRender: ({index}) => index + 1
+ // },
{ title: "类别", dataIndex: "type", sorter: true },
{ title: "点位名称", dataIndex: "pointName", sorter: true},
...addCloumns
@@ -229,14 +230,15 @@ export default {
let th1 = []
let th2 = []
columns.forEach(item=>{
- th1.push(item.title)
+
if(Array.isArray(item.children) && item.children.length>0){
item.children.forEach(single=>{
- th1.push('')
+ th1.push(item.title)
th2.push(single.title)
})
}else{
+ th1.push(item.title)
th2.push('')
}
})
diff --git a/src/views/water/lake/statistic/inner/component/raw-colums.js b/src/views/water/lake/statistic/inner/component/raw-colums.js
index c48d9fe..cea059d 100644
--- a/src/views/water/lake/statistic/inner/component/raw-colums.js
+++ b/src/views/water/lake/statistic/inner/component/raw-colums.js
@@ -24,13 +24,13 @@ const innerFilterColumns = [
]
const innerTableColumns = [
- {
- key: 'index',
- dataIndex: 'index',
- width: 48,
- align: 'center',
- customRender: ({index}) => index + 1
- },
+ // {
+ // key: 'index',
+ // dataIndex: 'index',
+ // width: 48,
+ // align: 'center',
+ // customRender: ({index}) => index + 1
+ // },
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "断面名称", dataIndex: "pointName", sorter: true,},
{title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,},
@@ -60,13 +60,13 @@ const innerTableColumns = [
];
const averageTableColumns = [
- {
- key: 'index',
- dataIndex: 'index',
- width: 48,
- align: 'center',
- customRender: ({index}) => index + 1
- },
+ // {
+ // key: 'index',
+ // dataIndex: 'index',
+ // width: 48,
+ // align: 'center',
+ // customRender: ({index}) => index + 1
+ // },
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "断面名称", dataIndex: "pointName", sorter: true,},
{title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,},
diff --git a/src/views/water/lake/statistic/inner/index.vue b/src/views/water/lake/statistic/inner/index.vue
index a9f0e68..e19d94b 100644
--- a/src/views/water/lake/statistic/inner/index.vue
+++ b/src/views/water/lake/statistic/inner/index.vue
@@ -9,13 +9,13 @@
-
+
-
+
-
+
diff --git a/src/views/water/lake/statistic/special/component/avg-nutritional.vue b/src/views/water/lake/statistic/special/component/avg-nutritional.vue
index 50b67bc..204a99b 100644
--- a/src/views/water/lake/statistic/special/component/avg-nutritional.vue
+++ b/src/views/water/lake/statistic/special/component/avg-nutritional.vue
@@ -60,13 +60,13 @@ export default {
selection: [],
// 表格列配置
columns: [
- {
- key: 'index',
- dataIndex: 'index',
- width: 48,
- align: 'center',
- customRender: ({index}) => index + 1
- },
+ // {
+ // key: 'index',
+ // dataIndex: 'index',
+ // width: 48,
+ // align: 'center',
+ // customRender: ({index}) => index + 1
+ // },
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "类别", dataIndex: "type", sorter: true,},
{title: "点位名称", dataIndex: "pointName", sorter: true,},
diff --git a/src/views/water/lake/statistic/special/component/com-nutritional.vue b/src/views/water/lake/statistic/special/component/com-nutritional.vue
index 4264e5e..7a6ca29 100644
--- a/src/views/water/lake/statistic/special/component/com-nutritional.vue
+++ b/src/views/water/lake/statistic/special/component/com-nutritional.vue
@@ -60,13 +60,13 @@ export default {
selection: [],
// 表格列配置
columns: [
- {
- key: 'index',
- dataIndex: 'index',
- width: 48,
- align: 'center',
- customRender: ({index}) => index + 1
- },
+ // {
+ // key: 'index',
+ // dataIndex: 'index',
+ // width: 48,
+ // align: 'center',
+ // customRender: ({index}) => index + 1
+ // },
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "类别", dataIndex: "type", sorter: true,},
{title: "点位名称", dataIndex: "pointName", sorter: true,},
diff --git a/src/views/water/lake/statistic/special/component/comparison.vue b/src/views/water/lake/statistic/special/component/comparison.vue
index 292e943..94e2c34 100644
--- a/src/views/water/lake/statistic/special/component/comparison.vue
+++ b/src/views/water/lake/statistic/special/component/comparison.vue
@@ -147,34 +147,34 @@ export default {
// 筛选出年份
if(Array.isArray(item.data)){
- item.data.forEach((single,i)=>{
- filterData[index]['comprehensiveNutrition'+i] = single.comprehensiveNutrition;
- filterData[index]['level'+i] = single.level;
- filterData[index]['overflow'+i] = single.overflow;
- filterData[index]['waterType'+i] = single.waterType;
- filterData[index]['year'+i] = single.year;
+ item.data.forEach((single)=>{
+ // 生成格式化数据
+ filterData[index]['comprehensiveNutrition'+single.year] = single.comprehensiveNutrition;
+ filterData[index]['level'+single.year] = single.level;
+ filterData[index]['overflow'+single.year] = single.overflow;
+ filterData[index]['waterType'+single.year] = single.waterType;
+ filterData[index]['year'+single.year] = single.year;
-
- if(i==0 && index==0){
- addCloumns[index] = {}
- addCloumns[index].title = single.year
- addCloumns[index].align = 'center'
+ // 只拿第一条数据的年份做循环生成表头
+ if(index==0){
+ // 生成导出用的扁平化表头
+ addSCloumns = [...addSCloumns, {dataIndex: `waterType${single.year}`},
+ { dataIndex: `comprehensiveNutrition${single.year}`},
+ {dataIndex: `level${single.year}`},
+ {dataIndex: `overflow${single.year}`}]
- addSCloumns = [
- {dataIndex: `waterType${i}`},
- { dataIndex: `comprehensiveNutrition${i}`},
- {dataIndex: `level${i}`},
- {dataIndex: `overflow${i}`}
- ]
-
- 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' },
+ // 页面展示所需表头
+ addCloumns[single.year] = {}
+ addCloumns[single.year].title = single.year
+ addCloumns[single.year].align = 'center'
+ addCloumns[single.year].children = [
+ { title: "水质类别", dataIndex: `waterType${single.year}`, sorter: true,align:'center' },
+ { title: "综合营养状态指数", dataIndex: `comprehensiveNutrition${single.year}`, sorter: true,align:'center' },
+ { title: "级别", dataIndex: `level${single.year}`, sorter: true,align:'center' },
{
title: "超标项目(超标倍数)",
align:'center',
- dataIndex: `overflow${i}`,
+ dataIndex: `overflow${single.year}`,
sorter: true,
},
]
@@ -186,13 +186,13 @@ export default {
})
}
this.columns = [
- {
- key: 'index',
- dataIndex: 'index',
- width: 48,
- align: 'center',
- customRender: ({index}) => index + 1
- },
+ // {
+ // key: 'index',
+ // dataIndex: 'index',
+ // width: 48,
+ // align: 'center',
+ // customRender: ({index}) => index + 1
+ // },
{ title: "类别", dataIndex: "type", sorter: true },
{ title: "点位名称", dataIndex: "pointName", sorter: true},
...addCloumns
@@ -229,14 +229,15 @@ export default {
let th1 = []
let th2 = []
columns.forEach(item=>{
- th1.push(item.title)
+
if(Array.isArray(item.children) && item.children.length>0){
item.children.forEach(single=>{
- th1.push('')
+ th1.push(item.title)
th2.push(single.title)
})
}else{
+ th1.push(item.title)
th2.push('')
}
})
@@ -249,7 +250,7 @@ export default {
});
let sheet = XLSX.utils.aoa_to_sheet(arr);
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
- },
+ }
},
};
diff --git a/src/views/water/lake/statistic/special/component/raw-colums.js b/src/views/water/lake/statistic/special/component/raw-colums.js
index c48d9fe..a117cb1 100644
--- a/src/views/water/lake/statistic/special/component/raw-colums.js
+++ b/src/views/water/lake/statistic/special/component/raw-colums.js
@@ -24,13 +24,13 @@ const innerFilterColumns = [
]
const innerTableColumns = [
- {
- key: 'index',
- dataIndex: 'index',
- width: 48,
- align: 'center',
- customRender: ({index}) => index + 1
- },
+ // {
+ // key: 'index',
+ // dataIndex: 'index',
+ // width: 48,
+ // align: 'center',
+ // customRender: ({index}) => index + 1
+ // },
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "断面名称", dataIndex: "pointName", sorter: true,},
{title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,},
@@ -60,15 +60,15 @@ const innerTableColumns = [
];
const averageTableColumns = [
- {
- key: 'index',
- dataIndex: 'index',
- width: 48,
- align: 'center',
- customRender: ({index}) => index + 1
- },
+ // {
+ // key: 'index',
+ // dataIndex: 'index',
+ // width: 48,
+ // align: 'center',
+ // customRender: ({index}) => index + 1
+ // },
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
- {title: "断面名称", dataIndex: "pointName", sorter: true,},
+ {title: "断面名称", dataIndex: "sectionName", sorter: true,},
{title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,},
{title: "pH值", dataIndex: "ph", sorter: true,},
{title: "透明度(cm)", dataIndex: "transparency", sorter: true,},
diff --git a/src/views/water/lake/statistic/special/component/raw.vue b/src/views/water/lake/statistic/special/component/raw.vue
index 50586a5..9b253a5 100644
--- a/src/views/water/lake/statistic/special/component/raw.vue
+++ b/src/views/water/lake/statistic/special/component/raw.vue
@@ -26,7 +26,7 @@ import XLSX from "xlsx";
import {getLakeDropdown, specialOriginalData} from "@/api/ecology/new-lake";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import Search from './search.vue';
-import {innerTableColumns} from "./raw-colums"
+import {specialTableColumns} from "./raw-colums"
export default {
name: 'inner-raw',
components: {
@@ -60,7 +60,7 @@ export default {
datasource:[],
selection: [],
// 表格列配置
- columns: innerTableColumns,
+ columns: specialTableColumns,
palceOptions: [],
areaOptions: [],
regionLevelOptions: [],
@@ -102,7 +102,7 @@ export default {
if(!Array.isArray(keys)){return}
- let newCloumns = [...innerTableColumns]
+ let newCloumns = [...specialTableColumns]
let filterIndex = [];
newCloumns.forEach((item,index)=>{
diff --git a/src/views/water/lake/statistic/special/index.vue b/src/views/water/lake/statistic/special/index.vue
index a9f0e68..e19d94b 100644
--- a/src/views/water/lake/statistic/special/index.vue
+++ b/src/views/water/lake/statistic/special/index.vue
@@ -9,13 +9,13 @@
-
+
-
+
-
+