diff --git a/插件库/Lskj.Control/BrowserSetting/BsClient.cs b/插件库/Lskj.Control/BrowserSetting/BsClient.cs index cf5d72f..7ac6bd8 100644 --- a/插件库/Lskj.Control/BrowserSetting/BsClient.cs +++ b/插件库/Lskj.Control/BrowserSetting/BsClient.cs @@ -96,4 +96,25 @@ namespace Lskj.Control.BrowserSetting } else if (message.Name.Equals("CloseWin")) { - \ No newline at end of file + if (frmWebBrowser != null && frmWebBrowser.Parent != null && frmWebBrowser.Parent.Parent != null && frmWebBrowser.Parent.Parent is BaseForm baseForm) + { + if (baseForm.InvokeRequired) + { + baseForm.Invoke(new Action(() => + { + baseForm.DialogResult = DialogResult.OK; + baseForm.Close(); + })); + } + else + { + baseForm.DialogResult = DialogResult.OK; + baseForm.Close(); + } + } + } + else if (message.Name.Equals("SelectPro")) + { + string arg0 = message.Arguments.GetString(0); + if (frmWebBrowser != null && frmWebBrowser.Parent != null && frmWebBrowser.Parent.Parent != null && frmWebBrowser.Parent.Parent is BaseForm baseForm) + \ No newline at end of file diff --git a/插件库/Lskj.Control/BrowserSetting/BsOpenModuleHandler.cs b/插件库/Lskj.Control/BrowserSetting/BsOpenModuleHandler.cs index c05306d..1ee6dc3 100644 --- a/插件库/Lskj.Control/BrowserSetting/BsOpenModuleHandler.cs +++ b/插件库/Lskj.Control/BrowserSetting/BsOpenModuleHandler.cs @@ -1,4 +1,5 @@ using DevExpress.Utils; +using DevExpress.XtraGrid.Columns; using DevExpress.XtraTab; using Lskj.Business; using Lskj.Business.Impl; @@ -63,6 +64,15 @@ namespace Lskj.Control.BrowserSetting outexception = null; outtrn = true; } + else if (name == "SelectPro" && arguments.Length == 1) + { + CefProcessMessage cefProcessMessage = CefProcessMessage.Create("SelectPro"); + cefProcessMessage.Arguments.SetString(0, arguments[0].GetStringValue()); + V8Context.GetFrame().SendProcessMessage(CefProcessId.Browser, cefProcessMessage); + outreturnValue = CefV8Value.CreateUndefined(); + outexception = null; + outtrn = true; + } else { outreturnValue = null; @@ -283,4 +293,75 @@ namespace Lskj.Control.BrowserSetting mcpex.InitializeControl(new ModuleModel(MainImpl.GetSystemdllTab(moduleModel.SearchCondFormModuleCode)), null, null, true); if (StaticControl.ConditionsPanelDic.ContainsKey(args[4] + "")) { - StaticControl.ConditionsPanelDic[args[4] + " \ No newline at end of file + StaticControl.ConditionsPanelDic[args[4] + ""].Dispose(); + StaticControl.ConditionsPanelDic[args[4] + ""] = mcpex; + } + else + { + StaticControl.ConditionsPanelDic.Add(args[4] + "", mcpex); + } + DialogResult dialogResult = mcpex.ShowDialog(); + } + } + ERPInfo.Instance.PageControl.TabPages.Add(tp); + ERPInfo.Instance.PageControl.SelectedTabPage = tp; + ERPInfo.Instance.ModuleForms.Add(guid, module); + + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(ex.InnerException != null ? ex.InnerException.Message : ex.Message); + LogHelper.Instance.WriteError(ex); + //LogUtil.WriteError("打开" + module.Name + "模块失败!", ex); + } + } + + + public static void AddReturnRow(string rowdata) + { + if (!string.IsNullOrWhiteSpace(rowdata) && StaticControl.RightMenuGridView != null) + { + JObject rowObject = JsonConvert.DeserializeObject(rowdata); + JArray jArray = new JArray(); + jArray.Add(rowObject); + DataTable dataTable = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(jArray)); + DataRow rowItem = dataTable.Rows[0]; + + DataTable gridTable = (StaticControl.RightMenuGridView.GridControl.DataSource as DataTable).TrimDeleteRows(); + if (gridTable == null) return; + DataRow newRow = gridTable.NewRow(); + GridColumnCollection gridColumns = StaticControl.RightMenuGridView.Columns; + StaticControl.RightMenuGridView.BeginDataUpdate(); + + // 赋值明细字段 + foreach (GridColumn col in gridColumns) + { + try + { + // 未包含字段,则使用控件默认值. + GridColumnModel model = col.Tag as GridColumnModel; + string colFieldName = col.FieldName; + if (!string.IsNullOrWhiteSpace(StaticControl.Comprefix) && colFieldName.Equals(StaticControl.Comprefix + "ProductId", StringComparison.OrdinalIgnoreCase)) + { + colFieldName = colFieldName.Replace(StaticControl.Comprefix, ""); + } + + if (model == null) + { + if (rowItem.Table.Columns.Contains(colFieldName)) + { + // 来源列中是否包含对应字段,包含则使用值 + newRow[col.FieldName] = rowItem[colFieldName]; + } + continue; + } + if (rowItem.Table.Columns.Contains(colFieldName)) + { + // 来源列中是否包含对应字段,包含则使用值 + newRow[col.FieldName] = rowItem[colFieldName]; + } + if (model.LimitLength > 0) + { + DataRow HandleRow = newRow; + \ No newline at end of file diff --git a/插件库/Lskj.Control/BrowserSetting/BsRenderProcessHandler.cs b/插件库/Lskj.Control/BrowserSetting/BsRenderProcessHandler.cs index 6181761..1bb16c6 100644 --- a/插件库/Lskj.Control/BrowserSetting/BsRenderProcessHandler.cs +++ b/插件库/Lskj.Control/BrowserSetting/BsRenderProcessHandler.cs @@ -20,4 +20,7 @@ namespace Lskj.Control.BrowserSetting { boundObject.OpenModule = function(menuId, menuName, dllName, modelFlag, urlParams) { - native f \ No newline at end of file + native function OpenModule(); + return OpenModule(menuId, menuName, dllName, modelFlag, urlParams); + }; + boundObject.OpenOnRightClick = function(arrayIte \ No newline at end of file