| | |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Newtonsoft.Json; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | |
| | | public void LoadPage() |
| | | { |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.GroupControl)).LoadTopView_AddIcon("CombinedDimming", |
| | | var topView = new TopViewDiv(bodyView, Language.StringByID(StringId.GroupControl)); |
| | | topView.maginY = 10; |
| | | topView.LoadTopView_AddIcon("CombinedDimming", |
| | | (s, c) => |
| | | { |
| | | try |
| | |
| | | var page = new AddGroupControlPage(null, |
| | | (newGC) => |
| | | { |
| | | ReadGroupControlList(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | LoadGroupControlView(); |
| | | }); |
| | | }, () => { }); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | |
| | | |
| | | contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(667 - 64), |
| | | Y = Application.GetRealHeight(64+10), |
| | | Height = Application.GetRealHeight(667 - 64-10), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | |
| | | { |
| | | try |
| | | { |
| | | FunctionList.List.groupControls.Clear(); |
| | | FunctionList.List.groupControls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); |
| | | //FunctionList.List.groupControls.Clear(); |
| | | //FunctionList.List.groupControls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); |
| | | |
| | | try |
| | | { |
| | | var groupControlList = JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); |
| | | var readSidList = new List<string>(); |
| | | foreach (var temp in groupControlList) |
| | | { |
| | | FunctionList.List.groupControls.Clear(); |
| | | readSidList.Add(temp.userDeviceGroupControlId); |
| | | if (readSidList.Count >= 20) |
| | | { |
| | | var data = ApiUtlis.Ins.HttpRequest.GetGroupControInfo(readSidList); |
| | | if (data != null) |
| | | { |
| | | if (data.Code == StateCode.SUCCESS) |
| | | { |
| | | var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString()); |
| | | FunctionList.List.groupControls.AddRange(groupControlInfoList); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | readSidList.Clear(); |
| | | } |
| | | } |
| | | if (readSidList.Count > 0) |
| | | { |
| | | var data = ApiUtlis.Ins.HttpRequest.GetGroupControInfo(readSidList); |
| | | if (data != null) |
| | | { |
| | | if (data.Code == StateCode.SUCCESS) |
| | | { |
| | | var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString()); |
| | | FunctionList.List.groupControls.AddRange(groupControlInfoList); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | readSidList.Clear(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"读取组控列表失败:{ex.Message}"); |
| | | } |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //groupControl.roomIds = newGC.roomIds; |
| | | //groupControl.uids = newGC.uids; |
| | | var localTemp = FunctionList.List.groupControls.Find((obj) => obj.deviceId == newGC.deviceId); |
| | | var localTemp = FunctionList.List.groupControls.Find((obj) => obj.deviceId == newGC.deviceId); |
| | | localTemp.roomIds = newGC.roomIds; |
| | | localTemp.uids = newGC.uids; |
| | | localTemp.sids = newGC.sids; |
| | | |
| | | btnFunctionLocationInfo.Text = newGC.GetUidListName(); |
| | | localTemp.name = newGC.name; |
| | | btnFunctionLocationInfo.Text = newGC.GetUidListName(); |
| | | btnFunctionName.Text = newGC.name; |
| | | }); |
| | | } |
| | | } |