dsh-data-dashboard 0.0.0-stage → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -2
- package/assets/theater-board.svg +1 -0
- package/backend/incremental/flow.mjs +492 -0
- package/backend/incremental/jobs.mjs +58 -0
- package/backend/incremental/xlsx-rows.mjs +145 -0
- package/backend/job-worker.mjs +22 -0
- package/backend/modules/banquet/index.mjs +46 -0
- package/backend/modules/inventory/index.mjs +45 -0
- package/backend/modules/inventory/legacy-fields.mjs +83 -0
- package/backend/modules/invoice/index.mjs +72 -0
- package/backend/modules/movement/index.mjs +68 -0
- package/backend/modules/opening/index.mjs +48 -0
- package/backend/modules/target/index.mjs +45 -0
- package/backend/modules/terminal/index.mjs +114 -0
- package/backend/modules.mjs +12 -0
- package/backend/public/admin.css +192 -0
- package/backend/public/admin.js +713 -0
- package/backend/public/board.css +43 -0
- package/backend/public/board.html +47 -0
- package/backend/public/board.js +96 -0
- package/backend/public/index.html +110 -0
- package/backend/public/review.css +5 -0
- package/backend/public/review.js +452 -0
- package/backend/real-data/generate-dashboard.mjs +135 -0
- package/backend/real-data/inventory-history.mjs +316 -0
- package/backend/real-data/organization-mapping.mjs +102 -0
- package/backend/real-data/source-payload.mjs +459 -0
- package/backend/real-data/terminal-components.mjs +280 -0
- package/backend/real-data/terminal-structure.css +105 -0
- package/backend/real-data/terminal-structure.mjs +276 -0
- package/backend/real-data/v10-components.mjs +112 -0
- package/backend/real-data/v10-details.css +18 -0
- package/backend/real-data/v10-details.mjs +251 -0
- package/backend/real-data/v10-layout.css +27 -0
- package/backend/real-data/v10-model.mjs +521 -0
- package/backend/real-data/v10-overview-data.mjs +248 -0
- package/backend/real-data/v10-overview.css +264 -0
- package/backend/real-data/v10-overview.mjs +263 -0
- package/backend/real-data/v10-presentation.mjs +342 -0
- package/backend/real-data/v10-shell.html +1097 -0
- package/backend/real-data/v10-template.mjs +351 -0
- package/backend/recognition/fingerprint.mjs +32 -0
- package/backend/recognition/headers.mjs +2 -0
- package/backend/recognition/module-definition.mjs +4 -0
- package/backend/recognition/result.mjs +29 -0
- package/backend/recognition/upload-limits.mjs +14 -0
- package/backend/review-engine.mjs +364 -0
- package/backend/review-service.mjs +182 -0
- package/backend/server.mjs +545 -0
- package/backend/store.mjs +68 -0
- package/backend/target-template.mjs +47 -0
- package/backend/validate-workbook.mjs +251 -0
- package/backend/web-sync/README.md +37 -0
- package/backend/web-sync/client.mjs +63 -0
- package/backend/web-sync/exporter.mjs +260 -0
- package/backend/web-sync/local.html +34 -0
- package/backend/web-sync/server.mjs +147 -0
- package/build-manifest.json +79 -0
- package/client.js +24 -0
- package/cordis.patch.yml +3 -0
- package/index.js +117 -0
- package/lib/dist-manifest.mjs +19 -0
- package/lib/market-index.mjs +56 -0
- package/lib/package-audit.mjs +34 -0
- package/lib/settings.mjs +71 -0
- package/lib/tool-definitions.mjs +56 -0
- package/lib/tools.mjs +255 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +71 -4
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;color:#1f2328;--line:#e5e7eb;--muted:#6b7280;--wine:#aa343e;--wine-dark:#8f2933;--green:#258475}
|
|
2
|
+
*{box-sizing:border-box}[hidden]{display:none!important}html,body{height:100%}body{margin:0;display:flex;flex-direction:column;background:#fff}
|
|
3
|
+
button{font:inherit;cursor:pointer}
|
|
4
|
+
.bar{display:flex;align-items:center;gap:16px;padding:10px 18px;border-bottom:1px solid var(--line);background:#fff;flex:none}
|
|
5
|
+
.bar h1{font-size:15px;font-weight:600;margin:0;white-space:nowrap}
|
|
6
|
+
.seg{display:flex;background:#f1f2f4;border-radius:9px;padding:3px}
|
|
7
|
+
.seg button{border:0;background:transparent;padding:5px 14px;border-radius:7px;font-size:13px;color:#4b5563}
|
|
8
|
+
.seg button.on{background:#fff;color:#1f2328;box-shadow:0 1px 2px rgba(0,0,0,.08)}
|
|
9
|
+
/* 更新数据 stands out so daily updates are easy to find. */
|
|
10
|
+
.seg button[data-view="update"]{color:var(--wine);font-weight:600}
|
|
11
|
+
.seg button[data-view="update"]::before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--wine);margin-right:6px;vertical-align:2px}
|
|
12
|
+
.seg button[data-view="update"].on{background:var(--wine);color:#fff}
|
|
13
|
+
.seg button[data-view="update"].on::before{background:#fff}
|
|
14
|
+
.meta{margin:0 0 0 auto;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
15
|
+
.meta b{color:#1f2328;font-weight:500}
|
|
16
|
+
.btn{border:1px solid #d1d5db;background:#fff;border-radius:8px;padding:6px 12px;font-size:12.5px;color:#1f2328;white-space:nowrap}
|
|
17
|
+
.btn:hover{background:#f9fafb}
|
|
18
|
+
.btn-wine{background:var(--wine);border-color:var(--wine);color:#fff}.btn-wine:hover{background:var(--wine-dark)}
|
|
19
|
+
.views{flex:1;min-height:0;position:relative}
|
|
20
|
+
.view{position:absolute;inset:0;display:none}
|
|
21
|
+
.view.on{display:block}
|
|
22
|
+
.view iframe{width:100%;height:100%;border:0;display:block}
|
|
23
|
+
#view-board{background:#edf2f7}
|
|
24
|
+
.empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:var(--muted);font-size:13px}
|
|
25
|
+
.empty strong{color:#1f2328;font-size:15px;font-weight:500}
|
|
26
|
+
.empty p{margin:0 0 6px}
|
|
27
|
+
.scroll{overflow:auto;background:#f3f6f9}
|
|
28
|
+
.wrap{max-width:1180px;margin:0 auto;padding:22px 28px 40px}
|
|
29
|
+
.card{background:#fff;border:1px solid #e4eaf0;border-radius:16px;padding:18px 20px}
|
|
30
|
+
.card-head h2{font-size:15px;margin:0}
|
|
31
|
+
.card-head p{font-size:12px;color:var(--muted);margin:4px 0 14px}
|
|
32
|
+
table{width:100%;border-collapse:collapse;font-size:12.5px}
|
|
33
|
+
th{font-weight:500;color:#8a99a6;font-size:11.5px;text-align:left;padding:8px 10px;background:#f9fafb;border-bottom:1px solid #eef2f5}
|
|
34
|
+
td{padding:10px;border-bottom:1px solid #eef2f5;vertical-align:middle}
|
|
35
|
+
tr:last-child td{border-bottom:0}
|
|
36
|
+
tr.viewing td{background:#fdf6f6}
|
|
37
|
+
.muted{color:#9aa7b2}
|
|
38
|
+
.pill{font-size:11px;border-radius:999px;padding:2px 8px;white-space:nowrap}
|
|
39
|
+
.pill.cur{background:#ecfdf5;color:#047857}.pill.old{background:#f1f5f9;color:#64748b}
|
|
40
|
+
.pill.pending{background:#fffbeb;color:#a16207}.pill.failed{background:#fff1f2;color:#b42318}.pill.running{background:#eff6ff;color:#1d4ed8}
|
|
41
|
+
.link{border:0;background:none;color:var(--wine);padding:0 2px;font-size:12.5px}
|
|
42
|
+
a.link{text-decoration:none}.link:hover{text-decoration:underline}
|
|
43
|
+
.toast{position:fixed;right:22px;bottom:22px;background:#111827;color:#fff;font-size:13px;padding:10px 14px;border-radius:10px;z-index:9}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="color-scheme" content="light" />
|
|
7
|
+
<title>战区经营看板</title>
|
|
8
|
+
<link rel="stylesheet" href="/board.css" />
|
|
9
|
+
<script src="/board.js" defer></script>
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<header class="bar">
|
|
13
|
+
<h1>战区经营看板</h1>
|
|
14
|
+
<nav class="seg" aria-label="切换视图">
|
|
15
|
+
<button type="button" class="on" data-view="board">看板</button>
|
|
16
|
+
<button type="button" data-view="update">更新数据</button>
|
|
17
|
+
<button type="button" data-view="history">历史版本</button>
|
|
18
|
+
</nav>
|
|
19
|
+
<p class="meta" id="meta">正在连接本机后台…</p>
|
|
20
|
+
</header>
|
|
21
|
+
<main class="views">
|
|
22
|
+
<section class="view on" id="view-board" aria-label="最新看板">
|
|
23
|
+
<iframe id="board-frame" title="战区经营看板" hidden></iframe>
|
|
24
|
+
<div class="empty" id="board-empty">
|
|
25
|
+
<strong>还没有生成过看板</strong>
|
|
26
|
+
<p>先在“更新数据”里导入 Excel,再点“更新并生成看板”。</p>
|
|
27
|
+
<button type="button" class="btn btn-wine" data-go="update">去更新数据</button>
|
|
28
|
+
</div>
|
|
29
|
+
</section>
|
|
30
|
+
<section class="view" id="view-update" aria-label="更新数据">
|
|
31
|
+
<iframe id="update-frame" title="更新数据"></iframe>
|
|
32
|
+
</section>
|
|
33
|
+
<section class="view scroll" id="view-history" aria-label="历史版本">
|
|
34
|
+
<div class="wrap">
|
|
35
|
+
<div class="card">
|
|
36
|
+
<div class="card-head"><h2>历史版本</h2><p>每次生成单独保存;新上传不会改动已生成的版本。点“查看”在看板页打开。</p></div>
|
|
37
|
+
<table>
|
|
38
|
+
<thead><tr><th>生成时间</th><th>数据截至</th><th>使用的资料</th><th>状态</th><th></th></tr></thead>
|
|
39
|
+
<tbody id="history"><tr><td colspan="5" class="muted">正在读取…</td></tr></tbody>
|
|
40
|
+
</table>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</section>
|
|
44
|
+
</main>
|
|
45
|
+
<div class="toast" id="toast" role="status" aria-live="polite" hidden></div>
|
|
46
|
+
</body>
|
|
47
|
+
</html>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Merged page: latest dashboard, the update page and generation history in
|
|
4
|
+
// one place. Dashboards stay independent offline HTML files.
|
|
5
|
+
const $ = selector => document.querySelector(selector);
|
|
6
|
+
const titles = { invoice: '发票', movement: '动销', opening: '开瓶', terminal: '签约', inventory: '库存', banquet: '宴席', target: '目标' };
|
|
7
|
+
let state = null, viewingId = null, known = null, followLatest = true, toastTimer = null;
|
|
8
|
+
const updateFrame = $('#update-frame');
|
|
9
|
+
|
|
10
|
+
function show(view) {
|
|
11
|
+
document.querySelectorAll('.seg button').forEach(button => button.classList.toggle('on', button.dataset.view === view));
|
|
12
|
+
document.querySelectorAll('.view').forEach(section => section.classList.toggle('on', section.id === `view-${view}`));
|
|
13
|
+
if (view === 'update' && !updateFrame.src) updateFrame.src = '/admin?embed=1';
|
|
14
|
+
}
|
|
15
|
+
document.querySelectorAll('.seg button').forEach(button => button.addEventListener('click', () => show(button.dataset.view)));
|
|
16
|
+
document.addEventListener('click', event => { const go = event.target.closest('[data-go]'); if (go) show(go.dataset.go); });
|
|
17
|
+
|
|
18
|
+
const time = value => { const d = new Date(value); return Number.isFinite(d.valueOf()) ? `${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')} ${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}` : '—'; };
|
|
19
|
+
function dataEnd(job) {
|
|
20
|
+
// Latest date among the daily flow sources this version was generated from.
|
|
21
|
+
const ends = Object.entries(job.sourceIds || {}).filter(([id]) => ['invoice', 'movement', 'opening'].includes(id))
|
|
22
|
+
.map(([, uploadId]) => state.uploads?.find(upload => upload.id === uploadId)?.coverage?.end).filter(Boolean).sort();
|
|
23
|
+
return ends.at(-1) ? ends.at(-1).slice(5) : '—';
|
|
24
|
+
}
|
|
25
|
+
const completed = () => (state?.generations || []).filter(job => job.status === 'completed');
|
|
26
|
+
const latestNormal = () => completed().find(job => !job.needsReview) || completed()[0] || null;
|
|
27
|
+
|
|
28
|
+
function toast(message) {
|
|
29
|
+
const node = $('#toast'); node.textContent = message; node.hidden = false;
|
|
30
|
+
clearTimeout(toastTimer); toastTimer = setTimeout(() => { node.hidden = true; }, 4000);
|
|
31
|
+
}
|
|
32
|
+
function openVersion(job) {
|
|
33
|
+
const frame = $('#board-frame');
|
|
34
|
+
if (!job) { frame.hidden = true; $('#board-empty').hidden = false; viewingId = null; return; }
|
|
35
|
+
if (viewingId !== job.id) { frame.src = job.viewUrl; viewingId = job.id; }
|
|
36
|
+
frame.hidden = false; $('#board-empty').hidden = true;
|
|
37
|
+
}
|
|
38
|
+
function renderMeta() {
|
|
39
|
+
const current = completed().find(job => job.id === viewingId);
|
|
40
|
+
const latest = latestNormal();
|
|
41
|
+
const running = (state.generations || []).find(job => job.status === 'running');
|
|
42
|
+
$('#meta').innerHTML = '';
|
|
43
|
+
const parts = [];
|
|
44
|
+
if (running) parts.push(['正在生成新版本', '']);
|
|
45
|
+
if (current) parts.push([current.id === latest?.id ? '当前版本' : '正在查看历史版本', `${time(current.finishedAt || current.createdAt)} 生成`], ['数据截至', dataEnd(current)]);
|
|
46
|
+
else parts.push(['还没有生成过看板', '']);
|
|
47
|
+
parts.forEach(([label, value], index) => {
|
|
48
|
+
if (index) $('#meta').append(' · ');
|
|
49
|
+
$('#meta').append(label);
|
|
50
|
+
if (value) { const b = document.createElement('b'); b.textContent = ` ${value}`; $('#meta').append(b); }
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function renderHistory() {
|
|
54
|
+
const body = $('#history'); body.replaceChildren();
|
|
55
|
+
const jobs = (state.generations || []).filter(job => ['completed', 'failed', 'running'].includes(job.status));
|
|
56
|
+
if (!jobs.length) { const row = body.insertRow(); const cell = row.insertCell(); cell.colSpan = 5; cell.className = 'muted'; cell.textContent = '还没有生成记录'; return; }
|
|
57
|
+
const latest = latestNormal();
|
|
58
|
+
for (const job of jobs.slice(0, 50)) {
|
|
59
|
+
const row = body.insertRow(); if (job.id === viewingId) row.className = 'viewing';
|
|
60
|
+
row.insertCell().textContent = time(job.finishedAt || job.createdAt);
|
|
61
|
+
row.insertCell().textContent = job.status === 'completed' ? dataEnd(job) : '—';
|
|
62
|
+
row.insertCell().textContent = Object.keys(job.sourceIds || {}).map(id => titles[id] || id).join('、') || '—';
|
|
63
|
+
const status = row.insertCell(), pill = document.createElement('span');
|
|
64
|
+
const kind = job.status === 'failed' ? ['failed', '生成失败'] : job.status === 'running' ? ['running', '生成中'] : job.needsReview ? ['pending', '待确认版本'] : job.id === latest?.id ? ['cur', '当前'] : ['old', '历史'];
|
|
65
|
+
pill.className = `pill ${kind[0]}`; pill.textContent = kind[1]; status.append(pill);
|
|
66
|
+
if (job.status === 'failed' && job.error) status.title = job.error;
|
|
67
|
+
const actions = row.insertCell();
|
|
68
|
+
if (job.status === 'completed') {
|
|
69
|
+
const view = document.createElement('button'); view.type = 'button'; view.className = 'link'; view.textContent = '查看';
|
|
70
|
+
view.addEventListener('click', () => { followLatest = job.id === latest?.id; openVersion(job); renderMeta(); renderHistory(); show('board'); });
|
|
71
|
+
const download = document.createElement('a'); download.className = 'link'; download.href = job.downloadUrl; download.textContent = '下载'; download.setAttribute('download', '');
|
|
72
|
+
actions.append(view, ' · ', download);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async function refresh() {
|
|
77
|
+
try {
|
|
78
|
+
const response = await fetch('/api/state', { cache: 'no-store' });
|
|
79
|
+
state = await response.json();
|
|
80
|
+
} catch { $('#meta').textContent = '无法连接本机后台,请确认后台已启动'; return; }
|
|
81
|
+
const done = completed();
|
|
82
|
+
if (known === null) { known = new Set(done.map(job => job.id)); openVersion(latestNormal()); }
|
|
83
|
+
else {
|
|
84
|
+
const fresh = done.filter(job => !known.has(job.id));
|
|
85
|
+
for (const job of fresh) known.add(job.id);
|
|
86
|
+
const newest = fresh.find(job => !job.needsReview);
|
|
87
|
+
if (newest && followLatest) {
|
|
88
|
+
openVersion(newest); show('board');
|
|
89
|
+
toast(`已生成新版本(${time(newest.finishedAt)}),看板已切换到最新数据`);
|
|
90
|
+
} else if (newest) toast('已生成新版本,可在“历史版本”查看');
|
|
91
|
+
else if (fresh.some(job => job.needsReview)) toast('已生成待确认版本,可在“历史版本”查看;当前看板未替换');
|
|
92
|
+
}
|
|
93
|
+
renderMeta(); renderHistory();
|
|
94
|
+
}
|
|
95
|
+
refresh();
|
|
96
|
+
setInterval(() => { if (document.visibilityState === 'visible') refresh(); }, 3000);
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="color-scheme" content="light" />
|
|
7
|
+
<title>战区看板后台</title>
|
|
8
|
+
<link rel="stylesheet" href="/admin.css" />
|
|
9
|
+
<link rel="stylesheet" href="/review.css" />
|
|
10
|
+
<script src="/review.js" defer></script>
|
|
11
|
+
<script src="/admin.js" defer></script>
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<a class="skip-link" href="#main">跳到主要内容</a>
|
|
15
|
+
<aside class="rail" aria-label="后台导航">
|
|
16
|
+
<a class="brand" href="#main" aria-label="战区看板后台首页"><svg viewBox="0 0 32 32" aria-hidden="true"><circle cx="16" cy="16" r="12"/><path d="m21 11-3 7-7 3 3-7z"/></svg></a>
|
|
17
|
+
<div class="rail-line"></div>
|
|
18
|
+
<a class="rail-item" href="/" aria-label="看板与更新合并页" title="看板与更新合并页"><svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M3 9h18M8 20V9"/></svg></a>
|
|
19
|
+
<a class="rail-item active" href="#sources" aria-label="更新资料" title="更新资料"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 15V3m-4 4 4-4 4 4M4 14v6h16v-6"/></svg></a>
|
|
20
|
+
<a class="rail-item" href="#generate" aria-label="手动生成" title="手动生成"><svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="4" width="18" height="13" rx="2"/><path d="M8 21h8m-4-4v4m-5-8 3-3 3 2 4-5"/></svg></a>
|
|
21
|
+
<a class="rail-item" href="#history" aria-label="生成记录" title="生成记录"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 9a8 8 0 1 1 0 6M4 4v5h5m3-2v5l3 2"/></svg></a>
|
|
22
|
+
<a class="rail-item rail-bottom" href="#about" aria-label="使用说明" title="使用说明"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v6m0-10v.1"/></svg></a>
|
|
23
|
+
<span class="rail-version">LOCAL</span>
|
|
24
|
+
</aside>
|
|
25
|
+
<main id="main">
|
|
26
|
+
<header class="page-header">
|
|
27
|
+
<div><p class="eyebrow">TERRITORY WORKSPACE</p><h1>战区看板后台</h1><p class="page-intro">整理本机资料,按需生成每一版看板。</p></div>
|
|
28
|
+
<div class="header-actions"><span id="connection" class="connection"><i></i>正在连接本机</span><button id="refresh" class="button button-quiet" type="button"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M20 7v5h-5M4 17v-5h5m-4-4a8 8 0 0 1 14-3l1 2M4 17l1 2a8 8 0 0 0 14-3"/></svg>刷新状态</button></div>
|
|
29
|
+
</header>
|
|
30
|
+
|
|
31
|
+
<section class="mode-notice" aria-label="当前生成模式">
|
|
32
|
+
<div class="mode-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="M3 9h18m-12 0v11m4-6h4m-4 3h2"/></svg></div>
|
|
33
|
+
<div><strong id="mode-title">正在读取生成模式</strong><p id="mode-description">生成时使用最新校验通过的上传版本,缺失来源和待确认指标会在看板中明确标注。</p></div>
|
|
34
|
+
<span id="mode-tag" class="mode-tag">等待后台就绪</span>
|
|
35
|
+
</section>
|
|
36
|
+
|
|
37
|
+
<div id="notice" class="notice" role="status" aria-live="polite" hidden></div>
|
|
38
|
+
<a id="review-resume" class="review-resume" href="#review" hidden>继续处理待确认项</a>
|
|
39
|
+
<div class="workspace-summary" aria-label="后台状态">
|
|
40
|
+
<div><span>今日已更新</span><strong><b id="today-count">—</b><small id="today-total"> / 7 类</small></strong></div>
|
|
41
|
+
<div><span>资料准备</span><strong><b id="ready-count">—</b><small id="ready-total"> / 7 类</small></strong></div>
|
|
42
|
+
<div><span>已生成成品</span><strong><b id="generation-count">—</b><small> 份</small></strong></div>
|
|
43
|
+
<div><span>当前任务</span><strong class="summary-status" id="task-status">正在读取</strong></div>
|
|
44
|
+
<p>上传不会自动生成<br/>历史成品独立保留</p>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<section id="sources" class="section" aria-labelledby="sources-title">
|
|
48
|
+
<div class="update-panel" id="update-panel">
|
|
49
|
+
<div class="update-head">
|
|
50
|
+
<div><h2 id="sources-title">选好文件,系统自动读取日期并给出更新方式</h2><p id="batch-summary">六个板块都从这里更新:拖入或选择一个或多个 Excel,按工作表名识别板块。没选的板块沿用当前版本。</p></div>
|
|
51
|
+
<label class="update-add" id="batch-add" hidden>+ 继续添加文件<input id="batch-more" type="file" accept=".xlsx" multiple hidden /></label>
|
|
52
|
+
</div>
|
|
53
|
+
<p class="update-tip">推荐每天导出:发票、动销、开瓶、库存「最近 7 天」;签约、宴席有新表时整份导出。导出范围须与当前数据一致(同一战区、全部产品),不一致的文件会被拦下。</p>
|
|
54
|
+
<label class="batch-drop" id="batch-drop">
|
|
55
|
+
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 15V3m-4 4 4-4 4 4M4 14v6h16v-6"/></svg>
|
|
56
|
+
<strong>拖入 Excel,或</strong>
|
|
57
|
+
<span class="button button-primary batch-pick">选择文件</span>
|
|
58
|
+
<small>可一次选择多个 .xlsx · <span id="upload-limit-hint">原文件保留</span></small>
|
|
59
|
+
<input id="batch-input" type="file" accept=".xlsx" multiple hidden />
|
|
60
|
+
</label>
|
|
61
|
+
<div id="batch-list" class="check-list" aria-live="polite"></div>
|
|
62
|
+
<div class="batch-actions" id="batch-actions" hidden><button id="batch-upload" class="button button-secondary" type="button" disabled>只更新数据</button><button id="batch-generate" class="button button-primary" type="button" disabled>确认更新并生成看板 →</button><span id="batch-hint"></span><button id="batch-clear" class="text-button" type="button" hidden>清空</button></div>
|
|
63
|
+
<p id="upload-capacity-description" class="update-capacity"></p>
|
|
64
|
+
</div>
|
|
65
|
+
</section>
|
|
66
|
+
|
|
67
|
+
<section id="receipt" class="section" aria-labelledby="receipt-title" hidden>
|
|
68
|
+
<div class="receipt-panel">
|
|
69
|
+
<div class="receipt-head"><h2 id="receipt-title">本次更新回执</h2><button id="receipt-close" class="text-button" type="button">收起</button></div>
|
|
70
|
+
<div id="receipt-grid" class="receipt-grid"></div>
|
|
71
|
+
<p id="receipt-foot" class="receipt-foot"></p>
|
|
72
|
+
</div>
|
|
73
|
+
</section>
|
|
74
|
+
|
|
75
|
+
<section id="current" class="section" aria-labelledby="current-title">
|
|
76
|
+
<div class="status-panel">
|
|
77
|
+
<div><h2 id="current-title">当前使用的资料</h2><p>只看状态;更新请在上方选择文件。提醒周期只用于“待更新”提示,不影响更新方式。</p></div>
|
|
78
|
+
<div class="status-table" role="table" aria-label="当前使用的资料">
|
|
79
|
+
<div class="status-row status-head" role="row"><span role="columnheader">板块</span><span role="columnheader">数据范围</span><span role="columnheader">版本</span><span role="columnheader">最近一次操作</span><span role="columnheader">提醒周期</span><span role="columnheader">状态</span></div>
|
|
80
|
+
<div id="module-grid"><div class="loading-card">正在读取资料状态…</div></div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</section>
|
|
84
|
+
|
|
85
|
+
<section id="review" class="review-panel" aria-labelledby="review-title">
|
|
86
|
+
<div class="section-heading"><span class="step-number">03</span><div><h2 id="review-title">本次数据检查</h2><p>集中处理重复记录和组织对应。已确认的结果保存在本机,原始 Excel 不改写。</p></div></div>
|
|
87
|
+
<p id="review-summary" class="review-summary">正在读取检查结果…</p>
|
|
88
|
+
<div class="review-toolbar"><button id="review-check-button" class="button button-secondary" type="button" data-review-action>检查全部当前来源</button><button id="review-export" class="button button-quiet" type="button" data-review-action>导出待核对清单</button><button id="review-later" class="button button-quiet" type="button">稍后继续处理</button></div>
|
|
89
|
+
<p class="review-saving-note">每组点击确认后即保存。暂未确认的勾选不会执行;退出后可从“继续处理”返回。</p>
|
|
90
|
+
<div id="review-notice" class="notice" role="status" aria-live="polite" hidden></div>
|
|
91
|
+
<div id="review-modules"></div>
|
|
92
|
+
<details class="review-records-details" data-open-key="records"><summary>处理记录与撤销</summary><p class="review-help">撤销后重新检查受影响来源。重新选择会影响之后生成的看板,已生成文件保留。</p><div id="review-records"></div></details>
|
|
93
|
+
<details class="review-backup" data-open-key="backup"><summary>备份与恢复处理设置</summary><p class="review-help">此备份只包含检查、处理决定、组织对应及操作记录,不包含原始 Excel 或历史 HTML。完整迁移需在关闭应用后另行备份本机数据目录。</p><button id="review-backup" class="button button-secondary" type="button" data-review-action>下载处理设置备份</button><div class="review-restore"><label class="review-label"><span>选择处理设置备份文件</span><input id="review-restore-file" type="file" accept=".json,application/json" /></label><p id="review-restore-name" class="review-help"></p><p class="review-help">恢复会重新核对本机来源与保存的决定;缺少对应来源时不能直接套用。恢复后请检查处理记录,再生成。</p><button id="review-restore-confirm" class="button button-secondary" type="button" disabled>确认恢复所选处理设置</button></div></details>
|
|
94
|
+
</section>
|
|
95
|
+
|
|
96
|
+
<section id="generate" class="generate-panel" aria-labelledby="generate-title">
|
|
97
|
+
<div class="generation-copy"><span class="eyebrow">04 · MANUAL GENERATION</span><h2 id="generate-title">准备好了,再生成。</h2><p id="generate-sources" class="generate-sources"></p><p>使用各板块最新有效上传版本,生成一份可离线打开的 v10 真实数据 HTML。每次生成保存为新文件,不覆盖历史成品。</p><div class="generation-footnote"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v6m0-10v.1"/></svg><span>未处理项会阻止普通生成;也可明确生成待确认版本,相关汇总及关联指标不显示为完整结果。</span></div></div>
|
|
98
|
+
<div class="generation-action"><button id="generate-button" class="button button-primary" type="button" disabled>生成真实数据看板<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 12h15m-6-6 6 6-6 6"/></svg></button><button id="generate-pending-button" class="button button-pending" type="button" disabled>仍有问题,生成待确认版本</button><span id="generation-progress" role="status" aria-live="polite">等待后台就绪</span><a id="latest-output" class="text-link" target="_blank" rel="noopener" hidden>打开最新生成的看板 ↗</a></div>
|
|
99
|
+
</section>
|
|
100
|
+
|
|
101
|
+
<section id="history" class="section" aria-labelledby="history-title">
|
|
102
|
+
<div class="section-header"><div class="section-heading"><span class="step-number">05</span><div><h2 id="history-title">生成记录</h2><p>每次生成单独保存,可随时查看或下载已有成品。</p></div></div><span id="history-count" class="section-hint"></span></div>
|
|
103
|
+
<div id="generation-history" class="history-panel"><div class="empty-state"><strong>还没有生成记录</strong><p>上传资料并通过校验后,点击上方按钮生成真实数据看板。</p></div></div>
|
|
104
|
+
</section>
|
|
105
|
+
|
|
106
|
+
<section id="about" class="about-panel" aria-labelledby="about-title"><div><h2 id="about-title">资料与口径说明</h2><p>“联盟体”在看板统一称为“终端”。当前保留六个板块,不包含分销商动销;“经营目标”单独上传,用于发票、动销、开瓶的目标达成率。</p><p>所有板块从“更新数据”顶部选择文件:发票、动销、开瓶、库存按文件日期建议增量、范围更新或整份替换,签约、宴席整份替换;提交前核对变化和导出范围。文件无法使用时保留旧有效版本;处理决定可记住、撤销。</p></div><div><span class="storage-label">本机保存位置</span><code id="data-directory">正在读取…</code><p>上传资料与生成记录保存在本机。下载的真实数据 HTML 包含本次来源数据及筛选所需内容,可离线打开;旧演示成品在生成记录中单独标注。</p></div></section>
|
|
107
|
+
<footer><span>战区数字看板 <i></i> LOCAL WORKSPACE</span><span id="version-label">正在读取生成模式</span></footer>
|
|
108
|
+
</main>
|
|
109
|
+
</body>
|
|
110
|
+
</html>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
|
|
3
|
+
.review-panel{background:#fff;border:1px solid #dfe5eb;border-radius:22px;padding:24px;margin:28px 0}.review-toolbar,.review-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.review-toolbar{margin:16px 0}.review-summary{font-size:13px;color:#536c7d;line-height:1.8}.review-help{font-size:12px;color:#657b89;line-height:1.8;margin:8px 0;overflow-wrap:anywhere}.review-error{font-size:12px;color:#963c45;background:#fff1f3;border:1px solid #edd2d7;border-radius:8px;padding:12px;line-height:1.8;white-space:pre-wrap}.review-module{border:1px solid #e0e7ed;border-radius:14px;margin:12px 0;overflow:hidden}.review-module>summary,.review-group>summary{cursor:pointer;padding:16px;display:flex;align-items:center;gap:14px;background:#f8fafb;font-size:13px;list-style:none}.review-module>summary::before,.review-group>summary::before{content:'›';font-size:20px;line-height:1;color:#718695}.review-module[open]>summary::before,.review-group[open]>summary::before{transform:rotate(90deg)}.review-module>summary>.status{margin-left:auto}.review-count{font-size:11px;color:#936632}.review-module-body{padding:4px 18px 18px}.review-source-name{font-size:13px;font-weight:500;line-height:1.8;margin:10px 0;overflow-wrap:anywhere}.review-source-selection{display:flex;align-items:end;gap:10px;flex-wrap:wrap;padding:10px 0}.review-source-selection .review-label{flex:1;min-width:180px}.review-group{border:1px solid #e2e7eb;border-radius:12px;margin:14px 0;overflow:hidden}.review-group.pending{border-color:#e2ccb0}.review-group.pending>summary{background:#fff9ef}.review-group.resolved>summary{background:#f2f8f5}.review-group-body{padding:12px 16px 18px}.review-table-wrap{max-width:100%;overflow:auto;border:1px solid #dce5ec;border-radius:9px;margin:12px 0}.review-table{border-collapse:collapse;font-size:12px;min-width:100%;white-space:nowrap;text-align:left}.review-table th,.review-table td{padding:11px 13px;border-bottom:1px solid #e5ebf0;border-right:1px solid #edf1f4;vertical-align:top;max-width:360px;white-space:normal;min-width:90px;overflow-wrap:anywhere}.review-table th{background:#f5f8fa;color:#526a7c;font-weight:600;white-space:nowrap}.review-table td{color:#384f5e}.review-table th:first-child,.review-table td:first-child{position:sticky;left:0;min-width:64px;background:#fff;z-index:1}.review-table th:first-child{background:#f5f8fa}.review-table .review-difference{background:#fff4df;color:#78561e}.review-impact{border-left:3px solid #b8834c;background:#fff8ed;font-size:12px;line-height:1.9;padding:11px 14px;margin:13px 0;color:#73512c;overflow-wrap:anywhere}.review-check{display:flex;gap:9px;align-items:flex-start;font-size:12px;line-height:1.8;color:#465e6e;margin:10px 0}.review-check input,.review-table input{accent-color:#aa343e;flex-shrink:0;width:17px;height:17px;min-height:0;margin:2px 0;padding:0}.review-all-fields{margin:10px 0;font-size:12px}.review-all-fields>summary,.review-organizations>summary,.review-records-details>summary{cursor:pointer;padding:11px 0;color:#526d80;font-size:13px}.review-fields{display:grid;grid-template-columns:minmax(110px,1fr) minmax(0,3fr);margin:12px 0;border:1px solid #e2e9ee;border-radius:9px;overflow:hidden}.review-fields dt,.review-fields dd{padding:8px 12px;margin:0;border-bottom:1px solid #e7edf1;font-size:11px;line-height:1.7;overflow-wrap:anywhere}.review-fields dt{background:#f6f8fa;color:#627887}.review-fields dd{color:#3e5665}.review-organizations{border-top:1px solid #e4eaf0;margin-top:18px}.review-org-form{display:grid;gap:12px}.review-label{display:flex;flex-direction:column;gap:7px;font-size:12px;color:#52697a;min-width:0}.review-input{font:inherit;color:#29485a;background:#fff;border:1px solid #cbd7e0;border-radius:8px;padding:9px 10px;min-height:38px;width:100%;max-width:100%}.review-input:focus-visible{outline:3px solid #6d92b8;outline-offset:2px}.review-input:disabled{background:#eef2f5;color:#7c8d98}.review-input[type=checkbox]{width:17px;min-height:17px}.review-org-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.review-date-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.review-org-form>.button{justify-self:start}.review-records-details{margin-top:22px;padding-top:12px;border-top:1px solid #e1e8ed}.review-record{padding:14px 0;border-bottom:1px solid #e5ebf0}.review-record strong{font-size:12px;color:#445e70}.review-record.revoked{opacity:.75}.review-event-list{padding-left:22px;color:#637a8b;font-size:11px;line-height:2}.review-backup{border-top:1px solid #e1e8ed;padding-top:18px;margin-top:20px}.review-backup h3{font-size:13px;font-weight:600}.review-restore{display:grid;gap:10px;padding:12px 0;max-width:650px}.review-restore input[type=file]{font-size:12px;width:100%}.review-restore .button{justify-self:start}.review-resume{display:inline-block;font-size:12px;color:#975b2a;background:#fff6e6;border:1px solid #e9d2aa;border-radius:9px;padding:9px 12px;margin-top:10px}.review-panel .notice{margin-top:14px}.review-panel summary:focus-visible{outline:3px solid #6d92b8;outline-offset:-3px}.generation-action .button-pending{background:#fff6e8;color:#8a5c29;border-color:#e0c69d;box-shadow:none;font-size:12px;min-height:40px;padding:10px}.review-actions .button{font-size:12px}.review-org-form .review-input[type=date]{min-width:0}.review-panel h3{font-size:14px}.review-saving-note{font-size:11px;color:#6b7f8f;line-height:1.8}
|
|
4
|
+
@media(max-width:1000px){.review-org-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.review-panel{padding:20px}.review-module-body{padding:4px 12px 14px}.review-group-body{padding:10px 12px 14px}.review-module>summary{flex-wrap:wrap}}
|
|
5
|
+
@media(max-width:600px){.review-panel{padding:16px 12px}.review-org-fields,.review-date-fields{grid-template-columns:1fr}.review-toolbar .button,.review-actions .button{flex:1 1 150px}.review-module>summary,.review-group>summary{padding:12px;gap:8px;flex-wrap:wrap}.review-source-selection{display:block}.review-source-selection>.button{margin-top:10px}.review-fields{grid-template-columns:minmax(90px,1fr) minmax(0,2fr)}.review-panel .section-heading{align-items:flex-start}}
|