Browse Source

清洁度BUG修复推送

zhangjiaxin 4 weeks ago
parent
commit
8dc8847e07
1 changed files with 36 additions and 11 deletions
  1. 36 11
      OTSIncAReportApp/1-UI/OTSReportExport/RuleGroupSelector.cs

+ 36 - 11
OTSIncAReportApp/1-UI/OTSReportExport/RuleGroupSelector.cs

@@ -72,6 +72,9 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
 			{
 				if (isMouseDown)
 				{
+					// 获取点击位置的项索引
+					int index = checkedListBox1.IndexFromPoint(e.Location);
+
 					for (int i = 0; i < checkedListBox2.Items.Count; i++)
 					{
 						if (checkedListBox2.GetItemChecked(i))
@@ -84,12 +87,6 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
 						}
 					}
 
-
-
-
-					// 获取点击位置的项索引
-					int index = checkedListBox1.IndexFromPoint(e.Location);
-
 					if (index == -1)
 					{ return; }
 					listIndex = index;
@@ -103,7 +100,6 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
 							{
 								checkedListBox2.Items.Add(List_RuleTable[listIndex].Rows[a]["StrName"]);
 							}
-
 							for (int a = 0; a < List_RuleTable[listIndex].Rows.Count; a++)
 							{
 								if (List_RuleTable[listIndex].Rows[a]["display"].ToString() == "0")
@@ -115,6 +111,35 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
 									checkedListBox2.SetItemChecked(a, true);
 								}
 							}
+							//if (checkedListBox2.GetItemChecked(listIndex))
+							//{
+							//	for (int a = 0; a < List_RuleTable[listIndex].Rows.Count; a++)
+							//	{
+							//		//if (List_RuleTable[listIndex].Rows[a]["display"].ToString() == "0")
+							//		//{
+							//		//	checkedListBox2.SetItemChecked(a, false);
+							//		//}
+							//		//else
+							//		//{
+							//		checkedListBox2.SetItemChecked(a, true);
+							//		//}
+							//	}
+							//}
+							//else
+							//{
+							//	for (int a = 0; a < List_RuleTable[listIndex].Rows.Count; a++)
+							//	{
+							//		//if (List_RuleTable[listIndex].Rows[a]["display"].ToString() == "0")
+							//		//{
+							//			checkedListBox2.SetItemChecked(a, false);
+							//		//}
+							//		//else
+							//		//{
+							//		//	checkedListBox2.SetItemChecked(a, true);
+							//		//}
+							//	}
+							//}
+
 						}
 					}
 				}
@@ -253,10 +278,10 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
 						cb2 = true;
 				}
 				isMouseDown = false;
-				if (!cb2)
-					checkedListBox1.SetItemChecked(listIndex, false);
-				else
-					checkedListBox1.SetItemChecked(listIndex, true);
+				//if (!cb2)
+				//	checkedListBox1.SetItemChecked(listIndex, false);
+				//else
+				//	checkedListBox1.SetItemChecked(listIndex, true);
 
 				isMouseDown = true;
 			}