wjc
2023-03-09 a0b77501012265c4638c9f49ccfd1e6cd0f71a45
HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -618,7 +618,24 @@
                        }
                    }
                    break;
                //萤石视频门锁
                case SPK.VideoDoorLock:
                    {
                        LogicView.FunTypeView view1 = new LogicView.FunTypeView();
                        view1.btnText.Text = "用户人员";// StringId.shipintonghuahujiao;
                        view1.btnText.Name = Language.StringByID(StringId.shipinmensuo);
                        fLayout.AddChidren(view1.FLayoutView());
                        view1.btnClick.MouseUpEventHandler += (sender, e) =>
                        {
                            this.VideoDoorLockAction(this, device, view1.btnState);
                        };
                        if (edit)
                        {
                            this.GetEditState(device, index, view1.btnState,null, null, null);
                        }
                    }
                    break;
            }
            #region  保存
            ///保存View
@@ -1075,6 +1092,52 @@
        }
        /// <summary>
        /// 萤石视频门锁专用(二级界面)
        /// </summary>
        /// <param name="frame">当前界面</param>
        /// <param name="device">当前设备</param>
        /// <param name="btnState">旧状态</param>
        public void VideoDoorLockAction(FrameLayout frame, Entity.Function device, Button btnState)
        {
            selectedState = device.spk + "_";
            Loading loading = new Loading();
            frame.AddChidren(loading);
            loading.Start();
            System.Threading.Tasks.Task.Run(() =>
            {
                try
                {
                    var userList = Send.Current.GetVideoDoorLockUserIdList(device.deviceId, true);
                    List<string> userIdList = new List<string>();
                    for (int i = 0; i < userList.Count; i++)
                    {
                        var user = userList[i];
                        userIdList.Add(user.userName);
                    }
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                        PublicInterface publicInterface = new PublicInterface();
                        publicInterface.FrameOrVv(this, userIdList, new List<string> { btnState.Text }, device.name, (index) =>
                        {
                            var userId = userIdList[index];
                            //界面显示选中值
                            btnState.Text = userId;
                            //数据封装
                            AddDictionary("open_type", "1", "integer");
                            AddDictionary("user_id", userId, "string");
                        }, false);
                    });
                }
                catch { }
            });
        }
        /// <summary>
        /// 显示编辑之前的设备状态
        /// </summary>
        /// <param name="device">编辑设备</param>