From 54be52bc0ab6ce3207d421db4e5b05d14886b148 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 07 十一月 2023 16:46:53 +0800
Subject: [PATCH] UI优化
---
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAutomationListChoosePage.cs | 129 ++++++++++++++++++++++++++++++++++++++----
1 files changed, 116 insertions(+), 13 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAutomationListChoosePage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAutomationListChoosePage.cs
index 0d49714..16fa3e4 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAutomationListChoosePage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAutomationListChoosePage.cs
@@ -1,5 +1,6 @@
锘縰sing System;
using System.Collections.Generic;
+using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using HDL_ON.UI.UI2.Intelligence.Automation;
@@ -27,7 +28,7 @@
public void LoadPage()
{
this.bodyView.BackgroundColor = CSS_Color.MainBackgroundColor;
- var topView = new TopViewDiv(bodyView, "閫夋嫨鑷姩鍖�");
+ var topView = new TopViewDiv(bodyView,Language.StringByID( StringId.SelectAutomation));
topView.maginY = 10;
topView.LoadTopView();
@@ -35,6 +36,7 @@
{
Y = Application.GetRealHeight(74),
Height = Application.GetRealHeight(667-80),
+ ScrollEnabled = false,
};
bodyView.AddChidren(contentView);
@@ -192,21 +194,71 @@
var temp = scene.functions.Find((obj) => obj.sid == logicSid);
if (temp != null)
{
- temp.status.Clear();
+ var kv = temp.status.Find((obj) => obj.key == "enable");
+ if (kv != null)
+ {
+ kv.value = "true";
+ }
+ else
+ {
+ temp.status.Add(new SceneFunctionStatus()
+ {
+ key = "enable",
+ value = "true",
+ });
+ }
}
else
{
temp = new SceneFunction();
temp.type = "7";
temp.sid = logicSid;
+ temp.status.Add(new SceneFunctionStatus()
+ {
+ key = "enable",
+ value = "true"
+ });
scene.functions.Add(temp);
}
- temp.status.Add(new SceneFunctionStatus()
+ if (scene.userSceneId != null)
{
- key = "enable",
- value = "true"
- });
- refreshAction();
+ var waitPage = new Loading();
+ bodyView.AddChidren(waitPage);
+ waitPage.Start("");
+ new System.Threading.Thread(() => {
+ try
+ {
+ var code = scene.EditScene();
+ Application.RunOnMainThread(() =>
+ {
+ if (code == "0")
+ {
+ refreshAction();
+ }
+ else
+ {
+ IMessageCommon.Current.ShowErrorInfoAlter(code);
+ }
+ });
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() => {
+ if (waitPage != null)
+ {
+ waitPage.RemoveFromParent();
+ waitPage = null;
+ }
+ });
+ }
+ })
+ { IsBackground = true }.Start();
+ }
+ else
+ {
+ refreshAction();
+ }
};
btnOff.MouseUpEventHandler = (sender, e) =>
{
@@ -214,21 +266,72 @@
var temp = scene.functions.Find((obj) => obj.sid == logicSid);
if (temp != null)
{
- temp.status.Clear();
+ var kv = temp.status.Find((obj) => obj.key == "enable");
+ if (kv != null)
+ {
+ kv.value = "false";
+ }
+ else
+ {
+ temp.status.Add(new SceneFunctionStatus()
+ {
+ key = "enable",
+ value = "false",
+ });
+ }
}
else
{
temp = new SceneFunction();
temp.type = "7";
temp.sid = logicSid;
+ temp.status.Add(new SceneFunctionStatus()
+ {
+ key = "enable",
+ value = "false"
+ });
scene.functions.Add(temp);
}
- temp.status.Add(new SceneFunctionStatus()
+
+ if (scene.userSceneId != null)
{
- key = "enable",
- value = "false"
- });
- refreshAction();
+ var waitPage = new Loading();
+ bodyView.AddChidren(waitPage);
+ waitPage.Start("");
+ new System.Threading.Thread(() => {
+ try
+ {
+ var code = scene.EditScene();
+ Application.RunOnMainThread(() =>
+ {
+ if (code == "0")
+ {
+ refreshAction();
+ }
+ else
+ {
+ IMessageCommon.Current.ShowErrorInfoAlter(code);
+ }
+ });
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() => {
+ if (waitPage != null)
+ {
+ waitPage.RemoveFromParent();
+ waitPage = null;
+ }
+ });
+ }
+ })
+ { IsBackground = true }.Start();
+ }
+ else
+ {
+ refreshAction();
+ }
};
}
--
Gitblit v1.8.0