lu
2025-04-07 c97a0819cfafa7c1e1c9bfa4974145ad397f5568
DevApp/Gs.DevApp/XtraForm1.cs
@@ -1,4 +1,7 @@
using DevExpress.XtraEditors;
using DevExpress.Internal.WinApi;
using DevExpress.Utils;
using DevExpress.XtraBars.ToastNotifications;
using DevExpress.XtraEditors;
using DevExpress.XtraTreeList;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
@@ -20,67 +23,26 @@
        public XtraForm1()
        {
            InitializeComponent();
            tlMenu.ContextMenuStrip = contextMenuStrip1;
            getTree();
        }
        /// <summary>
        ///     读取列表
        /// </summary>
        private void getTree()
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            var pgq = new PageQueryModel(1, 999999, "a.type_memo");
            var json = JsonConvert.SerializeObject(pgq);
            try
            {
                var strReturn =
                    UtilityHelper.HttpPost("", "MesDefectTypeManager/GetListPage", json);
                var dd = UtilityHelper.ReturnToTablePage(strReturn);
                var dt = dd.rtnData.list;
                tlMenu.DataSource = dt;
                tlMenu.KeyFieldName = "guid";
                tlMenu.ParentFieldName = "upGuid";
                tlMenu.Tag = "typeMemo";
                tlMenu.EndUpdate();
                this.tlMenu.CollapseAll();
                tlMenu.OptionsBehavior.Editable = true;
                tlMenu.OptionsBehavior.AllowRecursiveNodeChecking = false;
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        private void tlMenu_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                var hitInfo = tlMenu.CalcHitInfo(new Point(e.X, e.Y));
                if (hitInfo.HitInfoType == HitInfoType.Cell)
                {
                    tlMenu.FocusedNode = hitInfo.Node;
                   contextMenuStrip1.Show(tlMenu, e.Location);
                }
            }
        }
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (tlMenu.FocusedNode != null)
            {
                // 删除节点的逻辑
                tlMenu.DeleteNode(tlMenu.FocusedNode);
            }
        }
        private void toolStripMenuItem2_Click(object sender, EventArgs e)
        {
            if (tlMenu.FocusedNode != null)
            {
                // 修改节点的逻辑,例如更改节点值
                tlMenu.FocusedNode.SetValue("列名", "新值"); // 替换"列名"和"新值"为实际列名和值
            }
            //toastNotificationsManager1 = new ToastNotificationsManager();
            //VanishingMessage vm = new VanishingMessage(System.Drawing.Color.OrangeRed,  "操作成春树暮云顶戴槈");
            //vm.Show();
            ToolTipControllerShowEventArgs aa = new ToolTipControllerShowEventArgs();
            aa.AllowHtmlText = DefaultBoolean.True;
            aa.Title = "详情"; //HTML, 粗体
            aa.ToolTip = "你好爱你的克格勃"; //断行
            aa.ShowBeak = true;
            aa.Rounded = true; ////圆角
            aa.RoundRadius = 7; //圆角率
            aa.ToolTipType = ToolTipType.SuperTip; //超级样式,可多行或显示图标
            aa.ToolTipType = ToolTipType.Standard;//标准样式,可显示鸟嘴。
            aa.IconType = ToolTipIconType.Information; //消息图标
            aa.IconSize = ToolTipIconSize.Small; //大图标
            tips.ShowHint(aa);
        }
    }
}