From 43b0d5870d528f23ecd6aeceb6cfd4325188b46f Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 01 七月 2021 15:50:43 +0800
Subject: [PATCH] Revert "1"

---
 HDL_ON/UI/UI0-Public/TopViewDiv.cs |  181 ++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 160 insertions(+), 21 deletions(-)

diff --git a/HDL_ON/UI/UI0-Public/TopViewDiv.cs b/HDL_ON/UI/UI0-Public/TopViewDiv.cs
index d561905..27de3ca 100644
--- a/HDL_ON/UI/UI0-Public/TopViewDiv.cs
+++ b/HDL_ON/UI/UI0-Public/TopViewDiv.cs
@@ -1,4 +1,5 @@
 锘縰sing System;
+using System.Collections.Generic;
 using HDL_ON.Entity;
 using HDL_ON.UI.CSS;
 using Shared;
@@ -95,13 +96,7 @@
                 Height = Application.GetRealWidth(28),
                 UnSelectedImagePath = "Public/BackIcon.png",
             };
-            baseView.AddChidren(btnBackIcon);
-
-            btnBack = new Button()
-            {
-                Width = Application.GetRealWidth(50),
-            };
-            baseView.AddChidren(btnBack);
+            contentView.AddChidren(btnBackIcon);
 
             Button btnTilte = new Button()
             {
@@ -114,8 +109,14 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 Text = title
             };
-            baseView.AddChidren(btnTilte);
+            contentView.AddChidren(btnTilte);
 
+
+            btnBack = new Button()
+            {
+                Width = Application.GetRealWidth(70),
+            };
+            contentView.AddChidren(btnBack);
 
             LoadEventList();
         }
@@ -144,8 +145,12 @@
                 Height = Application.GetMinRealAverage(28),
                 UnSelectedImagePath = "Public/FuncInfoSetIcon.png",
             };
-            contentView.AddChidren(btnSetting);
 
+            //濡傛灉鏄垚鍛橀殣钘忕紪杈戝姛鑳�
+            if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare)
+            {
+                contentView.AddChidren(btnSetting);
+            }
             btnSetting.MouseUpEventHandler = (sender, e) =>
             {
                 editAction();
@@ -166,12 +171,16 @@
             var btnSetting = new Button()
             {
                 X = Application.GetRealWidth(337),
-                Y = Application.GetRealHeight(29),
-                Width = Application.GetMinRealAverage(28),
-                Height = Application.GetMinRealAverage(28),
+                Y = Application.GetRealHeight(28),
+                Width = Application.GetMinRealAverage(32),
+                Height = Application.GetMinRealAverage(32),
                 UnSelectedImagePath = "Public/FuncInfoSetIcon.png",
             };
-            contentView.AddChidren(btnSetting);
+            //濡傛灉鏄垚鍛橀殣钘忕紪杈戝姛鑳�
+            if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare)
+            {
+                contentView.AddChidren(btnSetting);
+            }
 
             btnSetting.MouseUpEventHandler = (sender, e) =>
             {
@@ -199,7 +208,12 @@
                 Height = Application.GetMinRealAverage(28),
                 UnSelectedImagePath = "Public/FuncInfoSetIcon.png",
             };
-            contentView.AddChidren(btnSetting);
+
+            //濡傛灉鏄垚鍛橀殣钘忕紪杈戝姛鑳�
+            if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare)
+            {
+                contentView.AddChidren(btnSetting);
+            }
 
             btnSetting.MouseUpEventHandler += (sender, e) =>
             {
@@ -228,21 +242,146 @@
 
             btnAddIcon.MouseUpEventHandler += (sender, e) =>
             {
-                LoadEvent_AddEvent(type, callBack);
+                if (type == "floors")
+                {
+                    Action<string> callBackAction = (floorName) =>
+                    {
+                        callBack("add", floorName);
+                    };
+                    string newFloorName = "1F";
+                    for (int i = 0; i < SpatialInfo.CurrentSpatial.FloorList.Count + 1;)
+                    {
+                        newFloorName = ++i + "F";
+                        if (null == SpatialInfo.CurrentSpatial.FloorList.Find((obj) => obj.roomName == newFloorName))
+                        {
+                            break;
+                        }
+                    }
+                    var fs = new List<string>();
+                    foreach (var f in SpatialInfo.CurrentSpatial.FloorList)
+                    {
+                        fs.Add(f.roomName);
+                    }
+                    new PublicAssmebly().LoadDialog_EditParater(StringId.AddFloors, newFloorName, callBackAction, StringId.FloorNameCannotBeEmpty,
+                        StringId.AddFloorFailed_FloorAlreadyExist, fs);
+                }
+                else
+                {
+                    callBack("", "");
+                }
             };
         }
 
         /// <summary>
