SVN-Revision: r924
This commit is contained in:
cyf
2025-08-07 09:29:22 +00:00
parent f7a53010be
commit e6ec3e4886
27 changed files with 4288 additions and 277 deletions
+73 -7
View File
@@ -498,6 +498,7 @@ namespace Lskj.Control
//this.SearchObj.preSearchVerification += new PreSearchVerification(OnPreSearchVerification);// 查询条件执行前
this.SearchObj.OnSearchBeforeCallBack += new SearchEventHandler(OnSearchBeforeCallBack);// 查询条件执行前
this.SearchObj.OnSearchAfterCallBack += new EventHandler(OnSearchAfterCallBack);// 查询条件执行后
this.SearchObj.TreeExactQuery = this.TreeExactQuery;
// 明细表格默认不查询
this.SearchObj.OnDataSourceBindCallBack += new EventHandler(OnMainSearchDataSourceBindCallBack);// 数据源绑定完成触发
@@ -891,6 +892,12 @@ namespace Lskj.Control
//父节点编号
(this.gcMain as TreeBandedGridControlEx).TreeListObj.ParentFieldName = SysModel.TreeParentFieldName;
}
if (this.SysModel.GridObjIsCheck == 1)//主表加载复选框
{
GridDragGrid.TreeListAddCheckBox((this.gcMain as TreeBandedGridControlEx).TreeListObj);
}
this.panelControl1.Controls.Add(this.gcMain);
}
else if (this.Model.GridEnumObj == GridEnum.BandedGridView || SysModel.AutoMultiHeader == 1)
@@ -924,6 +931,14 @@ namespace Lskj.Control
//父节点编号
(this.gcMain as TreeGridControlEx).TreeListObj.ParentFieldName = SysModel.TreeParentFieldName;
}
if (this.SysModel.GridObjIsCheck == 1)//主表加载复选框
{
GridDragGrid.TreeListAddCheckBox((this.gcMain as TreeGridControlEx).TreeListObj);
}
this.panelControl1.Controls.Add(this.gcMain);
}
@@ -3451,13 +3466,17 @@ namespace Lskj.Control
if (isContains)
{
this.btnAdd.Enabled = this.SysModel.AddEnable && this.ValidateCond(this.SysModel.AddCond, rowItem, "P_SystemDllTab", "addCond"); // 判断添加权限
this.btnDel.Enabled = this.SysModel.DeleteEnable && this.ValidateCond(this.SysModel.DeleteCond, rowItem, "P_SystemDllTab", "deleteCond"); // 判断删除权限
this.btnSave.Enabled = this.SysModel.ModifyEnable && this.ValidateCond(this.SysModel.ModifyCond, rowItem, "P_SystemDllTab", "modifyCond"); // 判断修改权限
this.btnImport.Enabled = this.SysModel.ImportEnable && this.ValidateCond(this.SysModel.ImportCond, rowItem, "P_SystemDllTab", "importCond"); // 判断导入权限
this.btnExport.Enabled = this.SysModel.ExportEnable && this.ValidateCond(this.SysModel.ExportCond, rowItem, "P_SystemDllTab", "exportCond") && this.SysModel.ExportPermission; // 判断导出权限
DataRow currentRow = this.gcMain.GridView.GetFocusedDataRow();
//把父表选中行和当前行都替换后在判断,避免传入行为null时,默认为true的情况
this.btnAdd.Enabled = this.SysModel.AddEnable && this.ValidateCond(ReplaceHelper.ReplaceRowParam(currentRow, ReplaceHelper.ReplaceRowParam(rowItem, this.SysModel.AddCond)), null, "P_SystemDllTab", "addCond"); // 判断添加权限
this.btnDel.Enabled = this.SysModel.DeleteEnable && this.ValidateCond(ReplaceHelper.ReplaceRowParam(currentRow, ReplaceHelper.ReplaceRowParam(rowItem, this.SysModel.DeleteCond)), null, "P_SystemDllTab", "deleteCond"); // 判断删除权限
this.btnSave.Enabled = this.SysModel.ModifyEnable && this.ValidateCond(ReplaceHelper.ReplaceRowParam(currentRow, ReplaceHelper.ReplaceRowParam(rowItem, this.SysModel.ModifyCond)), null, "P_SystemDllTab", "modifyCond"); // 判断修改权限
this.btnImport.Enabled = this.SysModel.ImportEnable && this.ValidateCond(ReplaceHelper.ReplaceRowParam(currentRow, ReplaceHelper.ReplaceRowParam(rowItem, this.SysModel.ImportCond)), null, "P_SystemDllTab", "importCond"); // 判断导入权限
this.btnExport.Enabled = this.SysModel.ExportEnable && this.ValidateCond(ReplaceHelper.ReplaceRowParam(currentRow, ReplaceHelper.ReplaceRowParam(rowItem, this.SysModel.ExportCond)), null, "P_SystemDllTab", "exportCond") && this.SysModel.ExportPermission; // 判断导出权限
}
}
}
catch (Exception)
{
@@ -3569,6 +3588,8 @@ namespace Lskj.Control
this.gcMain.IgnoreTab = this.SysModel.IgnoreTab;
}
//判断是否隐藏数据导入按钮
string[] authorizedPersonnel = SysModel.ImportPermissions.Split(',');//有导入权限的人员
this.btnImport.Enabled = false;
@@ -5060,6 +5081,7 @@ namespace Lskj.Control
}
}
}
catch (Exception ex)
{
@@ -5068,6 +5090,9 @@ namespace Lskj.Control
}
}
/// <summary>
/// <para>说明:粘贴表格后更新树结构关联字段</para>
/// <para>创建人:龚宇超</para>
@@ -5173,7 +5198,17 @@ namespace Lskj.Control
{
List<SimpleButton> buttons = new List<SimpleButton>();//没有隐藏的按钮集合
//刷新按钮
buttons.Add(this.btnRefresh);
//刷新按钮
if (SystemInfo.Instance.FoundationHideTableRefresh)
{
this.btnRefresh.Visible = false;
pl_top_right.Width = pl_top_right.Width - this.btnRefresh.Width;
}
else
{
buttons.Add(this.btnRefresh);
}
//帮助文档按钮
if (SystemInfo.Instance.HideHelpDocument)
{
@@ -5572,10 +5607,41 @@ namespace Lskj.Control
MessageUtil.Show(Message, ex.Message);
}
}
public int GetFirstThreeLinesHeight(RichEditControl richEdit)
{
if (string.IsNullOrEmpty(richEdit.Text)) return 0;
// 获取字体和最大宽度
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);
}
}
}
}