From ec1d7cb35b99f01be0151c5b6f0c0fc2fa30ab95 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期六, 21 八月 2021 17:44:09 +0800 Subject: [PATCH] 安防功能 --- HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs | 67 ++++++++++++++++----------------- 1 files changed, 33 insertions(+), 34 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs index d47f84d..8d15c4e 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs @@ -153,8 +153,11 @@ //甯冮槻鍔熻兘 iniDefenseView(); + +#if DEBUG //鍛婅鐩爣 iniAlarmView(); +#endif #region 搴曢儴鍖哄煙 var bottomView = new FrameLayout() @@ -183,6 +186,18 @@ btnConfrim.MouseUpEventHandler = (sender, e) => { + if (string.IsNullOrEmpty( securityAlarm.name )) + { + var tip = new Tip() + { + Text = "璇疯緭鍏ュ畨闃插悕绉�", + CloseTime = 3, + Direction = AMPopTipDirection.None + }; + tip.Show(MainPage.BaseView); + return; + } + if (securityAlarm.input.Count == 0) { var tip = new Tip() @@ -194,18 +209,17 @@ tip.Show(MainPage.BaseView); return; } - if (securityAlarm.output.Count == 0) - { - var tip = new Tip() - { - Text = "璇烽�夋嫨鍛婅鐩爣", - CloseTime = 3, - Direction = AMPopTipDirection.None - }; - tip.Show(MainPage.BaseView); - - return; - } + //if (securityAlarm.output.Count == 0) + //{ + // var tip = new Tip() + // { + // Text = "璇烽�夋嫨鍛婅鐩爣", + // CloseTime = 3, + // Direction = AMPopTipDirection.None + // }; + // tip.Show(MainPage.BaseView); + // return; + //} var waitPage = new Loading(); waitPage.Start(); @@ -216,7 +230,7 @@ var code = securityAlarm.SaveInfo(); if (code == StateCode.SUCCESS) { - SecurityCenter.Security.GetSecurityAlarmList(); + Common.ApiUtlis.Ins.GetSecurityList(); Application.RunOnMainThread(() => { this.RemoveFromParent(); @@ -317,7 +331,10 @@ { foreach (var target in securityAlarm.input) { - inputTargetView.AddChidren(new InputRow(target.GetFunction().name, target.GetFunction().GetRoomListName(),target.StateText())); + if (target.GetFunction() != null) + { + inputTargetView.AddChidren(new InputRow(target.GetFunction().name, target.GetFunction().GetRoomListName(), target.StateText())); + } } inputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.input.Count); //if (outputTargetView != null) @@ -469,25 +486,7 @@ btnDeploymentName.MouseUpEventHandler = eventHandler; } - /// <summary> - /// 娣诲姞瀹夐槻 - /// </summary> - void LoadEvent_AddDefense() - { - var responsePack = new HttpServerRequest().AddSecurity(new List<SecurityAlarm>() { securityAlarm}); - if (responsePack.Code == StateCode.SUCCESS) - { - Application.RunOnMainThread(() => - { - this.RemoveFromParent(); - }); - } - else - { - IMessageCommon.Current.ShowErrorInfoAlter(responsePack.Code); - } - } - + } /// <summary> @@ -533,7 +532,7 @@ Button btnState = new Button() { - Width = Application.GetRealWidth(369), + Width = Application.GetRealWidth(360), TextAlignment = TextAlignment.CenterRight, TextSize = CSS_FontSize.TextFontSize, TextColor = CSS_Color.FirstLevelTitleColor, -- Gitblit v1.8.0