首次提交: OnebotCatalog 项目代码与文档(含 NX 按需生成服务二期、后台、一键启动)
This commit is contained in:
1409
web/app.js
Normal file
1409
web/app.js
Normal file
File diff suppressed because it is too large
Load Diff
4
web/config.js
Normal file
4
web/config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
// 站点配置 (部署时按需修改): NX 按需生成服务地址
|
||||
// api 为空 = 非标档位下载按钮维持置灰态 (一期行为); 填上服务器地址后按钮升级为【在线生成数模】
|
||||
// 例: window.GEN_CONFIG = { api: "https://gen.example.com" };
|
||||
window.GEN_CONFIG = { api: "" };
|
||||
106
web/index.html
Normal file
106
web/index.html
Normal file
@@ -0,0 +1,106 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>欧霓博气动目录 ONEBOT Catalog</title>
|
||||
<link rel="stylesheet" href="style.css?v=8">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="brand"><img src="OneBot-logo.png" class="logo" alt="OneBot"> 欧霓博气动目录 <span class="brand-en">ONEBOT Catalog</span>
|
||||
<span id="ver" class="ver"></span>
|
||||
</div>
|
||||
<div class="toolbar">
|
||||
<input id="searchBox" type="text" placeholder="搜索型号 / 关键词 / 拼音">
|
||||
<button id="btnSearch">搜索</button>
|
||||
<button id="btnLang">EN</button>
|
||||
<button id="btnCart" class="cart-badge">清单 (0)</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<nav id="tree" class="tree"></nav>
|
||||
<div id="split1" class="split" title="拖拽调整宽度"></div>
|
||||
|
||||
<section id="params" class="params">
|
||||
<div id="modelTitle" class="model-title">请选择产品系列</div>
|
||||
<div id="paramPanel"></div>
|
||||
<div id="actions">
|
||||
<a id="btnDownload" class="btn primary hidden" download>下载 STEP</a>
|
||||
<select id="btnGenFmt" class="hidden" title="下载格式 (仅非标档位在线生成)">
|
||||
<option value="zip">全格式 zip</option>
|
||||
<option value="step">STEP</option>
|
||||
<option value="iges">IGES</option>
|
||||
</select>
|
||||
<a id="btnDatasheet" class="btn hidden">下载 PDF</a>
|
||||
<button id="btnAddCart" class="btn hidden">加入清单</button>
|
||||
</div>
|
||||
</section>
|
||||
<div id="split2" class="split" title="拖拽调整宽度"></div>
|
||||
|
||||
<section id="content" class="content">
|
||||
<div class="tabs">
|
||||
<button class="tab active" data-tab="3d">3D / 尺寸图</button>
|
||||
<button class="tab" data-tab="table">参数表</button>
|
||||
<button class="tab" data-tab="search">搜索结果</button>
|
||||
<button class="tab" data-tab="cross">平替对照</button>
|
||||
</div>
|
||||
<div id="tab-3d" class="tab-body">
|
||||
<div class="hsplit">
|
||||
<div id="viewer3dBox" class="hsplit-left">
|
||||
<iframe id="viewerFrame" class="hidden" allowfullscreen></iframe>
|
||||
<canvas id="viewer3d" width="900" height="640" class="hidden"></canvas>
|
||||
<p id="viewer3dHint" class="hint">选型完成后显示 3D 外形 (拖拽旋转 / 滚轮缩放)</p>
|
||||
</div>
|
||||
<div id="split3" class="split v" title="拖拽调整大小"></div>
|
||||
<div id="dimBox" class="hsplit-right">
|
||||
<img id="dimImage" alt="尺寸图" class="hidden">
|
||||
<p id="dimHint" class="hint">选型完成后显示尺寸图</p>
|
||||
<div id="manualWrap"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab-table" class="tab-body hidden">
|
||||
<div class="range-row" id="rangeRow"></div>
|
||||
<div class="table-scroll"><table id="variantTable"><thead></thead><tbody></tbody></table></div>
|
||||
</div>
|
||||
<div id="tab-search" class="tab-body hidden">
|
||||
<div class="table-scroll"><table id="searchTable"><thead><tr><th>型号</th><th>系列</th><th>STEP</th></tr></thead><tbody></tbody></table></div>
|
||||
</div>
|
||||
<div id="tab-cross" class="tab-body hidden">
|
||||
<div class="range-row"><span>品牌筛选: </span><select id="crossBrand"></select>
|
||||
<span class="hint" style="margin-left:12px;">只显示当前型号的平替数据; 点击行跳转</span></div>
|
||||
<div class="table-scroll"><table id="crossTable"><thead><tr><th>品牌</th><th>竞品型号</th><th>我方型号</th><th>备注</th></tr></thead><tbody></tbody></table></div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- 底部信息栏: 左侧状态文字 + 右侧服务器状态圆球 (绿=就绪/红=故障) -->
|
||||
<footer id="status">
|
||||
<span id="statusMsg">加载中...</span>
|
||||
<div id="srvStatus" class="srv-status" title="服务检测中…">
|
||||
<span class="dot"></span>
|
||||
<span id="srvStatusText" class="text">服务器状态</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- 购物车抽屉 (淘宝式清单, 2026-08-24; 刷新页面才清空) -->
|
||||
<div id="cartOverlay" class="cart-overlay hidden"></div>
|
||||
<div id="cartPanel" class="cart-panel hidden">
|
||||
<div class="cart-head">
|
||||
<span id="cartTitle">我的清单</span>
|
||||
<button id="cartClose" class="cart-close">✕</button>
|
||||
</div>
|
||||
<div id="cartList" class="cart-list"></div>
|
||||
<div class="cart-foot">
|
||||
<button id="cartClear" class="btn">清空</button>
|
||||
<button id="cartDownload" class="btn primary">下载全部 (zip + BOM)</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="libs/jszip.min.js?v=1"></script>
|
||||
<script src="config.js?v=1"></script>
|
||||
<script src="app.js?v=15"></script>
|
||||
</body>
|
||||
</html>
|
||||
13
web/libs/jszip.min.js
vendored
Normal file
13
web/libs/jszip.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
148
web/style.css
Normal file
148
web/style.css
Normal file
@@ -0,0 +1,148 @@
|
||||
/* 欧霓博在线目录 - 简洁单页样式 */
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
body {
|
||||
font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
|
||||
display: flex; flex-direction: column; height: 100vh;
|
||||
color: #222; background: #f5f6f8;
|
||||
}
|
||||
header {
|
||||
display: flex; justify-content: space-between; align-items: center;
|
||||
padding: 10px 16px; background: #1b4f8c; color: #fff;
|
||||
}
|
||||
.brand { font-size: 18px; font-weight: bold; display: flex; align-items: center; }
|
||||
.brand .logo { height: 30px; margin-right: 10px; }
|
||||
.brand-en { font-size: 13px; font-weight: normal; opacity: .85; }
|
||||
.ver { font-size: 12px; opacity: .8; margin-left: 10px; }
|
||||
.srv-status {
|
||||
display: flex; align-items: center; gap: 6px;
|
||||
font-size: 12px; color: #666; flex: none;
|
||||
}
|
||||
.srv-status .dot {
|
||||
width: 10px; height: 10px; border-radius: 50%;
|
||||
background: #9e9e9e; flex: none; transition: background .2s;
|
||||
}
|
||||
.srv-status .text { white-space: nowrap; }
|
||||
.srv-status.ready .dot { background: #2e7d32; }
|
||||
.srv-status.no-worker .dot { background: #ef6c00; }
|
||||
.srv-status.idle .dot { background: #2e7d32; }
|
||||
.srv-status.down .dot { background: #c62828; }
|
||||
.toolbar input {
|
||||
width: 260px; padding: 6px 10px; border: none; border-radius: 4px 0 0 4px; font-size: 14px;
|
||||
}
|
||||
.toolbar button {
|
||||
padding: 6px 14px; border: none; background: #4a90d9; color: #fff;
|
||||
font-size: 14px; cursor: pointer;
|
||||
}
|
||||
#btnLang { border-radius: 0 4px 4px 0; margin-left: 2px; }
|
||||
main { flex: 1; display: flex; min-height: 0; }
|
||||
.split { width: 5px; cursor: col-resize; background: #e3e6e8; flex: none; }
|
||||
.split:hover, .split.dragging { background: #4a90d9; }
|
||||
.tree {
|
||||
width: 240px; background: #fff; border-right: 1px solid #ddd;
|
||||
padding: 8px; overflow-y: auto;
|
||||
}
|
||||
.tree .cat { font-weight: bold; margin: 8px 0 4px; color: #1b4f8c; }
|
||||
.tree .series {
|
||||
padding: 7px 10px; margin: 2px 0; border-radius: 4px; cursor: pointer; font-size: 14px;
|
||||
}
|
||||
.tree .series:hover { background: #e8f0fa; }
|
||||
.tree .series.active { background: #4a90d9; color: #fff; }
|
||||
.params {
|
||||
width: 320px; background: #fff; border-right: 1px solid #ddd;
|
||||
padding: 12px; overflow-y: auto;
|
||||
}
|
||||
.model-title { font-size: 16px; font-weight: bold; margin-bottom: 10px; }
|
||||
.param-row { margin-bottom: 10px; }
|
||||
.param-row label { display: block; font-size: 13px; color: #555; margin-bottom: 3px; }
|
||||
.param-row select { width: 100%; padding: 6px; font-size: 14px; border: 1px solid #ccc; border-radius: 4px; }
|
||||
#actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
|
||||
.btn {
|
||||
display: inline-block; padding: 9px 18px; border-radius: 4px; text-decoration: none;
|
||||
font-size: 14px; background: #e9ecef; color: #333; border: 1px solid #ccc;
|
||||
}
|
||||
.btn.primary { background: #1b4f8c; color: #fff; border: none; }
|
||||
.hidden { display: none !important; }
|
||||
.content { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 10px; }
|
||||
.tabs { display: flex; gap: 4px; margin-bottom: 8px; }
|
||||
.tab {
|
||||
padding: 7px 16px; border: 1px solid #ccc; border-radius: 4px 4px 0 0;
|
||||
background: #e9ecef; cursor: pointer; font-size: 14px;
|
||||
}
|
||||
.tab.active { background: #fff; border-bottom-color: #fff; font-weight: bold; }
|
||||
.tab-body { flex: 1; overflow: auto; background: #fff; border: 1px solid #ddd; border-radius: 0 4px 4px 4px; padding: 12px; }
|
||||
.tab-body iframe { width: 100%; height: 100%; border: none; display: block; }
|
||||
#viewer3d { display: block; }
|
||||
#dimImage { max-width: 100%; max-height: 100%; }
|
||||
/* 3D + 尺寸图同页布局 (左右分栏, 中间分隔条可拖拽) */
|
||||
#tab-3d { display: flex; overflow: hidden; padding: 0; }
|
||||
.hsplit { flex: 1; display: flex; min-width: 0; min-height: 0; }
|
||||
.hsplit-left { width: 62%; flex: none; min-width: 0; position: relative; overflow: auto; padding: 12px; }
|
||||
.hsplit-right { flex: 1; min-width: 0; overflow-y: auto; padding: 12px; border-left: none; }
|
||||
.split.v { cursor: col-resize; }
|
||||
/* 表格标签页: 筛选栏固定顶部, 表格独立滚动 (表头 sticky 不露缝) */
|
||||
#tab-table, #tab-search, #tab-cross { display: flex; flex-direction: column; overflow: hidden; }
|
||||
#tab-table .range-row, #tab-cross .range-row { flex: none; margin-bottom: 6px; }
|
||||
.table-scroll { flex: 1; overflow: auto; min-height: 0; }
|
||||
/* 参数表列筛选: 表头可点 + 取值下拉 */
|
||||
th.col-filter { cursor: pointer; user-select: none; }
|
||||
th.col-filter:hover { background: #dde6f0; }
|
||||
.col-filter-pop {
|
||||
position: absolute; background: #fff; border: 1px solid #ccc; border-radius: 4px;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,.15); z-index: 1000; max-height: 260px;
|
||||
overflow-y: auto; min-width: 140px;
|
||||
}
|
||||
.col-filter-item { padding: 6px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; }
|
||||
.col-filter-item:hover { background: #e8f0fa; }
|
||||
.col-filter-item.sel { background: #dbe9f8; font-weight: bold; }
|
||||
.manual-cap { margin: 14px 0 4px; font-weight: bold; color: #555; }
|
||||
.manual-img { max-width: 100%; border: 1px solid #ddd; }
|
||||
.hint { color: #888; font-size: 14px; }
|
||||
table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
||||
th, td { border: 1px solid #ddd; padding: 6px 8px; text-align: left; }
|
||||
th { background: #f0f3f7; position: sticky; top: 0; }
|
||||
tr:hover td { background: #f7fafd; cursor: pointer; }
|
||||
.range-row { margin-bottom: 8px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 13px; }
|
||||
.range-row input { width: 60px; padding: 4px; border: 1px solid #ccc; border-radius: 4px; }
|
||||
footer { padding: 6px 16px; font-size: 13px; color: #666; background: #fff; border-top: 1px solid #ddd; display: flex; align-items: center; justify-content: space-between; }
|
||||
footer #statusMsg { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
|
||||
/* 购物车 (淘宝式清单, 2026-08-24) */
|
||||
.cart-badge {
|
||||
padding: 6px 12px; border: 1px solid #fff; background: transparent; color: #fff;
|
||||
font-size: 13px; cursor: pointer; border-radius: 4px; margin-left: 8px;
|
||||
}
|
||||
.cart-badge:hover { background: rgba(255,255,255,.15); }
|
||||
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 500; }
|
||||
.cart-panel {
|
||||
position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 92vw;
|
||||
background: #fff; z-index: 501; display: flex; flex-direction: column;
|
||||
box-shadow: -4px 0 16px rgba(0,0,0,.2);
|
||||
}
|
||||
.cart-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #ddd; font-size: 16px; font-weight: bold; }
|
||||
.cart-close { border: none; background: transparent; font-size: 16px; cursor: pointer; color: #666; }
|
||||
.cart-list { flex: 1; overflow-y: auto; padding: 10px 16px; }
|
||||
.cart-item { border-bottom: 1px solid #eee; padding: 8px 0; font-size: 13px; }
|
||||
.cart-item .ci-model { font-weight: bold; font-size: 14px; }
|
||||
.cart-item .ci-sub { color: #888; margin-top: 2px; word-break: break-all; }
|
||||
.cart-item .ci-ops { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
|
||||
.cart-item .ci-ops input { width: 56px; padding: 3px 6px; border: 1px solid #ccc; border-radius: 4px; }
|
||||
.cart-item .ci-del { border: 1px solid #ccc; background: #fff; color: #c0392b; border-radius: 4px; padding: 3px 10px; cursor: pointer; font-size: 12px; }
|
||||
.cart-foot { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid #ddd; }
|
||||
.cart-foot .btn { flex: 1; text-align: center; }
|
||||
.add-cart-btn {
|
||||
border: 1px solid #ccc; background: #fff; color: #1b4f8c; border-radius: 4px;
|
||||
padding: 2px 8px; cursor: pointer; font-size: 13px; line-height: 1.4;
|
||||
}
|
||||
.add-cart-btn:hover { background: #e8f0fa; }
|
||||
|
||||
/* 参数化选型 (2026-08-25): range 输入框 + 非标档位徽标 + 下载置灰 */
|
||||
.param-input {
|
||||
width: 100%; padding: 6px; font-size: 14px;
|
||||
border: 1px solid #ccc; border-radius: 4px;
|
||||
}
|
||||
.nonstd-badge {
|
||||
display: inline-block; margin-left: 8px; padding: 2px 8px;
|
||||
background: #fff3cd; color: #8a6d3b; border: 1px solid #e0c069;
|
||||
border-radius: 3px; font-size: 12px; font-weight: normal; vertical-align: middle;
|
||||
}
|
||||
.btn[disabled] { opacity: .55; cursor: not-allowed; }
|
||||
Reference in New Issue
Block a user