筛选、导出、弹框优化

This commit is contained in:
weicw
2021-08-20 17:18:50 +08:00
parent a70ffbecae
commit bb7618242d
29 changed files with 37994 additions and 1874 deletions

View File

@@ -168,7 +168,7 @@ export default {
groupTimeLength: "monitor_year",
reportTimeScope: [],
valueType: ["index_Leq"],
timeRange:[]
timeRange: [],
},
timeRange: [],
whereRules,
@@ -212,6 +212,8 @@ export default {
this.$message.error("结束时间必须大于起始时间");
return;
}
this.where.startYear = this.where.timeRange[0];
this.where.endYear = this.where.timeRange[1];
}
this.stableDone();
this.$refs.table.reload({
@@ -230,8 +232,8 @@ export default {
console.log(d, dstr);
},
timeRangePanelChange(val) {
val[0]&&(this.where.timeRange[0] = val[0].year());
val[1]&&(this.where.timeRange[1] = val[1].year());
val[0] && (this.where.timeRange[0] = val[0].year());
val[1] && (this.where.timeRange[1] = val[1].year());
this.timeRange = val;
},
// 数据加载完成
@@ -258,190 +260,197 @@ export default {
}
this.hisYears.forEach((item) => {
if (this.where.groupTimeLength == "quarter") {
columns.push({
title: item + "年第一季度Leq",
dataIndex: item+'1'+"Leq",
});
columns.push({
title: item + "年第二季度Leq",
dataIndex: item+'2'+"Leq",
});
columns.push({
title: item + "年第三季度Leq",
dataIndex: item+'3'+"Leq",
});
columns.push({
title: item + "年第四季度Leq",
dataIndex: item+'4'+"Leq",
});
columns.push({
title: item + "年第一季度SD",
dataIndex: item+'1'+"Sd",
});
columns.push({
title: item + "年第二季度SD",
dataIndex: item+'2'+"Sd",
});
columns.push({
title: item + "年第三季度SD",
dataIndex: item+'3'+"Sd",
});
columns.push({
title: item + "年第四季度SD",
dataIndex: item+'4'+"Sd",
});
columns.push({
title: item + "年第一季度L10",
dataIndex: item+'1'+"L10",
});
columns.push({
title: item + "年第二季度L10",
dataIndex: item+'2'+"L10",
});
columns.push({
title: item + "年第三季度L10",
dataIndex: item+'3'+"L10",
});
columns.push({
title: item + "年第四季度L10",
dataIndex: item+'4'+"L10",
});
columns.push({
title: item + "年第一季度L50",
dataIndex: item+'1'+"L50",
});
columns.push({
title: item + "年第二季度L50",
dataIndex: item+'2'+"L50",
});
columns.push({
title: item + "年第三季度L50",
dataIndex: item+'3'+"L50",
});
columns.push({
title: item + "年第四季度L50",
dataIndex: item+'4'+"L50",
});
columns.push({
title: item + "年第一季度L90",
dataIndex: item+'1'+"L90",
});
columns.push({
title: item + "年第二季度L90",
dataIndex: item+'2'+"L90",
});
columns.push({
title: item + "年第三季度L90",
dataIndex: item+'3'+"L90",
});
columns.push({
title: item + "年第四季度L90",
dataIndex: item+'4'+"L90",
});
columns.push({
title: item + "年第一季度Lmin",
dataIndex: item+'1'+"Lmin",
});
columns.push({
title: item + "年第二季度Lmin",
dataIndex: item+'2'+"Lmin",
});
columns.push({
title: item + "年第三季度Lmin",
dataIndex: item+'3'+"Lmin",
});
columns.push({
title: item + "年第四季度Lmin",
dataIndex: item+'4'+"Lmin",
});
columns.push({
title: item + "年第一季度Lmax",
dataIndex: item+'1'+"Lmax",
});
columns.push({
title: item + "年第二季度Lmax",
dataIndex: item+'2'+"Lmax",
});
columns.push({
title: item + "年第三季度Lmax",
dataIndex: item+'3'+"Lmax",
});
columns.push({
title: item + "年第四季度Lmax",
dataIndex: item+'4'+"Lmax",
});
} else {
if (this.where.valueType.includes("index_Leq")) {
if (
(!this.where.timeRange[0] ||
this.where.timeRange[0] <= item) &&
(!this.where.timeRange[1] ||
this.where.timeRange[1] >= item)
) {
if (this.where.groupTimeLength == "quarter") {
columns.push({
title: item + "年Leq",
dataIndex: item + "Leq",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(2) : "";
return val;
},
title: item + "年第一季度Leq",
dataIndex: item + "1" + "Leq",
});
}
if (this.where.valueType.includes("index_SD")) {
columns.push({
title: item + "年SD",
dataIndex: item + "Sd",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(2) : "";
return val;
},
title: item + "年第二季度Leq",
dataIndex: item + "2" + "Leq",
});
}
if (this.where.valueType.includes("index_L10")) {
columns.push({
title: item + "年L10",
dataIndex: item + "L10",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(2) : "";
return val;
},
title: item + "年第三季度Leq",
dataIndex: item + "3" + "Leq",
});
}
columns.push({
title: item + "年第四季度Leq",
dataIndex: item + "4" + "Leq",
});
columns.push({
title: item + "年第一季度SD",
dataIndex: item + "1" + "Sd",
});
columns.push({
title: item + "年第二季度SD",
dataIndex: item + "2" + "Sd",
});
columns.push({
title: item + "年第三季度SD",
dataIndex: item + "3" + "Sd",
});
columns.push({
title: item + "年第四季度SD",
dataIndex: item + "4" + "Sd",
});
columns.push({
title: item + "年第一季度L10",
dataIndex: item + "1" + "L10",
});
columns.push({
title: item + "年第二季度L10",
dataIndex: item + "2" + "L10",
});
columns.push({
title: item + "年第三季度L10",
dataIndex: item + "3" + "L10",
});
columns.push({
title: item + "年第四季度L10",
dataIndex: item + "4" + "L10",
});
columns.push({
title: item + "年第一季度L50",
dataIndex: item + "1" + "L50",
});
columns.push({
title: item + "年第二季度L50",
dataIndex: item + "2" + "L50",
});
columns.push({
title: item + "年第三季度L50",
dataIndex: item + "3" + "L50",
});
columns.push({
title: item + "年第四季度L50",
dataIndex: item + "4" + "L50",
});
columns.push({
title: item + "年第一季度L90",
dataIndex: item + "1" + "L90",
});
columns.push({
title: item + "年第二季度L90",
dataIndex: item + "2" + "L90",
});
columns.push({
title: item + "年第三季度L90",
dataIndex: item + "3" + "L90",
});
columns.push({
title: item + "年第四季度L90",
dataIndex: item + "4" + "L90",
});
columns.push({
title: item + "年第一季度Lmin",
dataIndex: item + "1" + "Lmin",
});
columns.push({
title: item + "年第二季度Lmin",
dataIndex: item + "2" + "Lmin",
});
columns.push({
title: item + "年第三季度Lmin",
dataIndex: item + "3" + "Lmin",
});
columns.push({
title: item + "年第四季度Lmin",
dataIndex: item + "4" + "Lmin",
});
columns.push({
title: item + "年第一季度Lmax",
dataIndex: item + "1" + "Lmax",
});
columns.push({
title: item + "年第二季度Lmax",
dataIndex: item + "2" + "Lmax",
});
columns.push({
title: item + "年第三季度Lmax",
dataIndex: item + "3" + "Lmax",
});
columns.push({
title: item + "年第四季度Lmax",
dataIndex: item + "4" + "Lmax",
});
} else {
if (this.where.valueType.includes("index_Leq")) {
columns.push({
title: item + "年Leq",
dataIndex: item + "Leq",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(2) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_SD")) {
columns.push({
title: item + "年SD",
dataIndex: item + "Sd",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(2) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_L10")) {
columns.push({
title: item + "年L10",
dataIndex: item + "L10",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(2) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_L50")) {
columns.push({
title: item + "年L50",
dataIndex: item + "L50",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(2) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_L90")) {
columns.push({
title: item + "年L90",
dataIndex: item + "L90",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(2) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_Lmin")) {
columns.push({
title: item + "年Lmin",
dataIndex: item + "Lmin",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(2) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_Lmax")) {
columns.push({
title: item + "年Lmax",
dataIndex: item + "Lmax",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(2) : "";
return val;
},
});
if (this.where.valueType.includes("index_L50")) {
columns.push({
title: item + "年L50",
dataIndex: item + "L50",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(2) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_L90")) {
columns.push({
title: item + "年L90",
dataIndex: item + "L90",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(2) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_Lmin")) {
columns.push({
title: item + "年Lmin",
dataIndex: item + "Lmin",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(2) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_Lmax")) {
columns.push({
title: item + "年Lmax",
dataIndex: item + "Lmax",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(2) : "";
return val;
},
});
}
}
}
});