From 25142f5cc5b653a26cfcdb41ffe0eaf8cd90fb03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Mon, 30 Jan 2023 17:40:14 +0800 Subject: [PATCH] =?UTF-8?q?Vue2=E5=AF=BC=E5=87=BA=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=90=E6=96=87=E4=BB=B6=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Controllers/System/SysPostController.cs | 4 ++-- ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplTreeVue.txt | 8 ++------ ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt | 8 ++------ ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVueSelect.txt | 8 ++------ 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/System/SysPostController.cs b/ZR.Admin.WebApi/Controllers/System/SysPostController.cs index a69dfeb..5527c81 100644 --- a/ZR.Admin.WebApi/Controllers/System/SysPostController.cs +++ b/ZR.Admin.WebApi/Controllers/System/SysPostController.cs @@ -134,8 +134,8 @@ namespace ZR.Admin.WebApi.Controllers.System { var list = PostService.GetAll(); - string sFileName = ExportExcel(list, "syspost", "岗位"); - return SUCCESS(new { path = "/export/" + sFileName, fileName = sFileName }); + var result = ExportExcelMini(list, "post", "岗位列表"); + return ExportExcel(result.Item2, result.Item1); } } } diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplTreeVue.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplTreeVue.txt index 72cfae3..ded7dbf 100644 --- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplTreeVue.txt +++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplTreeVue.txt @@ -372,13 +372,9 @@ $if(replaceDto.ShowBtnExport) confirmButtonText: "确定", cancelButtonText: "取消", type: "warning", + }).then(async () => { + await export${genTable.BusinessName}(queryParams); }) - .then(function () { - return export${genTable.BusinessName}(queryParams); - }) - .then((response) => { - this.download(response.data.path); - }); }, $end //展开/折叠操作 diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt index f4f5d5a..211d22c 100644 --- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt +++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt @@ -376,13 +376,9 @@ $if(replaceDto.ShowBtnExport) confirmButtonText: "确定", cancelButtonText: "取消", type: "warning", + }).then(async () => { + await export${genTable.BusinessName}(queryParams); }) - .then(function () { - return export${genTable.BusinessName}(queryParams); - }) - .then((response) => { - this.download(response.data.path); - }); }, $end }, diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVueSelect.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVueSelect.txt index 8849f45..7d19a6f 100644 --- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVueSelect.txt +++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVueSelect.txt @@ -249,13 +249,9 @@ $if(replaceDto.ShowBtnExport) confirmButtonText: "确定", cancelButtonText: "取消", type: "warning", + }).then(async () => { + await export${genTable.BusinessName}(queryParams); }) - .then(function () { - return export${genTable.BusinessName}(queryParams); - }) - .then((response) => { - this.download(response.data.path); - }); }, $end },