lixiaojun
2025-02-20 25dd33f23a5e3f8386e25d9298743288a1b4c9f6
WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/16-translation/HydroTranslationListCtrl.cs
@@ -1,4 +1,6 @@
using Yw.Model;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraPrinting;
using Yw.Model;
namespace Yw.WinFrmUI
{
@@ -332,7 +334,8 @@
            this.colName.Visible = true;
            this.colCode.Visible = true;
            this.colModelType.Visible = true;
            this.colElev.Visible = true;
            this.colTranslationType.Visible = true;
            this.colElev.Visible = false;
            this.colMaterial.Visible = true;
            this.colStartDiameter.Visible = true;
            this.colEndDiameter.Visible = true;
@@ -357,6 +360,7 @@
            this.colName.Visible = true;
            this.colCode.Visible = true;
            this.colModelType.Visible = true;
            this.colTranslationType.Visible = true;
            this.colElev.Visible = true;
            this.colMaterial.Visible = true;
            this.colStartDiameter.Visible = true;
@@ -382,6 +386,7 @@
            this.colName.Visible = true;
            this.colCode.Visible = true;
            this.colModelType.Visible = true;
            this.colTranslationType.Visible = true;
            this.colElev.Visible = true;
            this.colMaterial.Visible = true;
            this.colStartDiameter.Visible = true;
@@ -407,6 +412,7 @@
            this.colName.Visible = true;
            this.colCode.Visible = true;
            this.colModelType.Visible = true;
            this.colTranslationType.Visible = true;
            this.colElev.Visible = true;
            this.colMaterial.Visible = true;
            this.colStartDiameter.Visible = true;
@@ -432,6 +438,7 @@
            this.colName.Visible = true;
            this.colCode.Visible = true;
            this.colModelType.Visible = true;
            this.colTranslationType.Visible = true;
            this.colElev.Visible = true;
            this.colMaterial.Visible = true;
            this.colStartDiameter.Visible = true;
@@ -447,6 +454,34 @@
            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);
        }
    }
}