From 592974441a4df95fffd9167c90192da1a390b1c2 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 06 六月 2023 11:51:12 +0800 Subject: [PATCH] Merge branch 'Dev-Branch' --- HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs | 37 ++++++++++++++++++++----------------- 1 files changed, 20 insertions(+), 17 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs index 29127b6..76991c1 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs @@ -50,7 +50,7 @@ /// <summary> /// 鍥炶皟鍒锋柊 /// </summary> - Action backActon; + Action<GroupControl> backActon; /// <summary> /// 鏄惁鏂板缇ゆ帶 /// </summary> @@ -64,7 +64,7 @@ GroupControlType groupControlType = new GroupControlType(); - public AddGroupControlPage(GroupControl groupControl, Action action) + public AddGroupControlPage(GroupControl groupControl, Action<GroupControl> action) { bodyView = this; if(groupControl == null) @@ -182,6 +182,7 @@ Action chooseRoomBackAction = () => { try { + groupControl.uids = groupControl.roomIds; btnLocationValues.Text = groupControl.GetRoomListName(); } catch { } @@ -383,13 +384,15 @@ try { var addTemp = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); - FunctionList.List.groupControls.AddRange(addTemp); + if (addTemp != null && addTemp.Count > 0) + groupControl.userDeviceGroupControlId = addTemp[0].userDeviceGroupControlId; + FunctionList.List.groupControls.Add(groupControl); } catch (Exception ex) { MainPage.Log($"娣诲姞缇ゆ帶鎴愬姛锛岃浆璇戣繑鍥炴暟鎹け璐�:{ex.Message}"); } - backActon?.Invoke(); + backActon?.Invoke(groupControl); this.RemoveFromParent(); } else @@ -440,7 +443,7 @@ { temp = groupControl; } - backActon?.Invoke(); + backActon?.Invoke(temp); this.RemoveFromParent(); } else @@ -542,7 +545,7 @@ /// <summary> /// 鏄剧ず鐨勮澶囩殑鎬绘暟 /// </summary> - int showCount = 0; + int showCount = -1; /// <summary> /// 鍔犺浇鍔熻兘row @@ -562,7 +565,7 @@ { if (!isAppend) { - showCount = 0; + showCount = -1; functionListView.RemoveAll(); } for(var i =0;i<100;i++) @@ -603,19 +606,14 @@ { btnConfrim.IsSelected = false; } - if (groupControlLightList.Count == functions.Count) + if (groupControlLightList.Count != functions.Count) { - if (!btnChooseAll.IsSelected) - { - btnChooseAll.IsSelected = true; - } + btnChooseAll.TextID = StringId.SelectedAll; } else { - if (btnChooseAll.IsSelected) - { - btnChooseAll.IsSelected = false; - } + if(btnChooseAll.TextID != StringId.Cancel) + btnChooseAll.TextID = StringId.Cancel; } }; if (groupControl.sids.Find((obj) => obj.sid == function.sid) != null) @@ -680,8 +678,12 @@ var form = new FloorRoomSelectPopupView(); form.ShowDeviceFunctionView(btnFloor, this.lightList, (selectId, listFunc) => { + groupControlLightList.Clear(); + groupControl.sids.Clear(); + btnChooseAll.TextID = StringId.SelectAll; + btnConfrim.IsSelected = false; btnChooseAll.MouseUpEventHandler = (sender2, e2) => { - if (groupControlLightList.Count > 0) + if (groupControlLightList.Count == listFunc.Count) { groupControlLightList.Clear(); btnChooseAll.TextID = StringId.SelectAll; @@ -689,6 +691,7 @@ } else { + groupControlLightList.Clear(); groupControlLightList.AddRange(listFunc); btnChooseAll.TextID = StringId.Cancel; btnConfrim.IsSelected = true; -- Gitblit v1.8.0