From 1d1cad99a27c9f644c84eb3d376c70bd30a55879 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 10 三月 2021 18:02:13 +0800
Subject: [PATCH] 2021-3-10-1

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs |   35 +++++++++++++++++++++++++++--------
 1 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
index 1b58afe..7f35847 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
@@ -242,7 +242,7 @@
                         X = Application.GetRealWidth(311 + 16 - (40 + 100)),
                         Width = Application.GetRealWidth(100),
                         Height = Application.GetRealHeight(17),
-                        Text = j.ToString(),
+                        Text = Intelligence.Automation.LogicMethod.GetGetRoomName(control),
                         TextAlignment = TextAlignment.CenterRight,
                         TextSize = TextSize.text12,
                         TextColor = CSS.CSS_Color.textCancelColor,
@@ -318,6 +318,10 @@
                                             if (function != null)
                                             {
                                                 pirDevice.FunctioList.Remove(Function);
+                                                if (Pir.currPir != null && pirDevice.sid == Pir.currPir.sid)
+                                                {
+                                                    Pir.currPir.FunctioList = pirDevice.FunctioList;
+                                                }
                                             }
                                             UIView(vv);
                                         }
@@ -336,6 +340,23 @@
                         })
                         { IsBackground = true }.Start();
                     };
+                    EventHandler<MouseEventArgs> editClick = (sender, e) =>
+                    {
+                        EditControl editControl = new EditControl();
+                        MainPage.BasePageView.AddChidren(editControl);
+                        editControl.Show(control, pirDevice, (device) =>
+                        {
+                            //鍥炶皟鏇存柊鍚嶅瓧/鍖哄煙
+                            nameBtn.Text = device.name;
+                            areaBtn.Text = Intelligence.Automation.LogicMethod.GetGetRoomName(device);
+
+                        });
+                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                    };
+                    funControlRow.MouseUpEventHandler += editClick;
+                    nameBtn.MouseUpEventHandler += editClick;
+                    areaBtn.MouseUpEventHandler += editClick;
+                    nextIconBtn.MouseUpEventHandler += editClick;
                 }
 
 
@@ -362,8 +383,8 @@
                     {
                         list.Add(Pir.pirDeviceList[b].name);
                     }
-                    TipPopView tipPopView = new TipPopView();
-                    tipPopView.InputBox(StringId.xiugaimingzi, pirclick.name, StringId.nameNull, StringId.NameAlreadyExists, list, (name, view) =>
+                    Method methodView = new Method(); 
+                    methodView.EditControlName(StringId.xiugaimingzi, list, pirclick.name, (name, view) =>
                     {
                         pirclick.name = name;
                         //鍔犺浇log
@@ -375,7 +396,7 @@
                         {
                             try
                             {
-                                responsePackNew = PirSend.DeviceRename(pirclick);
+                                responsePackNew = PirSend.DeviceRename(pirclick.deviceId, pirclick.name);
                             }
                             catch { }
                             finally
@@ -399,11 +420,9 @@
 
                         })
                         { IsBackground = true }.Start();
-
-                    }, () =>
-                    {
+                    },()=> {
                         NewSwitchView(pirclick, vv);
-                    }, false);
+                    },false);
 
                 }
                 else

--
Gitblit v1.8.0