From b266e82b9a377fa35a766f7a3a2f5aa95f3c9125 Mon Sep 17 00:00:00 2001 From: duheng <2286773002@qq.com> Date: 星期五, 28 三月 2025 17:57:03 +0800 Subject: [PATCH] 修改首页场所列表 --- WinFrmUI/HStation.WinFrmUI.Auth.Core/04-role-projcet-menu/RoleProjectMenuPage.cs | 56 ++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 36 insertions(+), 20 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Auth.Core/04-role-projcet-menu/RoleProjectMenuPage.cs b/WinFrmUI/HStation.WinFrmUI.Auth.Core/04-role-projcet-menu/RoleProjectMenuPage.cs index 8d02c2d..e0c5edb 100644 --- a/WinFrmUI/HStation.WinFrmUI.Auth.Core/04-role-projcet-menu/RoleProjectMenuPage.cs +++ b/WinFrmUI/HStation.WinFrmUI.Auth.Core/04-role-projcet-menu/RoleProjectMenuPage.cs @@ -1,15 +1,4 @@ -锘縰sing DevExpress.XtraEditors; -using NetTaste; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using Yw; +锘縰sing Yw; using Yw.WinFrmUI; namespace HStation.WinFrmUI @@ -20,6 +9,8 @@ { InitializeComponent(); this.treeList1.InitialMultiColSettings(); + this.PageTitle.Caption = "瑙掕壊鑿滃崟绠$悊"; + this.PageTitle.SvgImageSize = new Size(24, 24); this.roleTreeListCtrl1.FocusedChangedEvent += RoleTreeListCtrl1_FocusedChangedEvent; } @@ -30,17 +21,16 @@ private List<RoleProjcetMenuViewModel> _allBindingList; - private long _roleID; + private Yw.Vmo.RoleVmo _lastRole; /// <summary> /// 鑱氱劍鏀瑰彉浜嬩欢 /// </summary> - private async void RoleTreeListCtrl1_FocusedChangedEvent(Yw.Vmo.Role obj) + private async void RoleTreeListCtrl1_FocusedChangedEvent(Yw.Vmo.RoleVmo obj) { - _roleID = obj.ID; - + _lastRole = obj; _allBindingList = new List<RoleProjcetMenuViewModel>(); - var allList = await BLLFactory<Yw.BLL.RoleProjectMenuMapping>.Instance.GetAuthorizeMenuList(GlobalParas._GlobalParas.ProjectID, obj.ID); + var allList = await BLLFactory<Yw.BLL.RoleProjectMenuMapping>.Instance.GetAuthorizeMenuList(LoginUserInfo.ProjectID, obj.ID); foreach (var item in allList) { _allBindingList.Add(new RoleProjcetMenuViewModel(item)); @@ -60,9 +50,9 @@ menuList.Add(item.ID); } } - var vmo = new Yw.Vmo.SetRoleProjectMenu(); - vmo.ProjectID = GlobalParas._GlobalParas.ProjectID; - vmo.RoleID = _roleID; + var vmo = new Yw.Vmo.SetRoleProjectMenuVmo(); + vmo.ProjectID = LoginUserInfo.ProjectID; + vmo.RoleID = _lastRole.ID; vmo.MenuIds = menuList; var bol = await BLLFactory<Yw.BLL.RoleProjectMenuMapping>.Instance.Set(vmo); if (bol) @@ -79,5 +69,31 @@ { this.treeList1.OptionsFind.AlwaysVisible = !this.treeList1.OptionsFind.AlwaysVisible; } + + private void treeList1_AfterCheckNode(object sender, DevExpress.XtraTreeList.NodeEventArgs e) + { + // 鑾峰彇鐖惰妭鐐� + var parentNode = e.Node.ParentNode; + if (parentNode != null) + { + parentNode.Checked = _isCheck; + } + } + + private bool _isCheck = false; + + private void treeList1_BeforeCheckNode(object sender, DevExpress.XtraTreeList.CheckNodeEventArgs e) + { + var parentNode = e.Node.ParentNode; + if (parentNode != null) + { + _isCheck = parentNode.Checked; + } + } + + private void barBtnRefresh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) + { + RoleTreeListCtrl1_FocusedChangedEvent(_lastRole); + } } } \ No newline at end of file -- Gitblit v1.9.3