SVN-Revision: r606
This commit is contained in:
tdx
2025-05-19 04:15:08 +00:00
parent 53d0dda482
commit fbd52f7749
2 changed files with 47 additions and 20 deletions
+25 -15
View File
@@ -305,14 +305,24 @@ namespace Lskj.Control
if (condition.Contains("COLUMN_NAME")) if (condition.Contains("COLUMN_NAME"))
{ {
// 解析期望的列名 // 解析期望的列名
string expectedColumnName = condition.Split('=').Last().Trim('\''); string pattern = @"('{?COLUMN_NAME}'?\s*=\s*'[^']*')";
// 构建直接的列名比较 var matches = Regex.Matches(condition, pattern, RegexOptions.IgnoreCase);
cond = $"'{e.Column.Name}'='{expectedColumnName}'"; var results = new List<string>();
} foreach (Match match in matches)
else {
{ results.Add(match.Value);
cond = ReplaceHelper.ReplaceRowParam(gridRow, item["condition"] + "").ReplaceColumnParam(e.Column.Name, e.Column.Caption, e.CellValue + ""); }
string expectedColumnName = "";
if (results.Count > 0)
{
expectedColumnName = results[0].Split('=').Last().Trim('\'');
}
if (!expectedColumnName.Equals(e.Column.Name, StringComparison.OrdinalIgnoreCase))
{
continue;
}
} }
cond = ReplaceHelper.ReplaceRowParam(gridRow, item["condition"] + "").ReplaceColumnParam(e.Column.Name, e.Column.Caption, e.CellValue + "");
try try
{ {
if (!string.IsNullOrWhiteSpace(cond) && ReplaceHelper.EvalCond(cond) && (!string.IsNullOrEmpty(e.CellValue + "") || isLaterDatePresent)) if (!string.IsNullOrWhiteSpace(cond) && ReplaceHelper.EvalCond(cond) && (!string.IsNullOrEmpty(e.CellValue + "") || isLaterDatePresent))
@@ -2394,17 +2404,17 @@ namespace Lskj.Control
} }
} }
public void OnShowFilterPopupCheckedListBox(object sender, DevExpress.XtraGrid.Views.Grid.FilterPopupCheckedListBoxEventArgs e) public void OnShowFilterPopupCheckedListBox(object sender, DevExpress.XtraGrid.Views.Grid.FilterPopupCheckedListBoxEventArgs e)
{ {
try try
{ {
BandedGridView gridView = (BandedGridView)sender; BandedGridView gridView = (BandedGridView)sender;
string actStr = this.bandedGridView.ActiveFilterString;//获取筛选条件 string actStr = this.bandedGridView.ActiveFilterString;//获取筛选条件
string[] actStr_list = actStr.Split(new string[] { "And" }, StringSplitOptions.None); string[] actStr_list = actStr.Split(new string[] { "And" }, StringSplitOptions.None);
DataTable datatable = new DataTable(); DataTable datatable = new DataTable();
if ((!actStr_list[0].Contains(e.Column.FieldName) || (this.bandedGridView.OptionsView.ShowAutoFilterRow && e.Column.FilterInfo.Type == ColumnFilterType.AutoFilter)) && actStr != "") if ((!actStr_list[0].Contains(e.Column.FieldName) || (this.bandedGridView.OptionsView.ShowAutoFilterRow && e.Column.FilterInfo.Type == ColumnFilterType.AutoFilter)) && actStr != "")
{ {
@@ -2514,9 +2524,9 @@ namespace Lskj.Control
} }
if (!SystemInfo.Instance.DisableFilteringQuantity)
if (!SystemInfo.Instance.DisableFilteringQuantity)
{ {
DataTable filterTable = gridView.GetGridViewFilteredAndSortedDataToDataTable(); DataTable filterTable = gridView.GetGridViewFilteredAndSortedDataToDataTable();
DataRow[] dataRowArray = filterTable.Select(); DataRow[] dataRowArray = filterTable.Select();
@@ -2543,7 +2553,7 @@ namespace Lskj.Control
} }
//多表头在使用自带的搜索功能时(ctrl+f),筛选框无法过滤搜索后的内容,根据判断是否有搜索值去手动过滤 //多表头在使用自带的搜索功能时(ctrl+f),筛选框无法过滤搜索后的内容,根据判断是否有搜索值去手动过滤
bool isSearch = !string.IsNullOrWhiteSpace(gridView.FindFilterText); bool isSearch = !string.IsNullOrWhiteSpace(gridView.FindFilterText);
if (isSearch) if (isSearch)
{ {
e.CheckedComboBox.Items.Clear(); e.CheckedComboBox.Items.Clear();
for (int i = 0; i < _Items.Count; i++) for (int i = 0; i < _Items.Count; i++)
@@ -2554,7 +2564,7 @@ namespace Lskj.Control
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
+22 -5
View File
@@ -100,6 +100,7 @@ namespace Lskj.Control
//this.gcMain.OptionsBehavior.EnableFiltering = true; //this.gcMain.OptionsBehavior.EnableFiltering = true;
//this.gcMain.OptionsFind.AlwaysVisible = true; //this.gcMain.OptionsFind.AlwaysVisible = true;
} }
void gcMain_SelectionChanged(object sender, EventArgs e) void gcMain_SelectionChanged(object sender, EventArgs e)
{ {
//try //try
@@ -305,7 +306,7 @@ namespace Lskj.Control
TreeListNode treeListNode1 = this.gcMain.Nodes.TreeList.FindNodeByID(treeListNode.Id); TreeListNode treeListNode1 = this.gcMain.Nodes.TreeList.FindNodeByID(treeListNode.Id);
if (treeListNode1 != null) treeListNode1.Expanded = true; if (treeListNode1 != null) treeListNode1.Expanded = true;
} }
this.TreeListObj.FocusedNode = this.TreeListObj.GetNodeByVisibleIndex(lastNodeIndex);
if ((Expansion + "").Equals("1")) if ((Expansion + "").Equals("1"))
{ {
this.gcMain.ExpandAll(); this.gcMain.ExpandAll();
@@ -314,7 +315,10 @@ namespace Lskj.Control
{ {
this.gcMain.ExpandToLevel(0); this.gcMain.ExpandToLevel(0);
} }
this.TreeListObj.FocusedNode = this.TreeListObj.GetNodeByVisibleIndex(lastNodeIndex); else if ((Expansion + "").Equals("3"))
{
this.gcMain.CollapseAll();
}
//if (selectRowHandler) //if (selectRowHandler)
//{ //{
// this.TreeListObj.FocusedNode = this.TreeListObj.GetNodeByVisibleIndex(lastNodeIndex); // this.TreeListObj.FocusedNode = this.TreeListObj.GetNodeByVisibleIndex(lastNodeIndex);
@@ -2203,8 +2207,18 @@ namespace Lskj.Control
GetTreeExpanded(); GetTreeExpanded();
this.gcMain.DataSource = dataSet.Tables[0]; this.gcMain.DataSource = dataSet.Tables[0];
if ((Expansion + "").Equals("1"))
{
this.gcMain.ExpandAll();
}
else if ((Expansion + "").Equals("2"))
{
this.gcMain.ExpandToLevel(0);
}
else if ((Expansion + "").Equals("3"))
{
this.gcMain.CollapseAll();
}
return dataSet.Tables[0] != null ? dataSet.Tables[0].Rows.Count : 0; return dataSet.Tables[0] != null ? dataSet.Tables[0].Rows.Count : 0;
} }
/// <summary> /// <summary>
@@ -3043,12 +3057,15 @@ namespace Lskj.Control
} }
this.SetGridViewDataSource(table); this.SetGridViewDataSource(table);
} }
if ((Expansion + "").Equals("1")) if ((Expansion + "").Equals("1"))
{ {
this.gcMain.ExpandAll(); this.gcMain.ExpandAll();
} }
else if ((Expansion + "").Equals("2")) else if ((Expansion + "").Equals("2"))
{
this.gcMain.ExpandToLevel(0);
}
else if ((Expansion + "").Equals("3"))
{ {
this.gcMain.CollapseAll(); this.gcMain.CollapseAll();
} }