From e3f3f62315a5789cd812b96954b67bffda4a0f5a Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 01 四月 2021 16:33:55 +0800
Subject: [PATCH] 金辉项目,萤石摄像头更新
---
HDL_ON/UI/UI0-Public/Widget/DiySelectPopupDialog.cs | 63 ++++++++++++++++++++++++-------
1 files changed, 49 insertions(+), 14 deletions(-)
diff --git a/HDL_ON/UI/UI0-Public/Widget/DiySelectPopupDialog.cs b/HDL_ON/UI/UI0-Public/Widget/DiySelectPopupDialog.cs
index 2d885b4..a66af36 100644
--- a/HDL_ON/UI/UI0-Public/Widget/DiySelectPopupDialog.cs
+++ b/HDL_ON/UI/UI0-Public/Widget/DiySelectPopupDialog.cs
@@ -11,7 +11,7 @@
public class DiySelectPopupDialog : Dialog
{
/// <summary>
- /// ALLSELECT
+ /// ALLSELECT锛屾爣璇�
/// </summary>
public const string ALLSELECT = "ALLSELECT";
@@ -24,7 +24,7 @@
/// </summary>
public FrameLayout BackView;
/// <summary>
- ///
+ /// 鍏ㄩ儴鎸夐挳
/// </summary>
Button leftAllButton;
/// <summary>
@@ -53,13 +53,12 @@
List<RoomCellInfo> mSecondAllList = new List<RoomCellInfo>();
/// <summary>
- /// RoomSelectPopupDialog
+ /// DiySelectPopupDialog
/// </summary>
- /// <param name="SelectAction"></param>
public DiySelectPopupDialog()
{
bodyView = new FrameLayout();
-
+
}
/// <summary>
@@ -67,8 +66,10 @@
/// mFirstList銆乵SecondList涓嶅悎娉曢兘涓嶄細鏄剧ずView
/// mSecondList 涓嶄紶涓洪粯璁や竴绾�
/// </summary>
- /// <param name="mFirstList"></param>
- /// <param name="mSecondList"></param>
+ /// <param name="mFirstList">涓�绾ф暟鎹泦鍚�</param>
+ /// <param name="mSecondList">浜岀骇鏁版嵁闆嗗悎</param>
+ /// <param name="SelectAction">閫夋嫨鍥炶皟浜嬩欢</param>
+ /// <param name="selectTagId"></param>
public void ShowView(List<RoomCellInfo> mFirstList, List<List<RoomCellInfo>> mSecondList, Action<string> SelectAction, string selectTagId = ALLSELECT)
{
if (mFirstList == null)
@@ -99,19 +100,19 @@
this.mFirstList = mFirstList;
this.mSecondList = mSecondList;
this.mSecondAllList.Clear();
- foreach(var list in mSecondList)
+ foreach (var list in mSecondList)
{
foreach (var data in list)
{
this.mSecondAllList.Add(data);
}
}
-
+
//View鏄剧ず
ShowDoubleBaseView();
//鏁版嵁鍐呭濉厖
RefreshDoubleBaseView();
- //
+ //閫変腑鏁堟灉
SetSelectTagId(selectTagId);
}
@@ -120,7 +121,7 @@
/// <summary>
- ///
+ /// 鍒锋柊UI锛岄�夋嫨鍏ㄩ儴
/// </summary>
void SelectAll()
{
@@ -138,13 +139,13 @@
/// </summary>
void SetSelectTagId(string tagId)
{
- if (string.IsNullOrEmpty(tagId) || tagId == ALLSELECT)
+ if (string.IsNullOrEmpty(tagId) || tagId == ALLSELECT || mFirstList == null)
{
SelectAll();
}
else
{
-
+ //涓�绾фゼ灞傚尮閰嶆垚鍔�
var tagInfo = mFirstList.Find((m) => m.TagId == tagId);
if (tagInfo != null)
{
@@ -162,7 +163,41 @@
}
else
{
- SelectAll();
+ //SelectAll();
+ //涓�绾х殑妤煎眰鍖归厤澶辫触锛屽皾璇曞尮閰嶄簩绾�
+ if (mSecondList == null || mFirstList.Count != mSecondList.Count)
+ {
+ SelectAll();
+ }
+ else
+ {
+ //鏄惁鍖归厤鍒版埧闂�
+ bool isFind = false;
+ //1.閬嶅巻浜岀骇鎴块棿鏁版嵁
+ for(var i = 0; i < mSecondList.Count; i++)
+ {
+ foreach (var room in mSecondList[i])
+ {
+ if(tagId == room.TagId)
+ {
+ //鍖归厤鎴块棿鎴愬姛锛岄�変腑瀵逛簬鐨勬ゼ灞�
+ var tagFirstInfo = mFirstList[i];
+ isFind = true;
+ RefreshSelectButton(leftScrolView, tagFirstInfo.TagId);
+ LoadRightScrolView(tagFirstInfo, mSecondList[i]);
+ break;
+ }
+ }
+ }
+
+ //娌℃湁鍖归厤鍒版埧闂�
+ if (!isFind)
+ {
+ SelectAll();
+ }
+ }
+
+
}
}
}
--
Gitblit v1.8.0