lu
2025-04-14 ecb7a60de1639f520712ce95f99414b0dd2c9713
DevApp/Gs.DevApp/DevFrm/Sys/SysMenu.cs
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Reflection;
using System.Resources;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraTreeList;
@@ -12,6 +6,12 @@
using Gs.DevApp.Properties;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Reflection;
using System.Resources;
using System.Windows.Forms;
namespace Gs.DevApp.DevFrm.User
{
@@ -85,7 +85,7 @@
        {
            var rowGuid = UtilityHelper.GetCurrentDoubleRow(tlMenu, e, "guid");
            if (!string.IsNullOrEmpty(rowGuid))
                getModel(rowGuid, false, 999);
                getModel(rowGuid);
        }
        /// <summary>
@@ -95,7 +95,7 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnEscClick(object sender, EventArgs e)
        {
            UtilityHelper.JumpToTab(xtraTabControl1, 0);
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
        }
        /// <summary>
@@ -113,7 +113,6 @@
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定删除吗?")) return;
            var lst = new List<string>();
            lst.Add(rowGuid);
@@ -126,7 +125,10 @@
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
                    UtilityHelper.JumpToTab(xtraTabControl1, 0);
                    if (xtraTabControl1.SelectedTabPageIndex == 0)
                    { }
                    else
                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                    getTree();
                }
@@ -145,8 +147,21 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
        {
            UtilityHelper.JumpToTab(xtraTabControl1, 0);
            getTree();
            if (xtraTabControl1.SelectedTabPageIndex == 1)
                getModel(lbGuid.Text.Trim());
            else
            {
                //_filterList.Clear();
                //if (gridView1.ActiveFilter.Count > 0)
                //{
                //    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
                //    gridView1.ActiveFilter.Clear();
                //    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                //}
                //getPageList(1);
                getTree();
            }
        }
        /// <summary>
@@ -156,26 +171,35 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
        {
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_name, tlMenu);
            string rowGuid = "", rowName = "";
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_name, tlMenu);
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            getModel(rowGuid, true, 1);
            if (txt_category.SelectedIndex == 1)
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
            if (xtraTabControl1.SelectedTabPageIndex == 1)
            {
                txt_formPath.Enabled = true;
                txt_icon.Enabled = true;
                getModel(rowGuid);
                if (txt_category.SelectedIndex == 1)
                {
                    txt_formPath.Enabled = true;
                    txt_icon.Enabled = true;
                }
                else
                {
                    txt_formPath.Enabled = false;
                    txt_icon.Enabled = false;
                }
            }
            else
            {
                txt_formPath.Enabled = false;
                txt_icon.Enabled = false;
                UtilityHelper.ChangeEnableByControl(this.panel1.Controls, true);
            }
        }
        /// <summary>
@@ -185,9 +209,10 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnAddClick(object sender, EventArgs e)
        {
            UtilityHelper.JumpToTab(xtraTabControl1, 1);
            lbGuid.Text = "";
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
            UtilityHelper.CleanValueByControl(panel1.Controls, true);
        }
        /// <summary>
@@ -221,7 +246,6 @@
                txt_upGuid.Focus();
                return;
            }
            var _obj = new
            {
                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
@@ -244,6 +268,8 @@
                    lbGuid.Text = _rtn.rtnData;
                    toolBarMenu1.isSetBtn = true;
                    UtilityHelper.ChangeEnableByControl(panel1.Controls, false);
                    toolBarMenu1.currentAction = "";
                    Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
                }
            }
            catch (Exception ex)
@@ -270,7 +296,7 @@
                tlMenu.ParentFieldName = "upGuid";
                tlMenu.Tag = "name";
                tlMenu.EndUpdate();
                // this.tlMenu.ExpandAll();
                this.tlMenu.CollapseAll();
                tlMenu.OptionsView.CheckBoxStyle =
                    DefaultNodeCheckBoxStyle.Default;
            }
@@ -280,15 +306,16 @@
            }
        }
        private void getModel(string strGuid, bool isEdit, int tabIdx)
        private void getModel(string strGuid)
        {
            bool isEdit = false;
            if (toolBarMenu1.currentAction == "add") return;
            if (toolBarMenu1.currentAction == "edit") isEdit = true;
            if (string.IsNullOrEmpty(strGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
            var _obj = new
            {
                guid = strGuid //主建
@@ -376,7 +403,6 @@
                        i++;
                    }
                }
            txt_icon.Properties.LargeImages = dicImg;
            txt_icon.Properties.SmallImages = dicImg;
        }