diff --git a/插件库/Lskj.Business/Impl/MainImpl.cs b/插件库/Lskj.Business/Impl/MainImpl.cs index f57f2c6..04a3dd1 100644 --- a/插件库/Lskj.Business/Impl/MainImpl.cs +++ b/插件库/Lskj.Business/Impl/MainImpl.cs @@ -663,6 +663,37 @@ namespace Lskj.Business.Impl } } /// + /// 获取菜单是否使用 BS 网页方式打开。 + /// + /// 菜单 ID。 + /// 1 表示使用 BS 网页方式打开;其他值按原 CS 方式打开。 + public static int GetBsOpenMode(string menuId) + { + if (string.IsNullOrWhiteSpace(menuId) || !HasExistsColumn("P_FormMenuConfigTab", "BsOpenMode")) + { + return 0; + } + + try + { + const string sqlValue = @"select ISNULL(BsOpenMode,0) as BsOpenMode + from P_FormMenuConfigTab + where MenuId=@MenuId"; + DataTable dataTable = SqlHelper.ExecuteDataTable( + sqlValue, + new SqlParameter("@MenuId", menuId)); + int bsOpenMode; + return dataTable.Rows.Count > 0 && + int.TryParse(dataTable.Rows[0]["BsOpenMode"] + "", out bsOpenMode) + ? bsOpenMode + : 0; + } + catch (Exception) + { + return 0; + } + } + /// /// 说明:根据配置MenuType加载菜单 /// 创建人:龚宇超 /// 创建日期:2017-08-16 @@ -1358,4 +1389,4 @@ namespace Lskj.Business.Impl } } -} \ No newline at end of file +} diff --git a/插件库/Lskj.Main/Model/Manager.cs b/插件库/Lskj.Main/Model/Manager.cs index 332cbca..247b78e 100644 --- a/插件库/Lskj.Main/Model/Manager.cs +++ b/插件库/Lskj.Main/Model/Manager.cs @@ -315,7 +315,12 @@ namespace Lskj.Main.Model } //验证是否设置不能打开多个相同模块 bool SingleOpenMode = MainImpl.GetOpenRestrictions(menuId); - + bool openInBsMode = MainImpl.GetBsOpenMode(menuId) == 1; + string configuredDllName = dllName; + if (openInBsMode) + { + dllName = "Lskj.PubBrower2.dll"; + } LogUtil.WriteDebug(modelFlag.ToString(), "操作模块", menuName, menuName, menuId.ToString()); DllModule module = new DllModule @@ -333,6 +338,21 @@ namespace Lskj.Main.Model urlParams, menuId }; + if (openInBsMode) + { + string bsUrl = BuildBsMenuUrl(configuredDllName, modelFlag); + args = new string[] + { + menuName, + ERPInfo.Instance.UserId, + ERPInfo.Instance.UserName, + purview + "", + "", + menuId, + "", + bsUrl + }; + } dllName = MainImpl.GetDefaultValue(dllName); if (SystemInfo.Instance.SoftOpenMode || SingleOpenMode) { @@ -439,6 +459,16 @@ namespace Lskj.Main.Model } + private static string BuildBsMenuUrl(string dllName, string dllCoid) + { + return string.Format( + "pages/app/app.html?xtype={0}&dllcoid={1}&username={2}&password={3}", + dllName, + dllCoid, + ERPInfo.Instance.UserName, + ERPInfo.Instance.Password); + } + private static string BuildOpeningModuleKey( string menuId, string dllName,