lixiaojun
2025-02-25 83ef19757135f7748c65dbf73abdf1bbd87fae72
WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/20-compressor/HydroCompressorListCtrl.cs
@@ -1,4 +1,6 @@
using Yw.Model;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraPrinting;
using Yw.Model;
namespace Yw.WinFrmUI
{
@@ -436,5 +438,34 @@
            this.colCalcuHeadLoss.Visible = true;
            this.colSet.Visible = false;
        }
        /// <summary>
        ///
        /// </summary>
        public GridView GetGridView()
        {
            return this.gridView1;
        }
        /// <summary>
        ///
        /// </summary>
        public void ExportToXlsx()
        {
            var filePath = FileDialogHelper.SaveFile("导出Excel文件", "Excel文件|*.xlsx");
            if (string.IsNullOrEmpty(filePath))
            {
                return;
            }
            var options = new XlsxExportOptions
            {
                ExportMode = XlsxExportMode.SingleFile, // 导出模式
                ShowGridLines = true, // 显示网格线
                TextExportMode = TextExportMode.Value, // 导出文本模式
                SheetName = "空压机" // 工作表名称
            };
            this.gridView1.ExportToXlsx(filePath, options);
        }
    }
}