SVN-Revision: r665
This commit is contained in:
wyf
2025-06-04 10:22:44 +00:00
parent 63cae7510c
commit c7818396a7
8 changed files with 87 additions and 171 deletions
@@ -21,61 +21,49 @@ namespace Lskj.Control.BrowserSetting
{
public class BsOpenModuleHandler : CefV8Handler
{
public CefV8Context V8Context;
public BsOpenModuleHandler()
{
}
protected override bool Execute(string name, CefV8Value obj, CefV8Value[] arguments, out CefV8Value returnValue, out string exception)
{
CefV8Value outreturnValue = null;
string outexception = "";
bool outtrn = false;
if (name == "OpenModule" && arguments.Length == 5)
{
string arg0 = arguments[0].GetStringValue();
string arg1 = arguments[1].GetStringValue();
string arg2 = arguments[2].GetStringValue();
string arg3 = arguments[3].GetStringValue();
string arg4 = arguments[4].GetStringValue();
if (ERPInfo.Instance.MainControl.InvokeRequired)
{
ERPInfo.Instance.MainControl.Invoke(new Action(() =>
{
OpenModule(arg0, arg1, arg2, arg3, arg4);
}));
}
else
{
OpenModule(arg0, arg1, arg2, arg3, arg4);
}
returnValue = CefV8Value.CreateUndefined();
exception = null;
return true;
CefProcessMessage cefProcessMessage = CefProcessMessage.Create("OpenModule");
cefProcessMessage.Arguments.SetString(0, arguments[0].GetStringValue());
cefProcessMessage.Arguments.SetString(1, arguments[1].GetStringValue());
cefProcessMessage.Arguments.SetString(2, arguments[2].GetStringValue());
cefProcessMessage.Arguments.SetString(3, arguments[3].GetStringValue());
cefProcessMessage.Arguments.SetString(4, arguments[4].GetStringValue());
V8Context.GetFrame().SendProcessMessage(CefProcessId.Browser, cefProcessMessage);
outreturnValue = CefV8Value.CreateUndefined();
outexception = null;
outtrn = true;
}
else if (name == "OpenOnRightClick" && arguments.Length == 4)
{
var arrayItem = arguments[0].GetStringValue(); // Assuming arrayItem is an array or object
var rightId = arguments[1].GetStringValue();
var MenuName = arguments[2].GetStringValue();
var mMenuCode = arguments[3].GetStringValue();
if (ERPInfo.Instance.MainControl.InvokeRequired)
{
ERPInfo.Instance.MainControl.Invoke(new Action(() =>
{
OpenRightModule(arrayItem, rightId, MenuName, mMenuCode);
}));
}
else
{
OpenRightModule(arrayItem, rightId, MenuName, mMenuCode);
}
returnValue = CefV8Value.CreateUndefined();
exception = null;
return true;
CefProcessMessage cefProcessMessage = CefProcessMessage.Create("OpenOnRightClick");
cefProcessMessage.Arguments.SetString(0, arguments[0].GetStringValue());
cefProcessMessage.Arguments.SetString(1, arguments[1].GetStringValue());
cefProcessMessage.Arguments.SetString(2, arguments[2].GetStringValue());
cefProcessMessage.Arguments.SetString(3, arguments[3].GetStringValue());
V8Context.GetFrame().SendProcessMessage(CefProcessId.Browser, cefProcessMessage);
outreturnValue = CefV8Value.CreateUndefined();
outexception = null;
outtrn = true;
}
returnValue = null;
exception = "Invalid method call";
return false;
else
{
outreturnValue = null;
outexception = "Invalid method call";
outtrn = false;
}
returnValue = outreturnValue;
exception = outexception;
return outtrn;
}
/// <summary>
@@ -91,7 +79,7 @@ namespace Lskj.Control.BrowserSetting
/// <param name="rightId"></param>
/// <param name="MenuName"></param>
/// <param name="mMenuCode"></param>
public static void OpenRightModule(string arrayItem, string rightId, string MenuName, string mMenuCode)
public static void OpenRightModule(string arrayItem, string rightId, string MenuName, string mMenuCode)
{
DataRow item = BaseImpl.GetDataRowResult(string.Format(@"select * from P_systempopupmenu where id='{0}'", rightId));
if (item != null)
@@ -287,28 +275,4 @@ 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] + ""].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);
}
}
}
}
StaticControl.ConditionsPanelDic[args[4] + "