-        /// 鍚慺ramelayout娣诲姞椤堕儴鍖哄煙,鎷ユ湁娣诲姞鍥炬爣鐨勬寜閽�,杩斿洖鏈夊洖璋冧簨浠�
+        /// 妤煎眰绠$悊椤堕儴鏍�
         /// </summary>
-        /// <param name="type"></param>
-        /// <param name="callBack"></param>
-        /// <param name="action"></param>
-        public void LoadTopView_AddIcon_BackAction(string type, Action<string, string> callBack,Action action)
+        public void LoadTopView_FloorTopView(Action<string> callBack,Action action)
         {
-            LoadTopView_AddIcon(type, callBack);
+            LoadTopView();
 
             backAction = action;
+
+            var btnAddIcon = new Button()
+            {
+                X = Application.GetRealWidth(337),
+                Y = Application.GetRealHeight(29),
+                Width = Application.GetMinRealAverage(28),
+                Height = Application.GetMinRealAverage(28),
+                UnSelectedImagePath = "Public/AddIcon.png",
+            };
+            contentView.AddChidren(btnAddIcon);
+
+            btnAddIcon.MouseUpEventHandler += (sender, e) =>
+            {
+                Action<string> callBackAction = (floorName) =>
+                {
+                    callBack(floorName);
+                };
+                string newFloorName = "1F";
+                for (int i = 0; i < SpatialInfo.CurrentSpatial.FloorList.Count + 1;)
+                {
+                    newFloorName = ++i + "F";
+                    if (null == SpatialInfo.CurrentSpatial.FloorList.Find((obj) => obj.roomName == newFloorName))
+                    {
+                        break;
+                    }
+                }
+                var fs = new List<string>();
+                foreach (var f in SpatialInfo.CurrentSpatial.FloorList)
+                {
+                    fs.Add(f.roomName);
+                }
+                new PublicAssmebly().LoadDialog_EditParater(StringId.AddFloors, newFloorName, callBackAction, StringId.FloorNameCannotBeEmpty,
+                    StringId.AddFloorFailed_FloorAlreadyExist, fs);
+            };
+        }
+        /// <summary>
+        /// 鎴块棿绠$悊椤堕儴鏍�
+        /// </summary>
+        public void LoadTopView_RoomTopView(Action callBack)
+        {
+            LoadTopView();
+
+            var btnAddIcon = new Button()
+            {
+                X = Application.GetRealWidth(337),
+                Y = Application.GetRealHeight(29),
+                Width = Application.GetMinRealAverage(28),
+                Height = Application.GetMinRealAverage(28),
+                UnSelectedImagePath = "Public/AddIcon.png",
+            };
+            contentView.AddChidren(btnAddIcon);
+
+            btnAddIcon.MouseUpEventHandler += (sender, e) =>
+            {
+                callBack?.Invoke();
+            };
+        }
+        /// <summary>
+        /// 鎴愬憳椤堕儴鏍�
+        /// </summary>
+        public void LoadTopView_MemberTopView(Action callBack, Action action)
+        {
+            LoadTopView();
+            backAction = action;
+
+            var btnAddIcon = new Button()
+            {
+                X = Application.GetRealWidth(337),
+                Y = Application.GetRealHeight(29),
+                Width = Application.GetMinRealAverage(28),
+                Height = Application.GetMinRealAverage(28),
+                UnSelectedImagePath = "Public/AddIcon.png",
+            };
+            contentView.AddChidren(btnAddIcon);
+
+            btnAddIcon.MouseUpEventHandler += (sender, e) =>
+            {
+                addAction?.Invoke();
+            };
+        }
+        /// <summary>
+        /// 瀹夐槻涓績椤堕儴鏍�
+        /// </summary>
+        public void LoadTopView_ArmCenter(Action skipAction)//(Action callBack, Action action)
+        {
+            LoadTopView();
+            //backAction = action;
+
+            var btnAddIcon = new Button()
+            {
+                X = Application.GetRealWidth(337),
+                Y = Application.GetRealHeight(29),
+                Width = Application.GetMinRealAverage(28),
+                Height = Application.GetMinRealAverage(28),
+                UnSelectedImagePath = "FunctionIcon/ArmCenter/HistoryIcon.png",
+            };
+            contentView.AddChidren(btnAddIcon);
+
+            btnAddIcon.MouseUpEventHandler += (sender, e) =>
+            {
+                skipAction?.Invoke();
+            };
         }
     }
 }

--
Gitblit v1.8.0