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 )