SVN-Revision: r814
This commit is contained in:
tdx
2025-07-01 03:27:34 +00:00
parent b42e4e2df0
commit 223d0cf844
3 changed files with 14 additions and 30 deletions
+7 -2
View File
@@ -223,6 +223,11 @@ namespace Lskj.Control
/// </summary>
public DynamicModel Model;
/// <summary>
/// 系统模块实体对象
/// </summary>
/// <value>The system model.</value>
public ModuleModel SysModel { get; set; }
/// <summary>
/// 合计弹出浮窗
/// </summary>
public SumPanelControl sumPanel;
@@ -5187,10 +5192,10 @@ namespace Lskj.Control
object _objData = null;
IDataObject dataObj = Clipboard.GetDataObject();
bool IsNewPost = SysModel != null ? SysModel.IsNewPost : false;
if (dataObj.GetDataPresent(DataFormats.Text))
_objData = dataObj.GetData(DataFormats.Text);
if (SystemInfo.Instance.IsOldPost || (this.Tag != null && this.Tag.ToString() == "IsOldPost"))
if ((!IsNewPost && SystemInfo.Instance.IsOldPost) || (this.Tag != null && this.Tag.ToString() == "IsOldPost"))
{
OldPasteMethod(e, _objData);
}
+6 -28
View File
@@ -862,6 +862,7 @@ namespace Lskj.Control
private void InitializeGridView()
{
this.gcMain.Model = this.Model;
this.gcMain.SysModel = this.SysModel;
Dictionary<object, Hashtable> dataCaches = Model != null ? Model.DataCaches : null;
//显示筛选行
if (this.SysModel.LoadFilter) this.gcMain.GridView.OptionsView.ShowAutoFilterRow = true;
@@ -871,6 +872,7 @@ namespace Lskj.Control
this.panelControl1.Controls.Clear();
this.gcMain = new TreeBandedGridControlEx() { Expansion = SysModel.TreeTableExpand };
this.gcMain.Model = this.Model;
this.gcMain.SysModel = this.SysModel;
this.gcMain.Dock = DockStyle.Fill;
if (this._gridColumns.Rows.Count == 0 && !string.IsNullOrWhiteSpace(SysModel.TreeKeyFieldName) && !string.IsNullOrWhiteSpace(SysModel.TreeParentFieldName))
{
@@ -891,6 +893,7 @@ namespace Lskj.Control
this.gcMain = new BandedGridControlEx();
(this.gcMain as BandedGridControlEx).moduleModel = this.SysModel;
this.gcMain.Model = this.Model;
this.gcMain.SysModel = this.SysModel;
this.gcMain.Dock = DockStyle.Fill;
this.panelControl1.Controls.Add(this.gcMain);
if (this.SysModel.LoadFilter) (this.gcMain as BandedGridControlEx).GridView.OptionsView.ShowAutoFilterRow = true;
@@ -902,6 +905,7 @@ namespace Lskj.Control
this.panelControl1.Controls.Clear();
this.gcMain = new TreeGridControlEx() { Expansion = SysModel.TreeTableExpand };
this.gcMain.Model = this.Model;
this.gcMain.SysModel = this.SysModel;
this.gcMain.Dock = DockStyle.Fill;
if (this._gridColumns.Rows.Count == 0 && !string.IsNullOrWhiteSpace(SysModel.TreeKeyFieldName) && !string.IsNullOrWhiteSpace(SysModel.TreeParentFieldName))
{
@@ -919,6 +923,7 @@ namespace Lskj.Control
BandedGridControlEx bandedGridControlEx = new BandedGridControlEx();
bandedGridControlEx.moduleModel = this.SysModel;
bandedGridControlEx.Model = this.Model;
bandedGridControlEx.SysModel = this.SysModel;
bandedGridControlEx.Dock = DockStyle.Fill;
// 明确设置禁止自动调整列宽
bandedGridControlEx.BandedView.OptionsView.ColumnAutoWidth = false;
@@ -5556,31 +5561,4 @@ namespace Lskj.Control
// 获取字体和最大宽度
Document document = richEdit.Document;
Font font = richEdit.Font;
int maxWidth = richEdit.ClientSize.Width - richEdit.Padding.Horizontal;
// 获取前3行文本
string[] lines = richEdit.Text.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
int lineCount = Math.Min(4, lines.Length);
string firstThreeLines = string.Join(Environment.NewLine, lines.Take(lineCount));
// 创建StringFormat
StringFormat format = new StringFormat(StringFormat.GenericTypographic);
format.FormatFlags |= StringFormatFlags.MeasureTrailingSpaces;
// 测量文本高度
using (Graphics g = richEdit.CreateGraphics())
{
SizeF textSize = g.MeasureString(
firstThreeLines,
font,
maxWidth,
format
);
return (int)Math.Ceiling(textSize.Height);
}
}
}
}
+1
View File
@@ -954,6 +954,7 @@ namespace Lskj.Control
gridEx.Tag = detailModel;
gridEx.Parent = plMain;
gridEx.Model = this.Model;
gcMain.SysModel = this.SysModel;
gridEx.SetReadOnlyColumns(detailModel.GridColumns, detailModel.GridCustomColumnKey);
gridEx.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(detailModel.FormKey), this.Model);