|
|
@@ -742,21 +742,6 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
|
|
|
- // AllConditionReset() {
|
|
|
- // /* 0. 先让表格进入“空壳”状态 */
|
|
|
- // this.filterAlive = false;
|
|
|
- // const tmp = this.queryData; // 暂存
|
|
|
- // this.queryData = []; // 强制清空
|
|
|
- // this.$nextTick(() => {
|
|
|
- // /* 1. 再一次性把列塞回去,配合新的 filterKey */
|
|
|
- // this.filterKey++;
|
|
|
- // this.queryData = tmp;
|
|
|
- // /* 2. 再等 DOM 重建完成再拉数据 */
|
|
|
- // this.$nextTick(() => {
|
|
|
- // this.getList();
|
|
|
- // });
|
|
|
- // });
|
|
|
- // },
|
|
|
AllConditionReset() {
|
|
|
/* 0. 先让表格进入“空壳”状态 */
|
|
|
this.filterAlive = false;
|
|
|
@@ -793,86 +778,6 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
|
|
|
- // async Export() {
|
|
|
- // try {
|
|
|
- // await this.$confirm("确定导出当前页?", "提示", { type: "warning" });
|
|
|
- // setTimeout(() => {
|
|
|
- // const xlsxParam = { raw: true };
|
|
|
- // const tables = document.getElementById("table_excel");
|
|
|
- // const table_book = XLSX.utils.table_to_book(tables, xlsxParam);
|
|
|
- // const tableWrite = XLSX.write(table_book, {
|
|
|
- // bookType: "xlsx",
|
|
|
- // bookSST: true,
|
|
|
- // type: "array",
|
|
|
- // });
|
|
|
- // saveAs(
|
|
|
- // new Blob([tableWrite], { type: "application/octet-stream" }),
|
|
|
- // `${this.title}.xlsx`
|
|
|
- // );
|
|
|
- // }, 1000);
|
|
|
- // } catch (error) {
|
|
|
- // // 忽略取消操作的错误
|
|
|
- // if (error !== "cancel") {
|
|
|
- // console.error("导出失败:", error);
|
|
|
- // this.$message.error("导出失败");
|
|
|
- // }
|
|
|
- // }
|
|
|
- // },
|
|
|
-
|
|
|
- // async Export() {
|
|
|
- // try {
|
|
|
- // await this.$confirm("确定导出当前页?", "提示", { type: "warning" });
|
|
|
-
|
|
|
- // /* 0. 没有数据直接 return */
|
|
|
- // if (!this.list || !this.list.length) {
|
|
|
- // this.$message.warning("当前无数据可导出");
|
|
|
- // return;
|
|
|
- // }
|
|
|
-
|
|
|
- // /* 1. 拿“要显示的列” => 用户没隐藏的列 */
|
|
|
- // const columns = this.queryData.filter((col) => !col.ifHide);
|
|
|
-
|
|
|
- // /* 2. 组装表头(中文列名) */
|
|
|
- // const header = columns.map((col) => col.columnComment);
|
|
|
-
|
|
|
- // /* 3. 组装数据行(与渲染顺序一致) */
|
|
|
- // const data = this.list.map((row) =>
|
|
|
- // columns.map((col) => {
|
|
|
- // const val = row[col.columnComment];
|
|
|
- // /* 字典、日期等你想二次格式化可以在这里处理 */
|
|
|
- // // if (this.isDict(col.columnComment)) {
|
|
|
- // // return this.getDictLabel(val, col.dictType); // 已有公共方法就复用
|
|
|
- // // }
|
|
|
- // if (this.isDateTime(col.columnComment)) {
|
|
|
- // return this.formatToDateTime(val);
|
|
|
- // }
|
|
|
- // return val ?? ""; // 空值给空串,避免 undefined 进 Sheet
|
|
|
- // })
|
|
|
- // );
|
|
|
-
|
|
|
- // /* 4. JSON → Sheet → Workbook */
|
|
|
- // const ws = XLSX.utils.aoa_to_sheet([header, ...data]);
|
|
|
- // const wb = XLSX.utils.book_new();
|
|
|
- // XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
|
|
|
-
|
|
|
- // /* 5. 写二进制 + 下载 */
|
|
|
- // const wbout = XLSX.write(wb, {
|
|
|
- // bookType: "xlsx",
|
|
|
- // bookSST: true,
|
|
|
- // type: "array",
|
|
|
- // });
|
|
|
- // saveAs(
|
|
|
- // new Blob([wbout], { type: "application/octet-stream" }),
|
|
|
- // `${this.title}.xlsx`
|
|
|
- // );
|
|
|
- // } catch (error) {
|
|
|
- // if (error !== "cancel") {
|
|
|
- // console.error("导出失败:", error);
|
|
|
- // this.$message.error("导出失败");
|
|
|
- // }
|
|
|
- // }
|
|
|
- // },
|
|
|
-
|
|
|
async Export() {
|
|
|
try {
|
|
|
await this.$confirm("确定导出当前页?", "提示", { type: "warning" });
|
|
|
@@ -1046,7 +951,7 @@ export default {
|
|
|
await this.getQueryData();
|
|
|
},
|
|
|
handleRefresh() {
|
|
|
- // 注释掉原来的刷新页面代码,改为初始化所有条件
|
|
|
+ // 初始化所有条件
|
|
|
location.reload(true);
|
|
|
|
|
|
// 初始化所有条件
|