前端方法
exportExcle() {
this.randonKey = new Date().getTime;
// 处理查询类型,以逗号分隔
let dataTypeStr = [];
this.dataTypeOptions.forEach(function (arr) {
dataTypeStr.push(arr[1]);
});
this.tableLoading = true;
const _this = this; //把this传入回调函数
let conditionJson = [];
//开始拼接查询条件
if (this.siteId && this.siteId !== "") {
conditionJson.push({
column: "site_id",
type: "eq",
value: this.siteId,
});
}
if (
this.dataDateOne &&
this.dataDateOne !== "" &&
this.dataDateTwo &&
this.dataDateTwo !== ""
) {
let arr = this.dataDateOne + "," + this.dataDateTwo;
conditionJson.push({
column: "data_date",
type: "between",
value: arr,
});
}
let conditionJsonStr = encodeURIComponent(JSON.stringify(conditionJson)); //转码不然会报错
let param = {
conditionJson: conditionJsonStr,
type: this.type,
dataType: dataTypeStr.join(","),
currentPage: this

该博客介绍如何利用Java的EasyExcel库动态生成表头和数据,实现Excel文件的导出。通过getListStringHead方法获取动态表头,getDynamicModelList方法则用于获取动态表格数据,灵活适应不同场景的导出需求。
最低0.47元/天 解锁文章
3638

被折叠的 条评论
为什么被折叠?



