From e88c56e0992f65bac7552d1c42898988dbd79930 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期三, 30 七月 2025 15:04:39 +0800
Subject: [PATCH] 生产bug
---
DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs | 41 ++++++++++++++++++++++++++---------------
1 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs b/DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs
index 9b53c8c..352f8b2 100644
--- a/DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs
+++ b/DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs
@@ -6,7 +6,6 @@
using System;
using System.Collections.Generic;
using System.Data;
-using System.Text;
using System.Windows.Forms;
@@ -14,31 +13,31 @@
{
public partial class UcDictionarySelect : DevExpress.XtraEditors.XtraForm
{
- private List<string> lstCheckedKeyID = new List<string>();//閫夋嫨灞�ID闆嗗悎
+ private List<dynamic> lstCheckedKeyID = new List<dynamic>();//閫夋嫨闆嗗悎
string strTitle = "";
string strWhere = "";
public UcDictionarySelect(string _strTitle, string _strWhere)
{
InitializeComponent();
- tlMenu.CustomDrawNodeCheckBox += TreeList1_CustomDrawNodeCheckBox;
- getTree();
- tlMenu.OptionsBehavior.Editable = true;
- tlMenu.OptionsSelection.EnableAppearanceFocusedCell = false;
- tlMenu.OptionsSelection.MultiSelect = true;
- tlMenu.OptionsSelection.MultiSelectMode = TreeListMultiSelectMode.CellSelect;
this.strTitle = _strTitle;
this.strWhere = _strWhere;
this.Text = _strTitle;
+ getTree();
+ tlMenu.CustomDrawNodeCheckBox += TreeList1_CustomDrawNodeCheckBox;
+ // tlMenu.OptionsBehavior.Editable = true;
+ tlMenu.OptionsSelection.EnableAppearanceFocusedCell = false;
+ // tlMenu.OptionsSelection.MultiSelect = true;
+ // tlMenu.OptionsSelection.MultiSelectMode = TreeListMultiSelectMode.CellSelect;
btnIn.Click += (s, e) =>
{
findOrigin(tlMenu);
var list = new List<dynamic>();
- foreach (string key in lstCheckedKeyID)
+ foreach (dynamic key in lstCheckedKeyID)
{
list.Add(new
{
- // dicCode = "001",
- dicTxt = key
+ dicCode = key.dicCode,
+ dicTxt = key.dicTxt
});
};
UpdateParent?.Invoke(this, new UpdateParentEventArgs { DynamicList = list });
@@ -84,7 +83,8 @@
/// </summary>
private void getTree()
{
- var pgq = new PageQueryModel(1, 999999, "a.defect_name");
+ string _where = " and 1=1 and a.type1=1 and " + this.strWhere;
+ var pgq = new PageQueryModel(1, 999999, "a.defect_name", "asc", "", _where);
var json = JsonConvert.SerializeObject(pgq);
try
{
@@ -101,6 +101,7 @@
// tlMenu.OptionsBehavior.Editable = true;
tlMenu.OptionsBehavior.AllowRecursiveNodeChecking = false;
tlMenu.BestFitColumns();
+ tlMenu.ExpandAll();
}
catch (Exception ex)
{
@@ -125,20 +126,30 @@
if (drv != null)
{
string KeyFieldName = (string)drv["defectName"];
- lstCheckedKeyID.Add(KeyFieldName);
+ string dicCode = (string)drv["defectCode"];
+ lstCheckedKeyID.Add(new
+ {
+ dicCode = dicCode,
+ dicTxt = KeyFieldName
+ });
}
}
return;//閫掑綊缁堟
}
foreach (TreeListNode node in parentNode.Nodes)
{
- if (node.CheckState == CheckState.Checked)
+ if (node.CheckState == CheckState.Checked && parentNode.Nodes.Count == 0)
{
DataRowView drv = tlMenu.GetDataRecordByNode(node) as DataRowView;//鍏抽敭浠g爜锛屽氨鏄笉鐭ラ亾鏄繖鏍疯幏鍙栨暟鎹�岀籂缁撲簡寰堜箙(楝肩煡閬撳彲浠ヨ浆鎹负DataRowView鍟�)
if (drv != null)
{
string KeyFieldName = (string)drv["defectName"];
- lstCheckedKeyID.Add(KeyFieldName);
+ string dicCode = (string)drv["defectCode"];
+ lstCheckedKeyID.Add(new
+ {
+ dicCode = dicCode,
+ dicTxt = KeyFieldName
+ });
}
}
GetCheckedKeyID(node);
--
Gitblit v1.9.3