From c1680ca4dd00147a992347dfb5444c194162c998 Mon Sep 17 00:00:00 2001 From: tdx Date: Tue, 17 Jun 2025 10:20:38 +0000 Subject: [PATCH] SVN r752 SVN-Revision: r752 --- 插件库/Lskj.Control/Model/CommonMenu.cs | 7 ++- 插件库/Lskj.Control/Model/ControlType.cs | 7 ++- 插件库/Lskj.Control/ModuleGridEx.cs | 73 ++++++------------------ 3 files changed, 27 insertions(+), 60 deletions(-) diff --git a/插件库/Lskj.Control/Model/CommonMenu.cs b/插件库/Lskj.Control/Model/CommonMenu.cs index d75629c..90147e0 100644 --- a/插件库/Lskj.Control/Model/CommonMenu.cs +++ b/插件库/Lskj.Control/Model/CommonMenu.cs @@ -167,7 +167,6 @@ namespace Lskj.Control.Model private List HandleRightMenuParams(List paramList) { List handleParamList = new List(); - foreach (string item in paramList) { if (!string.IsNullOrWhiteSpace(item)) @@ -184,6 +183,7 @@ namespace Lskj.Control.Model break; case "{": // 字段特殊替换 { + handleParamList.Add(this._controlObj.ReplaceControlValue(item)); } break; @@ -201,6 +201,11 @@ namespace Lskj.Control.Model } break; default: + if (BaseGridView != null && BaseGridView.GetFocusedDataRow() != null) + { + DataRow parentitem = BaseGridView.GetFocusedDataRow(); + fieldValue = ReplaceHelper.ReplaceRowParam(parentitem, item) + ""; + } handleParamList.Add(this._controlObj.ReplaceControlValue(fieldValue)); break; } diff --git a/插件库/Lskj.Control/Model/ControlType.cs b/插件库/Lskj.Control/Model/ControlType.cs index 4cead9b..7c53845 100644 --- a/插件库/Lskj.Control/Model/ControlType.cs +++ b/插件库/Lskj.Control/Model/ControlType.cs @@ -443,9 +443,12 @@ namespace Lskj.Control.Model public const int LabApiBtuton = 163; /// ///超链接 - /// + /// public const int LabHyperlink = 164; - + /// + ///关联右键列 + /// + public const int LabRightlink = 165; /// /// 说明:是否为Value类型 diff --git a/插件库/Lskj.Control/ModuleGridEx.cs b/插件库/Lskj.Control/ModuleGridEx.cs index 18e9587..41796d0 100644 --- a/插件库/Lskj.Control/ModuleGridEx.cs +++ b/插件库/Lskj.Control/ModuleGridEx.cs @@ -83,10 +83,6 @@ namespace Lskj.Control /// private bool _isExcPrint; /// - /// 最新的名字 - /// - public string lastrichtext; - /// /// 主打印Sql /// private string _mainPrintSql; @@ -1847,6 +1843,20 @@ namespace Lskj.Control AddGridViewRecord(); } + /// + /// 表格触发右键功能 + /// + /// + /// + private void OnAfterLinkCilkCall(object sender, EventArgs e) + { + string unioright = sender + ""; + DataRow rowItem = this.GridControlObj.GetViewFocusedDataRow(); + DataRow rightrowitem = this.GridControlObj.gridViewRightMenu.MenuTable.Rows.Cast().FirstOrDefault(x=>(x["orderid"]+"").Equals(unioright)); + CommonMenu menu = new CommonMenu(this.Model, this.SearchObj, this.gcMain); + menu.Apply(rightrowitem); + } + /// /// 说明: @@ -3477,7 +3487,8 @@ namespace Lskj.Control InitializeUpperRightMenu(); //绑定老版粘贴回调新增行事件 this.gcMain.OnAfterPasting += GcMain_OnAfterPasting; - + //触发右键回调 + this.gcMain.OnAfterLinkCilk += OnAfterLinkCilkCall; if (!string.IsNullOrWhiteSpace(this.SysModel.SelectDisplayColumn)) { //this.gcMain.GridView.CustomColumnDisplayText += GridView_CustomColumnDisplayText; @@ -4076,35 +4087,6 @@ namespace Lskj.Control /// The instance containing the event data. protected void OnGridViewRightCallBack(object sender, EventArgs e) { - try - { - int oldRowHandle = gcMain.GridView.FocusedRowHandle; - if (!(gcMain is TreeGridControlEx) && oldRowHandle < 0) return; - DataTable dt = this.gcMain.GridView.GetGridViewFilteredAndSortedDataToDataTable(); - if (gcMain is TreeGridControlEx) dt = (gcMain as TreeGridControlEx).GetGridViewDataSource(); - if (dt == null || dt.Rows.Count == 0) return; - DataRow SelectTheLine = gcMain is TreeGridControlEx ? (gcMain as TreeGridControlEx).GetViewFocusedDataRow() : dt.Rows[oldRowHandle]; - this.SearchObj.RememberRow = (this.SysModel.AccordingNameSelected == 0); - this.SearchObj.SearchLastGrid(); - if (this.SysModel.AccordingNameSelected != 0)//根据主键刷新目标选中行 - { - DataRow items = dt.Rows.Cast().FirstOrDefault(x => x[ParmaryKey].Equals(SelectTheLine[ParmaryKey])); - dt = this.gcMain.GridView.GetGridViewFilteredAndSortedDataToDataTable(); - BindingSource bindingSource = new BindingSource(); - bindingSource.DataSource = dt; - int numberOfRows = bindingSource.Find(ParmaryKey, SelectTheLine[ParmaryKey].ToString()); - this.gcMain.GridView.ClearSelection(); - this.gcMain.GridView.FocusedRowHandle = numberOfRows; - this.gcMain.GridView.SelectRow(numberOfRows); - } - if (this.RightGridCallBack != null) this.RightGridCallBack(sender, e); - if (DetailRightGridCallBack != null) this.DetailRightGridCallBack(sender, e); - } - catch (Exception ex) - { - string Message = ErrorMessage.PromptErrorMessage(ex); - MessageUtil.Show(Message, ex.Message); - } } /// @@ -4747,19 +4729,6 @@ namespace Lskj.Control /// The e. protected void OnReportPrintAfter(object sender, EventArgs e) { - try - { - if (_printSaveParams != null && _printSaveParams.Count > 0) - { - //打印完成后添加数据库 - int result = BaseModuleImpl.SavePrintRecord(_printSaveParams[0], _printSaveParams[1], _printSaveParams[2], _printSaveParams[3], _printSaveParams[4]); - } - } - catch (Exception ex) - { - string Message = ErrorMessage.PromptErrorMessage(ex); - MessageUtil.Show(Message, ex.Message); - } } /// @@ -4827,15 +4796,6 @@ namespace Lskj.Control /// protected void OnTsmExportClick(object sender, EventArgs e) { - try - { - this.ExportGridRecord(); - } - catch (Exception ex) - { - string Message = ErrorMessage.PromptErrorMessage(ex); - MessageUtil.Show(Message, ex.Message); - } } /// @@ -5384,7 +5344,6 @@ namespace Lskj.Control { if (!this.SysModel.SearchEnable) { - lastrichtext = text; PromptBox.EditText = text; // 获取文档对象 Document document = this.PromptBox.TextEdit.Document;