优化导出

master
fanluyan 2 years ago
parent 4d6da6139f
commit 011940e004

@ -9,8 +9,8 @@ const htmlToExcel = {
const month = time.getMonth() + 1;
const day = time.getDate();
const name = year + "-" + month + "-" + day;
const wb = XLSX.utils.table_to_book(document.querySelector(dom));
var xlsxParam = { raw: true }; //转换成excel时使用原始的格式
const wb = XLSX.utils.table_to_book(document.querySelector(dom), xlsxParam);
/* 获取二进制字符串作为输出 */
const wbout = XLSX.write(wb, {
bookType: "xlsx",
@ -30,3 +30,29 @@ const htmlToExcel = {
};
export default htmlToExcel;
// import FileSaver from "file-saver";
// import XLSX from "xlsx";
// const htmlToExcel = {
// getExcel(dom, title = "表格") {
// var excelTitle = title;
// var wb = XLSX.utils.table_to_book(document.querySelector(dom));
// /* 获取二进制字符串作为输出 */
// var wbout = XLSX.write(wb, {
// bookType: "xlsx",
// bookSST: true,
// type: "array",
// });
// try {
// FileSaver.saveAs(
// new Blob([wbout], { type: "application/octet-stream" }),
// excelTitle + ".xlsx"
// );
// } catch (e) {
// if (typeof console !== "undefined") console.log(e, wbout);
// }
// return wbout;
// },
// };
// export default htmlToExcel;

@ -195,15 +195,9 @@ export default {
message: "文件删除成功",
type: "success",
});
this.getUpgradeList();
this.getactivityList();
})
.catch(() => {
this.$message({
type: "info",
showClose: true,
message: "已取消删除",
});
});
.catch(() => {});
})
.catch((err) => {});
},

@ -418,7 +418,7 @@
<el-table-column
label="MCU版本"
v-if="MCUcheck"
min-width="160"
min-width="180"
key="MCU"
>
<template slot-scope="scope">
@ -1067,7 +1067,8 @@ export default {
}
localStorage.setItem("checkAllYW", this.checkAllYW);
this.checkAllYW = totalCount === this.ywNumber ? true : false;
this.checkAllYW = totalCount == this.ywNumber ? true : false;
console.log(this.checkAllYW);
this.isIndeterminate = this.ywNumber > 0 && this.ywNumber < totalCount;
// this.isIndeterminate = false;

Loading…
Cancel
Save