SVN r1232

SVN-Revision: r1232
This commit is contained in:
cyf
2026-06-24 02:03:46 +00:00
parent 2a743166ff
commit 20bf46bdd5
3 changed files with 50 additions and 8 deletions
+24 -3
View File
@@ -187,6 +187,25 @@ namespace Lskj.Control
}
}
private string GetMergeGroupValue(GridColumnModel model, DataRow row)
{
if (model == null || row == null || string.IsNullOrEmpty(model.MergeGroup)) return string.Empty;
string[] fields = model.MergeGroup.Trim(',').Split(',');
StringBuilder groupValue = new StringBuilder();
foreach (string item in fields)
{
string fieldName = (item + "").Trim();
if (string.IsNullOrEmpty(fieldName) || !row.Table.Columns.Contains(fieldName)) continue;
groupValue.Append(fieldName);
groupValue.Append("=");
groupValue.Append(row[fieldName] + "");
groupValue.Append("|");
}
return groupValue.ToString();
}
/// <summary>
/// <para>说明:重写设置表格颜色</para>
/// <para>创建人:王一帆</para>
@@ -1187,16 +1206,17 @@ namespace Lskj.Control
if (!string.IsNullOrEmpty(model.MergeGroup))
{
bool isMergrGroup = !string.IsNullOrEmpty(model.MergeGroup) && gridRow.Table.Columns.Contains(model.MergeGroup) && e.RowHandle != 0 ? (gridRow[model.MergeGroup] + "").Equals(BeforeGroupName) : false;
string currentGroupName = GetMergeGroupValue(model, gridRow);
bool isMergrGroup = !string.IsNullOrEmpty(currentGroupName) && e.RowHandle != 0 ? currentGroupName.Equals(BeforeGroupName) : false;
if (model.CanMerge && BeforeClass == Convert.ToDecimal(e.FieldValue) && isMergrGroup)
{
BeforeClass = Convert.ToDecimal(e.FieldValue);
BeforeGroupName = !string.IsNullOrEmpty(model.MergeGroup) && gridRow.Table.Columns.Contains(model.MergeGroup) ? gridRow[model.MergeGroup] + "" : "";
BeforeGroupName = currentGroupName;
}
else
{
BeforeClass = Convert.ToDecimal(e.FieldValue);
BeforeGroupName = !string.IsNullOrEmpty(model.MergeGroup) && gridRow.Table.Columns.Contains(model.MergeGroup) ? gridRow[model.MergeGroup] + "" : "";
BeforeGroupName = currentGroupName;
if (isSum || String.IsNullOrEmpty(model.SumCond)) customSum += Convert.ToDecimal(e.FieldValue);
}
}
@@ -1278,6 +1298,7 @@ namespace Lskj.Control
{
e.TotalValue = customSum;
BeforeClass = 0;
BeforeGroupName = "";
}
break;
}