SVN r846
SVN-Revision: r846
This commit is contained in:
@@ -226,7 +226,7 @@ namespace Lskj.Control
|
||||
/// 系统模块实体对象
|
||||
/// </summary>
|
||||
/// <value>The system model.</value>
|
||||
public ModuleModel SysModel { get; set; }
|
||||
public ModuleModel SysModel { get; set; }
|
||||
/// <summary>
|
||||
/// 合计弹出浮窗
|
||||
/// </summary>
|
||||
@@ -5572,7 +5572,7 @@ namespace Lskj.Control
|
||||
GridColumn col = gridView.VisibleColumns[_colNumber];
|
||||
GridColumnModel model = col.Tag as GridColumnModel;
|
||||
|
||||
if (model != null&& !model.ProhibitPaste && (model.CanCopy || ((gridView.OptionsBehavior.Editable) && (gridView.VisibleColumns[_colNumber].OptionsColumn.AllowEdit)))) //if ((gridView.OptionsBehavior.Editable) && (gridView.VisibleColumns[_colNumber].OptionsColumn.AllowEdit))
|
||||
if (model != null && !model.ProhibitPaste && (model.CanCopy || ((gridView.OptionsBehavior.Editable) && (gridView.VisibleColumns[_colNumber].OptionsColumn.AllowEdit)))) //if ((gridView.OptionsBehavior.Editable) && (gridView.VisibleColumns[_colNumber].OptionsColumn.AllowEdit))
|
||||
{
|
||||
// 返回ID类型特殊处理
|
||||
string cellValue = _arrayStr2[j];
|
||||
@@ -6293,7 +6293,7 @@ namespace Lskj.Control
|
||||
DataRow rowItem = dataRows.Count() > 0 ? dataRows[0] : this.gridView.GetFocusedDataRow();
|
||||
if (model.FieldType == ControlType.LabAutoGridValueParam || model.FieldType == ControlType.LabAutoGridTextParam || model.FieldType == ControlType.LabAutoCompleteTextParam || model.FieldType == ControlType.LabAutoCompleteValueParam)
|
||||
{
|
||||
if (model != null && (rowItem != null|| this.ParentControl != null))
|
||||
if (model != null && (rowItem != null || this.ParentControl != null))
|
||||
{
|
||||
string sqlValue = model.SqlSource;
|
||||
|
||||
@@ -6301,15 +6301,15 @@ namespace Lskj.Control
|
||||
sqlValue = this.ParentControl.ReplaceParentControlValue(sqlValue);
|
||||
sqlValue = sqlValue.Replace("#", "");
|
||||
|
||||
if (rowItem != null)
|
||||
if (rowItem != null)
|
||||
{
|
||||
sqlValue = ReplaceHelper.ReplaceRowParam(rowItem, sqlValue);
|
||||
}
|
||||
|
||||
|
||||
DataTable table = MainImpl.GetDataTableResult(sqlValue);
|
||||
edit.Properties.DataSource = table;
|
||||
|
||||
|
||||
|
||||
|
||||
string[] columnsWidth = model != null ? model.LookUpFieldsWidth.Trim().TrimEnd(',').Split(',') : null;
|
||||
if (model != null && !string.IsNullOrWhiteSpace(model.LookUpFieldsWidth) && columnsWidth.Length > 0)
|
||||
@@ -7127,7 +7127,7 @@ namespace Lskj.Control
|
||||
bandedGridControlEx.BandedView.Columns.Clear();
|
||||
|
||||
// 保留其他非聚合列
|
||||
List<GridColumnModel> normalColumns = ColumnList.Where(o => o.IsCustomGroupField == 0|| o.IsCustomGroupField == 3).ToList();
|
||||
List<GridColumnModel> normalColumns = ColumnList.Where(o => o.IsCustomGroupField == 0 || o.IsCustomGroupField == 3).ToList();
|
||||
|
||||
// 创建正常列的Band
|
||||
GridBand normalBand = new GridBand() { Caption = "基本信息" };
|
||||
@@ -7169,7 +7169,7 @@ namespace Lskj.Control
|
||||
var dynamicHeaders = originalDataSource.AsEnumerable()
|
||||
.Select(r => r.Field<string>(GroupFieldprimary.FieldName))
|
||||
.Distinct().Where(x => !string.IsNullOrEmpty(x)).ToList();
|
||||
|
||||
|
||||
// 为每个动态表头生成GridBand,并添加子列
|
||||
foreach (string headerName in dynamicHeaders)
|
||||
{
|
||||
@@ -7254,7 +7254,7 @@ namespace Lskj.Control
|
||||
// 动态列:统一 string
|
||||
foreach (string h in headers)
|
||||
foreach (var s in subCols)
|
||||
dt.Columns.Add($"{h}_{s.FieldName}", typeof(string));
|
||||
dt.Columns.Add($"{h}_{s.FieldName}", original.Columns[s.FieldName].DataType);
|
||||
|
||||
/* ============ 2. 分组聚合 ============ */
|
||||
foreach (var grp in original.AsEnumerable().GroupBy(r => r[keyCol.FieldName]))
|
||||
@@ -8823,30 +8823,4 @@ namespace Lskj.Control
|
||||
{
|
||||
// 只处理列名可解析成日期的列
|
||||
if (!DateTime.TryParse(col.FieldName, out _))
|
||||
continue;
|
||||
|
||||
// 取 “Sum” 合计
|
||||
var sumItem = col.Summary
|
||||
.OfType<GridColumnSummaryItem>()
|
||||
.FirstOrDefault(s => s.SummaryType == SummaryItemType.Sum);
|
||||
|
||||
bool needRed = false;
|
||||
|
||||
if (sumItem?.SummaryValue != null &&
|
||||
decimal.TryParse(sumItem.SummaryValue.ToString(), out var colSum) &&
|
||||
jhrowitem.Table.Columns.Contains(col.FieldName) &&
|
||||
decimal.TryParse(jhrowitem[col.FieldName].ToString(), out var planVal))
|
||||
{
|
||||
needRed = (colSum != planVal);
|
||||
}
|
||||
|
||||
// 只改表头文字颜色
|
||||
col.AppearanceHeader.ForeColor = needRed ? Color.Red : Color.Black;
|
||||
col.AppearanceHeader.Options.UseForeColor = true;
|
||||
}
|
||||
// 立刻刷新表头
|
||||
gridView.Invalidate();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user