baseline: 小军 WMS 二开代码原始快照(含 SynOABusiness.cs Debugger.Break)
This commit is contained in:
commit
c2b0e7be0d
6522 files changed
+3530643
No files matched your search
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
<Use64BitIISExpress />
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<NameOfLastUsedPublishProfile>D:\Code\WMS\WebApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<StartPageUrl>
|
||||
</StartPageUrl>
|
||||
<StartAction>CurrentPage</StartAction>
|
||||
<AspNetDebugging>True</AspNetDebugging>
|
||||
<SilverlightDebugging>False</SilverlightDebugging>
|
||||
<NativeDebugging>False</NativeDebugging>
|
||||
<SQLDebugging>False</SQLDebugging>
|
||||
<ExternalProgram>
|
||||
</ExternalProgram>
|
||||
<StartExternalURL>
|
||||
</StartExternalURL>
|
||||
<StartCmdLineArguments>
|
||||
</StartCmdLineArguments>
|
||||
<StartWorkingDirectory>
|
||||
</StartWorkingDirectory>
|
||||
<EnableENC>True</EnableENC>
|
||||
<AlwaysStartWebServerOnDebug>False</AlwaysStartWebServerOnDebug>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
|
||||
</configSections>
|
||||
<log4net>
|
||||
<!-- OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL -->
|
||||
<!-- Set root logger level to ERROR and its appenders -->
|
||||
<root>
|
||||
<level value="ALL" />
|
||||
<appender-ref ref="SysAppender" />
|
||||
</root>
|
||||
<!-- Print only messages of level DEBUG or above in the packages -->
|
||||
<logger name="WebLogger">
|
||||
<level value="DEBUG" />
|
||||
</logger>
|
||||
<appender name="SysAppender" type="log4net.Appender.RollingFileAppender,log4net">
|
||||
<param name="File" value="Log/LogInfo/" />
|
||||
<param name="AppendToFile" value="true" />
|
||||
<param name="RollingStyle" value="Date" />
|
||||
<param name="DatePattern" value=""Logs_"yyyyMMdd".txt"" />
|
||||
<param name="StaticLogFileName" value="false" />
|
||||
<layout type="log4net.Layout.PatternLayout,log4net">
|
||||
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
|
||||
</layout>
|
||||
</appender>
|
||||
<appender name="consoleApp" type="log4net.Appender.ConsoleAppender,log4net">
|
||||
<layout type="log4net.Layout.PatternLayout,log4net">
|
||||
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
|
||||
</layout>
|
||||
</appender>
|
||||
</log4net>
|
||||
<connectionStrings>
|
||||
<add name="GXWMS" connectionString="server=10.10.10.101;database=GXWMS;uid=sa;pwd=Gx@20240111;Pooling=true;" providerName="System.Data.SqlClient" />
|
||||
<add name="RndSuiteDev" connectionString="server=10.1.102.3;database=RndSuiteDev;uid=summer_chu;pwd=P@ssw0rd;Pooling=true;" providerName="System.Data.SqlClient" />
|
||||
<add name="MESConnection" connectionString="server=10.10.10.107;database=cloudpivot;user=root;password=GSpa11word" providerName="System.Data.SqlClient" />
|
||||
<add name="OAConnection" connectionString="server=39.100.72.102;database=ecology;user=ecology;password=Z!BYT+jSDDyYHMdX+qFSLzJCYXW" providerName="System.Data.SqlClient" />
|
||||
<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-BulletinBoard-20190513083738;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-BulletinBoard-20190513083738.mdf" />
|
||||
</connectionStrings>
|
||||
<appSettings>
|
||||
<!-- 金蝶云星空 WebApi 服务地址 -->
|
||||
<add key="KingdeeApiUrl" value="http://localhost/k3cloud/"/>
|
||||
</appSettings>
|
||||
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.7.2"/>
|
||||
<httpRuntime targetFramework="4.7.2"/>
|
||||
<customErrors mode="Off"/>
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false"/>
|
||||
<modules runAllManagedModulesForAllRequests="true">
|
||||
<remove name="WebDAVModule"/>
|
||||
</modules>
|
||||
<handlers>
|
||||
<remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
|
||||
<remove name="OPTIONSVerbHandler"/>
|
||||
<remove name="TRACEVerbHandler"/>
|
||||
<remove name="WebDAV"/>
|
||||
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
|
||||
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/>
|
||||
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
|
||||
</handlers>
|
||||
<security>
|
||||
<requestFiltering>
|
||||
<verbs>
|
||||
<add verb="GET" allowed="true"/>
|
||||
<add verb="POST" allowed="true"/>
|
||||
<add verb="PUT" allowed="true"/>
|
||||
<add verb="DELETE" allowed="true"/>
|
||||
<add verb="OPTIONS" allowed="true"/>
|
||||
</verbs>
|
||||
</requestFiltering>
|
||||
</security>
|
||||
<directoryBrowse enabled="false"/>
|
||||
<defaultDocument>
|
||||
<files>
|
||||
<clear />
|
||||
<add value="login.html" />
|
||||
</files>
|
||||
</defaultDocument>
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,264 @@
|
||||
/**
|
||||
* ============================================
|
||||
* GX-WMS 左侧侧边栏导航组件
|
||||
* 用法:
|
||||
* 1. 页面 <head> 引入 nav.css:<link rel="stylesheet" href=".../common/nav.css">
|
||||
* 2. <body> 顶部加一个容器:<div id="sidebar"></div>
|
||||
* 3. 主内容区域包裹在 <div class="main-content"> 中
|
||||
* 4. 页面底部引入本JS,自动初始化
|
||||
*
|
||||
* 维护点:仅修改本文件的 MENU_GROUPS 配置
|
||||
* ============================================
|
||||
*/
|
||||
|
||||
// ---------- 应用根路径自动探测 ----------
|
||||
// 支持 IIS 子目录部署(如 /WebApi,名称可变)和 VS 调试(网站根目录)两种场景。
|
||||
// 原理:根据本脚本自身 URL(<应用根>/View/common/nav.js)反推出应用根前缀。
|
||||
// - 部署在子目录时自动得到 '/WebApi' 之类前缀
|
||||
// - VS 调试 / 根目录部署时为空字符串,不影响原行为
|
||||
var APP_BASE = '';
|
||||
(function () {
|
||||
try {
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
for (var i = scripts.length - 1; i >= 0; i--) {
|
||||
var src = scripts[i].getAttribute('src') || '';
|
||||
if (src.indexOf('nav.js') >= 0) {
|
||||
var a = document.createElement('a');
|
||||
a.href = src;
|
||||
var p = a.pathname.replace(/\\/g, '/');
|
||||
var idx = p.indexOf('/View/common/nav.js');
|
||||
if (idx >= 0) APP_BASE = p.substring(0, idx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (e) { APP_BASE = ''; }
|
||||
window.APP_BASE = APP_BASE;
|
||||
})();
|
||||
|
||||
// ---------- 菜单配置(唯一维护点) ----------
|
||||
// 顶级项:{ title, icon, role, children? } 有 children = 分组
|
||||
// 子项:{ title, href, role }
|
||||
// href 使用绝对路径(以 / 开头),渲染时会自动加上应用根前缀 APP_BASE
|
||||
var MENU_GROUPS = [
|
||||
{ title: '首页', icon: '🏠', href: '/home.html', hideOnHome: true },
|
||||
{
|
||||
title: '生产管理', icon: '🏭', role: 'Purchase01',
|
||||
children: [
|
||||
{ title: 'BOM主数据', href: '/View/Delivery/bom_master.html', role: 'Purchase01' },
|
||||
{ title: '生产排程计划', href: '/View/Delivery/schedule.html', role: 'Purchase01' },
|
||||
{ title: '线边仓库存', href: '/View/Delivery/production_delivery.html', role: 'Purchase01' },
|
||||
{ title: 'MES追溯看板', href: '/View/MES/mes_dashboard.html', role: 'Produce02' }
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '采购管理', icon: '📋', role: 'Purchase01',
|
||||
children: [
|
||||
{ title: '采购申请管理', href: '/procurement.html', role: 'Purchase01' },
|
||||
{ title: '采购看板', href: '/procurement_dashboard.html', role: 'Purchase01' },
|
||||
{ title: '采购物料交付状态看板', href: '/delivery_dashboard.html', role: 'Purchase01' },
|
||||
{ title: '研发采购看板', href: '/dashboard.html', role: 'YF01' },
|
||||
{ title: '研发采购全链路看板', href: '/procurement_board_list.html', role: 'YF01' },
|
||||
{ title: '研发订单考核时效看板', href: '/procurement_audit_leadtime.html', role: 'YF01' },
|
||||
{ title: '采购物料交付', href: '/View/Delivery/material_delivery.html', role: 'Purchase01' },
|
||||
{ title: '采购物料交付计划看板', href: '/View/Delivery/delivery_dashboard.html', role: 'Purchase01' }
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'CRM', icon: '📊', role: 'CRM01',
|
||||
children: [
|
||||
{ title: '金蝶-CRM产品同步', href: '/index.html', role: 'CRM01' },
|
||||
{ title: '金蝶-CRM销售订单新变更单同步', href: '/crm_sale_order_sync.html', role: 'CRM01' }
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
// ============================================
|
||||
// 通用逻辑,一般无需修改
|
||||
// ============================================
|
||||
|
||||
function getLoginUser() {
|
||||
try {
|
||||
var raw = sessionStorage.getItem('gx_user');
|
||||
if (!raw) return null;
|
||||
return JSON.parse(raw);
|
||||
} catch (e) { return null; }
|
||||
}
|
||||
|
||||
function hasRole(role) {
|
||||
if (!role) return true;
|
||||
var user = getLoginUser();
|
||||
if (!user) return false;
|
||||
var rn = user.roleNumbers;
|
||||
if (Array.isArray(rn)) {
|
||||
if (rn.indexOf(role) >= 0) return true;
|
||||
for (var i = 0; i < rn.length; i++) {
|
||||
if (String(rn[i]).toUpperCase() === String(role).toUpperCase()) return true;
|
||||
}
|
||||
}
|
||||
var rs = user.roles;
|
||||
if (Array.isArray(rs)) {
|
||||
for (var j = 0; j < rs.length; j++) {
|
||||
var item = rs[j] || {};
|
||||
if (String(item.roleNumber || '').toUpperCase() === String(role).toUpperCase()) return true;
|
||||
if (String(item.roleName || '').toUpperCase() === String(role).toUpperCase()) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isActive(href) {
|
||||
try {
|
||||
var u = new URL(APP_BASE + href, window.location.origin);
|
||||
return window.location.pathname.replace(/\\/g, '/').indexOf(u.pathname) >= 0;
|
||||
} catch (e) { return false; }
|
||||
}
|
||||
|
||||
function getLoginPath() {
|
||||
// 用 APP_BASE(自动探测的应用根前缀)拼接登录页地址:
|
||||
// - VS 调试/根目录部署:APP_BASE 为空,返回 '/login.html'
|
||||
// - 子目录部署(如 /WebApi):返回 '/WebApi/login.html'
|
||||
return APP_BASE + '/login.html';
|
||||
}
|
||||
|
||||
function logout() {
|
||||
sessionStorage.removeItem('gx_user');
|
||||
window.location.href = getLoginPath();
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染侧边栏
|
||||
*/
|
||||
function renderSidebar() {
|
||||
var user = getLoginUser();
|
||||
if (!user) {
|
||||
if (window.location.href.indexOf('login.html') < 0) {
|
||||
window.location.href = getLoginPath();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
var html = '';
|
||||
// 收缩按钮
|
||||
html += '<button class="sidebar-toggle" title="收起/展开菜单" onclick="toggleSidebar()">☰</button>';
|
||||
// 用户信息区
|
||||
var name = user.userName || user.userId || user.name || '用户';
|
||||
html += '<div class="sidebar-user">'
|
||||
+ '<div class="avatar">' + (name || '?').charAt(0) + '</div>'
|
||||
+ '<div class="user-text">'
|
||||
+ ' <div class="user-name">' + name + '</div>'
|
||||
+ ' <div class="user-action"><a href="javascript:void(0)" onclick="logout()">退出登录</a></div>'
|
||||
+ '</div>'
|
||||
+ '</div>';
|
||||
|
||||
// 找出当前页面所在分组(用于默认展开)
|
||||
var activeGroupIdx = -1;
|
||||
var activeChildIdx = -1;
|
||||
|
||||
// 渲染菜单
|
||||
html += '<div class="sidebar-menu">';
|
||||
for (var i = 0; i < MENU_GROUPS.length; i++) {
|
||||
var g = MENU_GROUPS[i];
|
||||
|
||||
if (g.children && g.children.length) {
|
||||
// 分组:先检查是否有子项当前激活
|
||||
var hasActiveChild = false;
|
||||
var activeChild = -1;
|
||||
for (var k = 0; k < g.children.length; k++) {
|
||||
if (hasRole(g.children[k].role) && isActive(g.children[k].href)) {
|
||||
hasActiveChild = true;
|
||||
activeChild = k;
|
||||
if (activeGroupIdx < 0) activeGroupIdx = i;
|
||||
}
|
||||
}
|
||||
|
||||
// 过滤有权限的子项
|
||||
var visibleChildren = [];
|
||||
for (var k2 = 0; k2 < g.children.length; k2++) {
|
||||
if (hasRole(g.children[k2].role)) visibleChildren.push(g.children[k2]);
|
||||
}
|
||||
if (visibleChildren.length === 0) continue;
|
||||
|
||||
var expanded = hasActiveChild ? ' expanded' : '';
|
||||
var rotate = hasActiveChild ? ' rotate' : '';
|
||||
html += '<div class="menu-group' + expanded + '" data-group="' + i + '">'
|
||||
+ ' <div class="menu-group-title" data-title="' + g.title + '" onclick="toggleGroup(' + i + ')">'
|
||||
+ ' <span class="menu-icon">' + (g.icon || '') + '</span>'
|
||||
+ ' <span class="menu-label">' + g.title + '</span>'
|
||||
+ ' <span class="menu-arrow' + rotate + '">▾</span>'
|
||||
+ ' </div>'
|
||||
+ ' <div class="menu-children">';
|
||||
for (var c = 0; c < visibleChildren.length; c++) {
|
||||
var child = visibleChildren[c];
|
||||
var activeCls = (activeChild >= 0 && g.children[activeChild].href === child.href) ? ' active' : '';
|
||||
html += '<a class="menu-child' + activeCls + '" href="' + APP_BASE + child.href + '">'
|
||||
+ ' <span class="menu-child-dot">•</span>'
|
||||
+ ' <span class="menu-label">' + child.title + '</span>'
|
||||
+ '</a>';
|
||||
}
|
||||
html += ' </div>'
|
||||
+ '</div>';
|
||||
} else {
|
||||
// 单项菜单:按 g.role 判断(分组由子项权限决定,不看 g.role)
|
||||
if (!hasRole(g.role)) continue;
|
||||
// 在首页本身不显示"首页"入口
|
||||
if (g.href === '/home.html' && isActive(g.href)) continue;
|
||||
var activeSingle = isActive(g.href) ? ' active' : '';
|
||||
if (activeSingle) activeGroupIdx = i;
|
||||
html += '<a class="menu-single' + activeSingle + '" href="' + APP_BASE + g.href + '" data-title="' + g.title + '">'
|
||||
+ ' <span class="menu-icon">' + (g.icon || '') + '</span>'
|
||||
+ ' <span class="menu-label">' + g.title + '</span>'
|
||||
+ '</a>';
|
||||
}
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
var el = document.getElementById('sidebar');
|
||||
if (el) el.innerHTML = html;
|
||||
|
||||
// 主体内容左边距
|
||||
document.body.classList.add('with-sidebar');
|
||||
|
||||
// 恢复折叠状态
|
||||
if (localStorage.getItem('gx_sidebar_collapsed') === '1') {
|
||||
document.body.classList.add('sidebar-collapsed');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换侧边栏折叠/展开
|
||||
*/
|
||||
function toggleSidebar() {
|
||||
document.body.classList.toggle('sidebar-collapsed');
|
||||
var collapsed = document.body.classList.contains('sidebar-collapsed');
|
||||
if (collapsed) localStorage.setItem('gx_sidebar_collapsed', '1');
|
||||
else localStorage.removeItem('gx_sidebar_collapsed');
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换分组展开/折叠
|
||||
*/
|
||||
function toggleGroup(idx) {
|
||||
// 折叠状态下点击分组:先展开侧边栏,再展开该分组
|
||||
if (document.body.classList.contains('sidebar-collapsed')) {
|
||||
toggleSidebar();
|
||||
// 展开侧边栏后延迟让 CSS 过渡完成,再展开分组
|
||||
var el = document.querySelector('.menu-group[data-group="' + idx + '"]');
|
||||
if (el) el.classList.add('expanded');
|
||||
return;
|
||||
}
|
||||
var el = document.querySelector('.menu-group[data-group="' + idx + '"]');
|
||||
if (!el) return;
|
||||
el.classList.toggle('expanded');
|
||||
var arrow = el.querySelector('.menu-arrow');
|
||||
if (arrow) arrow.classList.toggle('rotate');
|
||||
}
|
||||
|
||||
function initNav() {
|
||||
renderSidebar();
|
||||
}
|
||||
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener('DOMContentLoaded', function () { initNav(); });
|
||||
} else {
|
||||
window.onload = function () { initNav(); };
|
||||
}
|
||||
Reference in new issue
Block a user