mac
2024-07-25 f9181a9c8125136f597add7c30cb2ff508d54ba7
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
@@ -481,7 +481,6 @@
        void LoadFunctionRow()
        {
            functionListView.RemoveAll();
            functionListView.Height = Application.GetRealWidth(65 * scene.functions.Count);
            for(int i =0;i<scene.functions.Count;)
            {
                var scenefunction = scene.functions[i];
@@ -490,6 +489,7 @@
                    scene.functions.Remove(scenefunction);
                    continue;
                }
                functionListView.Height = Application.GetRealWidth(65 * scene.functions.Count);
                try
                {
                    //将spk实体里面的min max值放入场景功能实体里,要不然数据会丢失 2022-06-21 16:06:45
@@ -821,13 +821,21 @@
            btnOn.MouseUpEventHandler = (sender, e) =>
            {
                dialog.Close();
                temp = new SceneFunction();
                temp.type = "7";
                temp.status.Add(new SceneFunctionStatus()
                var kv = temp.status.Find((obj) => obj.key == "enable");
                if (kv != null)
                {
                    key = "enable",
                    value = "true"
                });
                    kv.value = "true";
                }
                else
                {
                    temp.status.Add(new SceneFunctionStatus()
                    {
                        key = "enable",
                        value = "true",
                    });
                }
                var waitPage = new Loading();
                bodyView.AddChidren(waitPage);
                waitPage.Start("");
@@ -840,6 +848,10 @@
                            if (code == "0")
                            {
                                btnTipText.TextID = StringId.OpenArm;
                            }
                            else
                            {
                                IMessageCommon.Current.ShowErrorInfoAlter(code);
                            }
                        });
                    }
@@ -860,13 +872,21 @@
            btnOff.MouseUpEventHandler = (sender, e) =>
            {
                dialog.Close();
                temp = new SceneFunction();
                temp.type = "7";
                temp.status.Add(new SceneFunctionStatus()
                var kv = temp.status.Find((obj) => obj.key == "enable");
                if (kv != null)
                {
                    key = "enable",
                    value = "false"
                });
                    kv.value = "false";
                }
                else
                {
                    temp.status.Add(new SceneFunctionStatus()
                    {
                        key = "enable",
                        value = "false",
                    });
                }
                var waitPage = new Loading();
                bodyView.AddChidren(waitPage);
@@ -880,6 +900,10 @@
                            if (code == "0")
                            {
                                btnTipText.TextID = StringId.Close;
                            }
                            else
                            {
                                IMessageCommon.Current.ShowErrorInfoAlter(code);
                            }
                        });
                    }
@@ -948,11 +972,22 @@
        void LoadEvent_ChangeFunctionList()
        {
            btnAddFunctionTitle.MouseUpEventHandler = (sender, e) => {
                //var sefp =new SceneFunctionListChoosePage(scene,refreshFunctionRowAction);
                var sefp = new SceneTargetTypeChoosePage(scene, refreshFunctionRowAction);
                MainPage.BasePageView.AddChidren(sefp);
                sefp.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                if (DB_ResidenceData.Instance.HomeGateway.isSupportSceneEnableAutomation)
                {
                    //var sefp =new SceneFunctionListChoosePage(scene,refreshFunctionRowAction);
                    var sefp = new SceneTargetTypeChoosePage(scene, refreshFunctionRowAction);
                    MainPage.BasePageView.AddChidren(sefp);
                    sefp.LoadPage();
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                }
                else
                {
                    var sefp = new SceneFunctionListChoosePage(scene,refreshFunctionRowAction);
                    //var sefp = new SceneTargetTypeChoosePage(scene, refreshFunctionRowAction);
                    MainPage.BasePageView.AddChidren(sefp);
                    sefp.LoadPage();
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                }
            };
        }