前端方法
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: