wxr
2023-04-21 666b28d77fc3c1b1dae61c9dfd878c8e683cef8c
HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs
@@ -156,6 +156,83 @@
        }
        /// <summary>
        /// 多选择
        /// </summary>
        /// <param name="frameLayout">父控件</param>
        /// <param name="list">显示数据源</param>
        /// <param name="titleText"></param>
        /// <param name="stateTextList">之前状态文本</param>
        /// <param name="action">返回索引值列表</param>
        /// <param name="textSize">显示文本字体大小</param>
        public void MultiSelectShow(FrameLayout frameLayout, List<Face> list, string titleText, string stateTexts, Action<List<int>> action, int textSize = LogicView.TextSize.text14)
        {
            LogicView.DateView view = new LogicView.DateView();
            view.btnTitle.Text = titleText;
            view.FLayoutView(frameLayout, list.Count);
            view.btnCancel.MouseUpEventHandler += (sender, e) =>
            {
                //移除fLayout界面
                view.frameLayout.RemoveFromParent();
            };
            List<int> intList = new List<int>();
            for (int i = 0; i < list.Count; i++)
            {
                var  face= list[i];
                LogicView.CheckView checkView = new LogicView.CheckView();
                checkView.frameLayout.Y = Application.GetRealHeight(56 + 50 * i);
                checkView.btnText.TextSize = textSize;
                view.frameLayout.AddChidren(checkView.FLayoutView());
                checkView.btnText.Text = face.userName;
                checkView.btnClick.Tag = i;//标记
                if (stateTexts.Contains(face.userId))
                {
                    //显示之前的选中状态
                    checkView.btnCheckIcon.IsSelected = true;
                    intList.Add(i);
                }
                //点击事件
                checkView.btnClick.MouseUpEventHandler += (sender1, e1) =>
                {
                    int clickIndex =int.Parse(checkView.btnClick.Tag.ToString());
                    checkView.btnClick.IsSelected = !checkView.btnClick.IsSelected;
                    if (checkView.btnClick.IsSelected)
                    {
                        checkView.btnCheckIcon.IsSelected = true;
                        if (!intList.Contains(clickIndex))
                        {
                            //添加选中数据
                            intList.Add(clickIndex);
                        }
                    }
                    else
                    {
                        checkView.btnCheckIcon.IsSelected = false;
                        if (intList.Contains(clickIndex))
                        {
                            //移除选中数据
                            intList.Remove(clickIndex);
                        }
                    }
                };
            }
            view.btnConfirm.MouseUpEventHandler += (sender1, e1) =>
            {
                if (intList.Count == 0)
                {
                    return;
                }
                action(intList);
                //移除fLayout界面
                view.frameLayout.RemoveFromParent();
            };
        }
        /// <summary>
        /// 月-多选择
        /// </summary>
        /// <param name="frameLayout">父控件</param>