wxr
2021-01-14 d987694e57c3bce76bd5a208d74a3696db222a4a
HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
@@ -538,21 +538,20 @@
            Dictionary<string, string> dic = new Dictionary<string, string>();
            LogicMethod.dictionary(dic, "key", KeyValue);
            LogicMethod.dictionary(dic, "value", selectedValue);
            AddDictionaryList(KeyValue, dic, dicSateteList);
            AddDictionaryList(KeyValue, dic);
        }
        /// <summary>
        /// 更新数据列表
        /// </summary>
        /// <param name="keyValue">设备属性值,云雀上定义好的</param> 
        /// <param name="dictionary">选中数据</param>
        /// <param name="dicList">存储数据列表</param>
        /// <param name="dictionary">添加选中数据</param>
        /// <returns></returns>
        private void AddDictionaryList(string keyValue, Dictionary<string, string> dictionary, List<Dictionary<string, string>> dicList)
        private void AddDictionaryList(string keyValue, Dictionary<string, string> dictionary)
        {
            int indexValue = -1;
            for (int i = 0; i < dicList.Count; i++)
            for (int i = 0; i < dicSateteList.Count; i++)
            {
                var dic = dicList[i];
                var dic = dicSateteList[i];
                if (dic.ContainsValue(keyValue))
                {
                    //判断是否存在
@@ -564,14 +563,14 @@
            if (indexValue != -1)
            {
                //存在移除
                dicList.RemoveAt(indexValue);
                dicSateteList.RemoveAt(indexValue);
                //重新添加
                dicList.Insert(indexValue, dictionary);
                dicSateteList.Insert(indexValue, dictionary);
            }
            else
            {
                //新添加
                dicList.Add(dictionary);
                dicSateteList.Add(dictionary);
            }
        }