ningshuxia
2025-03-24 7b8ae93d47186c442ff890a1a83d108f115924c7
WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/18-valve/HydroValveListCtrl.cs
@@ -1,4 +1,7 @@
using Yw.Model;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraPrinting;
using DevExpress.XtraSpreadsheet.Model;
using Yw.Model;
namespace Yw.WinFrmUI
{
@@ -328,16 +331,17 @@
        {
            this.groupForHead.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            this.colDbLocked.Visible = false;
            this.colBeginGroup.Visible = false;
            this.colName.Visible = true;
            this.colCode.Visible = true;
            this.colModelType.Visible = true;
            this.colValveMode.Visible = true;
            this.colElev.Visible = true;
            this.colElev.Visible = false;
            this.colMaterial.Visible = false;
            this.colDiameter.Visible = false;
            this.colMinorLoss.Visible = false;
            this.colOpeningDegree.Visible = true;
            this.colCurve.Visible = true;
            this.colOpeningDegree.Visible = false;
            this.colCurve.Visible = false;
            this.colHasDb.Visible = false;
            this.colFlags.Visible = true;
            this.colDescription.Visible = true;
@@ -355,6 +359,7 @@
        {
            this.groupForHead.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            this.colDbLocked.Visible = true;
            this.colBeginGroup.Visible = true;
            this.colName.Visible = true;
            this.colCode.Visible = true;
            this.colModelType.Visible = true;
@@ -382,6 +387,7 @@
        {
            this.groupForHead.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            this.colDbLocked.Visible = true;
            this.colBeginGroup.Visible = true;
            this.colName.Visible = true;
            this.colCode.Visible = true;
            this.colModelType.Visible = true;
@@ -409,6 +415,7 @@
        {
            this.groupForHead.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
            this.colDbLocked.Visible = true;
            this.colBeginGroup.Visible = true;
            this.colName.Visible = true;
            this.colCode.Visible = true;
            this.colModelType.Visible = true;
@@ -436,6 +443,7 @@
        {
            this.groupForHead.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            this.colDbLocked.Visible = true;
            this.colBeginGroup.Visible = true;
            this.colName.Visible = true;
            this.colCode.Visible = true;
            this.colModelType.Visible = true;
@@ -456,6 +464,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);
        }
    }
}