From e2031a2377c028479fd0396bc0b6b1736aed5205 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: Fri, 15 Apr 2022 17:07:35 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=89=8D=E7=AB=AF=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Controllers/BaseController.cs | 4 ++-- ZR.Vue/src/utils/ruoyi.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/BaseController.cs b/ZR.Admin.WebApi/Controllers/BaseController.cs index 43e2710..2038e6a 100644 --- a/ZR.Admin.WebApi/Controllers/BaseController.cs +++ b/ZR.Admin.WebApi/Controllers/BaseController.cs @@ -8,7 +8,6 @@ using OfficeOpenXml; using System; using System.Collections.Generic; using System.IO; -using ZR.Admin.WebApi.Filters; namespace ZR.Admin.WebApi.Controllers { @@ -157,7 +156,8 @@ namespace ZR.Admin.WebApi.Controllers { // 添加worksheet ExcelWorksheet worksheet = package.Workbook.Worksheets.Add(fileName); - + //单元格自动适应大小 + worksheet.Cells.Style.ShrinkToFit = true; //全部字段导出 worksheet.Cells.LoadFromCollection(list, true, OfficeOpenXml.Table.TableStyles.Light13); package.SaveAs(stream); diff --git a/ZR.Vue/src/utils/ruoyi.js b/ZR.Vue/src/utils/ruoyi.js index 206a468..3d570c2 100644 --- a/ZR.Vue/src/utils/ruoyi.js +++ b/ZR.Vue/src/utils/ruoyi.js @@ -135,10 +135,10 @@ export function showColumn(columns, value) { } // 通用下载方法 -export function download(fileName) { +export function download(url, fileName) { // window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true; // window.open(baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true) - window.open(baseURL + fileName) + window.open(baseURL + url) } // 字符串格式化(%s )