feat: support BS menu opening mode

This commit is contained in:
2026-08-12 17:53:50 +08:00
parent a803070819
commit 222ae3c08a
2 changed files with 63 additions and 2 deletions
+32 -1
View File
@@ -663,6 +663,37 @@ namespace Lskj.Business.Impl
}
}
/// <summary>
/// 获取菜单是否使用 BS 网页方式打开。
/// </summary>
/// <param name="menuId">菜单 ID。</param>
/// <returns>1 表示使用 BS 网页方式打开;其他值按原 CS 方式打开。</returns>
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;
}
}
/// <summary>
/// <para>说明:根据配置MenuType加载菜单</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-08-16 </para>
@@ -1358,4 +1389,4 @@ namespace Lskj.Business.Impl
}
}
}
}
+31 -1
View File
@@ -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,