From 6fe1c5ebeb8312edc479a4576f05d80c5051a6c6 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 19 七月 2023 19:47:00 +0800
Subject: [PATCH] 炫彩功能优化

---
 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs |   32 +++++++++++++++++++++++---------
 1 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
index f70fc3b..a85c1ea 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
@@ -98,6 +98,7 @@
 
         public void LoadPage(Action backRefresh)
         {
+             //DB_ResidenceData.Instance.sceneChooseRoomId
             new TopViewDiv(bodyView, Language.StringByID(StringId.EditScene)).LoadTopView(backRefresh);
             initPage();
         }
@@ -432,14 +433,17 @@
                     var pack = pm.GetSceneInfo(scene.userSceneId);
                     if (pack.Code == StateCode.SUCCESS)
                     {
-                        var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString());
-                        var tempScene = sceneList.Find((obj) => obj.userSceneId == scene.userSceneId);
-                        if (tempScene != null)
+                        if (pack.Data != null)
                         {
-                            scene.name = tempScene.name;
-                            scene.delay = tempScene.delay;
-                            scene.roomIds = tempScene.roomIds;
-                            scene.functions = tempScene.functions;
+                            var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString());
+                            var tempScene = sceneList.Find((obj) => obj.userSceneId == scene.userSceneId);
+                            if (tempScene != null)
+                            {
+                                scene.name = tempScene.name;
+                                scene.delay = tempScene.delay;
+                                scene.roomIds = tempScene.roomIds;
+                                scene.functions = tempScene.functions;
+                            }
                         }
                         Application.RunOnMainThread(() =>
                         {
@@ -481,6 +485,13 @@
                     scene.functions.Remove(scenefunction);
                     continue;
                 }
+                //灏唖pk瀹炰綋閲岄潰鐨刴in max鍊兼斁鍏ュ満鏅姛鑳藉疄浣撻噷锛岃涓嶇劧鏁版嵁浼氫涪澶� 2022-06-21 16:06:45
+                foreach (var tt in scenefunction.status) {
+                    tt.min = scenefunction.localFunction.GetAttribute(tt.key).min;
+                    tt.max = scenefunction.localFunction.GetAttribute(tt.key).max;
+                    tt.valueList = scenefunction.localFunction.GetAttribute(tt.key).value;
+                }
+
                 i++;
                 var row = new RowLayout()
                 {
@@ -563,14 +574,17 @@
 
                 EventHandler<MouseEventArgs> skipEvent = (sender, e) =>
                 {
-                    var ssf = new SceneFunctionInfoEditPage(scene, scenefunction.localFunction.ConvertSceneFunction(), refreshFunctionRowAction);
+                    var ssf = new SceneFunctionInfoEditPage(scene, scenefunction, refreshFunctionRowAction);
                     MainPage.BasePageView.AddChidren(ssf);
                     ssf.LoadPage();
                     MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                 };
                 btnFunctionName.MouseUpEventHandler = skipEvent;
                 btnFunctionFloorAndRoom.MouseUpEventHandler = skipEvent;
-
+                btnFunctionDelayInfo.MouseUpEventHandler = skipEvent;
+                btnFunctionInfo.MouseUpEventHandler = skipEvent;
+                btnRight.MouseUpEventHandler = skipEvent;
+                row.MouseUpEventHandler = skipEvent;
 
                 Button btnDelSceneFunction = new Button() {
                     BackgroundColor = CSS_Color.WarningColor,

--
Gitblit v1.8.0