diff --git a/ZR.Vue/src/views/monitor/operlog/index.vue b/ZR.Vue/src/views/monitor/operlog/index.vue index d6eba23..77ba877 100644 --- a/ZR.Vue/src/views/monitor/operlog/index.vue +++ b/ZR.Vue/src/views/monitor/operlog/index.vue @@ -5,7 +5,8 @@ - + @@ -18,8 +19,8 @@ - - + 搜索 @@ -29,13 +30,15 @@ - 删除 + 删除 清空 - 导出 + 导出 + @@ -52,7 +55,8 @@ @@ -63,7 +67,8 @@ @@ -124,11 +129,8 @@ import { cleanOperlog, exportOperlog, } from "@/api/monitor/operlog"; -import DateRangePicker from "@/components/DateRangePicker"; -import { downloadFile } from "@/utils/zipdownload.js"; export default { - components: { DateRangePicker }, name: "Operlog", data() { return { @@ -267,10 +269,7 @@ export default { const { code, data } = response; if (code == 200) { this.msgSuccess("导出成功"); - downloadFile( - process.env.VUE_APP_BASE_API + data.path, - data.fileName - ); + this.download(data.path); } else { this.msgError("导出失败"); } diff --git a/ZR.Vue/src/views/system/post/index.vue b/ZR.Vue/src/views/system/post/index.vue index 993ede9..f1700e0 100644 --- a/ZR.Vue/src/views/system/post/index.vue +++ b/ZR.Vue/src/views/system/post/index.vue @@ -29,7 +29,7 @@ 删除 - 导出 + 导出 @@ -98,7 +98,6 @@ import { updatePost, exportPost, } from "@/api/system/post"; -import { downloadFile } from "@/utils/zipdownload.js"; export default { name: "Post", @@ -269,12 +268,7 @@ export default { return exportPost(queryParams); }) .then((response) => { - console.log(response) - // this.download(response.msg); - downloadFile( - process.env.VUE_APP_BASE_API + response.data.path, - response.data.fileName - ); + this.download(response.data.path); }); }, }, diff --git a/ZR.Vue/src/views/system/user/index.vue b/ZR.Vue/src/views/system/user/index.vue index eefb908..baf5db7 100644 --- a/ZR.Vue/src/views/system/user/index.vue +++ b/ZR.Vue/src/views/system/user/index.vue @@ -7,17 +7,20 @@
- +
- + - + @@ -25,7 +28,8 @@ - + 搜索 @@ -38,16 +42,19 @@ 新增 - 修改 + 修改 - 删除 + 删除 - + - 导出 + 导出 + @@ -78,8 +85,10 @@ @@ -148,14 +157,16 @@ - + + - + + @@ -176,8 +187,9 @@ - +
将文件拖到此处,或 @@ -209,13 +221,12 @@ import { exportUser, resetUserPwd, changeUserStatus, - // importTemplate, + importTemplate, } from "@/api/system/user"; import { getToken } from "@/utils/auth"; import { treeselect } from "@/api/system/dept"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; -import { downloadFile } from "@/utils/zipdownload.js"; export default { name: "User", @@ -273,7 +284,7 @@ export default { // 是否更新已经存在的用户数据 updateSupport: 0, // 设置上传的请求头部 - headers: { Authorization: 'Bearer ' + getToken() }, + headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 url: process.env.VUE_APP_BASE_API + "system/user/importData", }, @@ -548,14 +559,10 @@ export default { type: "warning", }).then(() => { exportUser(queryParams).then((response) => { - console.log(JSON.stringify(response)); const { code, data } = response; if (code == 200) { this.msgSuccess("导出成功"); - downloadFile( - process.env.VUE_APP_BASE_API + data.path, - data.fileName - ); + this.download(data.fileName); } else { this.msgError("导出失败"); } @@ -569,9 +576,7 @@ export default { }, /** 下载模板操作 */ importTemplate() { - // importTemplate().then((response) => { - downLoadExcel("system/user/importTemplate", "用户数据导入模板"); - // }); + this.download("/system/user/importTemplate", "用户数据导入模板"); }, // 文件上传中处理 handleFileUploadProgress(event, file, fileList) { diff --git a/ZR.Vue/src/views/tool/gen/index.vue b/ZR.Vue/src/views/tool/gen/index.vue index edfc8ec..fcf8662 100644 --- a/ZR.Vue/src/views/tool/gen/index.vue +++ b/ZR.Vue/src/views/tool/gen/index.vue @@ -95,7 +95,6 @@ import { delTable, previewTable, } from "@/api/tool/gen"; -import { downloadFile } from "@/utils/zipdownload.js"; import importTable from "./importTable"; import { Loading } from "element-ui"; import hljs from "highlight.js"; @@ -230,10 +229,7 @@ export default { if (code == 200) { this.showGenerate = false; this.msgSuccess("恭喜你,代码生成完成!"); - downloadFile( - process.env.VUE_APP_BASE_API + data.zipPath, - data.fileName - ); + this.download(data.fileName); } else { this.msgError(res.msg); }