dsh-data-dashboard 0.1.6 → 0.1.7
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/backend/public/admin.js
CHANGED
|
@@ -368,10 +368,12 @@ function applyState(next) {
|
|
|
368
368
|
lastReceipt.generating = false;
|
|
369
369
|
lastReceipt.foot = current.status === 'failed' ? `看板生成失败:${current.error || '请稍后重试'}。资料已更新,可直接重新生成。` : current.needsReview ? '已生成待确认版本,当前看板未替换。收到的原文件都保存在本机。'
|
|
370
370
|
: document.documentElement.classList.contains('embedded') ? '看板已生成并切到「看板」页。收到的原文件都保存在本机。' : '看板已生成,可在下方“生成记录”查看。收到的原文件都保存在本机。';
|
|
371
|
+
if (current.status === 'completed' && current.skippedModules?.length) lastReceipt.foot += ` ${current.skippedModules.map(item => item.title).join('、')}模板已更新,旧文件本次未计入,请按新模板重新上传。`;
|
|
371
372
|
renderReceipt();
|
|
372
373
|
}
|
|
374
|
+
const skippedNote = current?.skippedModules?.length ? ` 注意:${current.skippedModules.map(item => item.title).join('、')}模板已更新,旧文件本次未计入,请按新模板重新上传。` : '';
|
|
373
375
|
if (current?.status === 'completed') {
|
|
374
|
-
setNotice(current.needsReview ? '待确认版本已生成。相关汇总及关联指标保持待确认,请在生成记录中查看;最近正常版本入口未被替换。' : current.mode === 'real' ? '真实数据看板已生成,使用本次开始生成时锁定的来源。可在“生成记录”中查看或下载 HTML;缺失来源和待确认指标已明确标注。' : '历史演示看板已生成。请查看生成记录中的模式说明。');
|
|
376
|
+
setNotice(skippedNote ? skippedNote.trim() : current.needsReview ? '待确认版本已生成。相关汇总及关联指标保持待确认,请在生成记录中查看;最近正常版本入口未被替换。' : current.mode === 'real' ? '真实数据看板已生成,使用本次开始生成时锁定的来源。可在“生成记录”中查看或下载 HTML;缺失来源和待确认指标已明确标注。' : '历史演示看板已生成。请查看生成记录中的模式说明。');
|
|
375
377
|
trackedGeneration = null;
|
|
376
378
|
} else if (current?.status === 'failed') {
|
|
377
379
|
setNotice(`生成失败:${current.error || '请检查后台状态后重试。'}`, true);
|
|
@@ -96,8 +96,17 @@ export async function generateDashboard({ project, dataDir, sourceVersions, outp
|
|
|
96
96
|
const { payload, report } = await build({ dataDir, decisionsFile: decisionBefore ? decisionsFile : undefined, sourceVersions, allowPending, rowCache: true });
|
|
97
97
|
if (!payload?.sources || !payload?.modules || report?.activeChangedDuringRead) throw new Error('有效上传版本读取不完整或已发生变化,请重新生成。');
|
|
98
98
|
if (report.decisionError) throw new Error(report.decisionError);
|
|
99
|
+
// 模板已更新、旧文件通不过当前表头校验的板块:本次跳过并在看板与生成记录中提示重传,其他板块照常生成。
|
|
100
|
+
const skippedModules = [];
|
|
99
101
|
for (const [id, expected] of Object.entries(sourceVersions)) {
|
|
100
102
|
const source = payload.sources[id], module = payload.modules[id];
|
|
103
|
+
if (!source && module?.state === 'unavailable' && /^工作簿结构校验失败/.test(module.reason || '')) {
|
|
104
|
+
const reason = `${module.reason.replace(/。$/, '')}。该板块模板已更新,请按新模板重新上传;本次看板不含此板块。`;
|
|
105
|
+
Object.assign(module, { reason, records: [], metrics: {} });
|
|
106
|
+
(module.warnings ||= []).push(reason);
|
|
107
|
+
skippedModules.push({ moduleId: id, title: titles[id], uploadId: expected.uploadId, reason });
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
101
110
|
if (!source || source.uploadId !== expected.uploadId || source.sha256 !== expected.sha256) throw new Error(`${titles[id]}未使用锁定的有效上传版本:${module?.reason || '请重新上传并检查来源。'}`);
|
|
102
111
|
if (!['ready', 'partial'].includes(module?.state) && !(allowPending && report.modules?.[id]?.reviewPending)) throw new Error(`${titles[id]}无法计算:${module?.reason || '请核对该板块资料及已确认规则。'}`);
|
|
103
112
|
}
|
|
@@ -110,7 +119,7 @@ export async function generateDashboard({ project, dataDir, sourceVersions, outp
|
|
|
110
119
|
const rendered = await render(payload);
|
|
111
120
|
if (typeof rendered?.html !== 'string' || !rendered.html.includes('</html>')) throw new Error('未生成有效的离线 HTML。');
|
|
112
121
|
const reviewSummary = { pendingCount: pendingModules.reduce((count, id) => count + (report.modules[id].review?.pendingCount || 1), 0), modules: pendingModules,
|
|
113
|
-
sources: Object.entries(sourceVersions).map(([id]) => ({ moduleId: id, filename: payload.sources[id]
|
|
122
|
+
sources: Object.entries(sourceVersions).map(([id]) => ({ moduleId: id, filename: payload.sources[id]?.originalName ?? null, sha256: payload.sources[id]?.sha256 ?? null, groups: report.modules[id].review?.groups ?? [], reason: payload.modules[id].reason ?? null })), organizations: report.reviewOrganizations ?? null };
|
|
114
123
|
if (initialState.review) {
|
|
115
124
|
const escape = value => String(value ?? '').replace(/[&<>"']/g, character => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[character]);
|
|
116
125
|
const label = pendingModules.length ? `待确认版本 · ${pendingModules.length} 个板块尚未处理` : '本次来源与处理记录';
|
|
@@ -126,7 +135,7 @@ export async function generateDashboard({ project, dataDir, sourceVersions, outp
|
|
|
126
135
|
await verifyInputs();
|
|
127
136
|
return {
|
|
128
137
|
bytes: Buffer.byteLength(rendered.html), sha256: sha(rendered.html), templateSha256: rendered.templateSha256,
|
|
129
|
-
codeSha256, decisionsSha256, reviewSha256, needsReview: pendingModules.length > 0, reviewSummary, payloadSha256: rendered.payloadSha256,
|
|
138
|
+
codeSha256, decisionsSha256, reviewSha256, needsReview: pendingModules.length > 0, reviewSummary, skippedModules, payloadSha256: rendered.payloadSha256,
|
|
130
139
|
processingVersion: payload.processingVersion, payloadVersion: payload.schemaVersion, rendererVersion: rendered.rendererVersion,
|
|
131
140
|
sources: payload.sources, moduleStates: rendered.moduleStates,
|
|
132
141
|
processors: Object.fromEntries(ids.map(id => [id, { version: payload.processingVersion, state: payload.modules[id].state }])),
|
package/build-manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-data-dashboard",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"builtAt": "2026-11-
|
|
5
|
-
"sourceCommit": "
|
|
3
|
+
"version": "0.1.7",
|
|
4
|
+
"builtAt": "2026-11-30T05:48:43.461Z",
|
|
5
|
+
"sourceCommit": "e4f5b4cffe452a4b3d72971eb0f9e530fe042ab7",
|
|
6
6
|
"sourceDirty": false,
|
|
7
7
|
"files": {
|
|
8
8
|
"README.md": "ae7f24665cd16f9d729d719ef2335c328d14e0c8b791e40c5c39c8a61d8783d6",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"backend/modules/tunzhihu/index.mjs": "ae90f4b6c412a5b7b16da57f9d4f0d2ce94355b3192b6099e0d24a50c3297c54",
|
|
25
25
|
"backend/modules/zang10/index.mjs": "4e777ad06f080bf1294b1286f1cd429f2bdc1fa5821f42031751d1022d65d8e0",
|
|
26
26
|
"backend/public/admin.css": "085ef21c7dee63aedb4b7b4eefe99b7d913581d23085933edfc270abf9720897",
|
|
27
|
-
"backend/public/admin.js": "
|
|
27
|
+
"backend/public/admin.js": "e4322fff1b0dae036c6ee0cefd03d101bdfb8579b78746751b16a7434268b8b7",
|
|
28
28
|
"backend/public/board.css": "c7a03188cfbb9f174f0375d48f511a454b60eb58dc4bf0a7e469633e43f12a91",
|
|
29
29
|
"backend/public/board.html": "e731c85e60aa1acd8ae3fca73094754b3d6b8254313e359b3d93a85a2b82d264",
|
|
30
30
|
"backend/public/board.js": "a48c3ea374a7f3e2595f4202432968bf4445f240eaf3654071a32218ad0dbadb",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"backend/public/org-mapping.js": "66ac67a2efa3405d1cb705e4d61ec20307e54142818bac6993e7585a8d5ead5b",
|
|
33
33
|
"backend/public/review.css": "6fd7366dccd877335f0897577f8cb56a30a2232fe0e779bef84d75757b78b56f",
|
|
34
34
|
"backend/public/review.js": "cd6bd9ad50e458bc13d7a6b41c6c2ad800cf297a05279a7908b02518bc4ae53c",
|
|
35
|
-
"backend/real-data/generate-dashboard.mjs": "
|
|
35
|
+
"backend/real-data/generate-dashboard.mjs": "24247052d2e4ff8b1b8dc0f13e6de98c7786ecbc149516a3b0291b7499489dc6",
|
|
36
36
|
"backend/real-data/inventory-history.mjs": "863345fc46ef2c66e1f5279823f408a7ee2b78a421574176c7221b79d44d5a50",
|
|
37
37
|
"backend/real-data/organization-mapping.mjs": "4e64d9a1930f774f24a3d8d544a9aad4877bc1f1c5010a69fbde1b022348f1c4",
|
|
38
38
|
"backend/real-data/source-payload.mjs": "87a489c4423d15ddfeda4aaba173c7e1eee6e0b57e666776b7ce4d7b70886b87",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"lib/tools.mjs": "dd920e4b586e726081b2e4e268223f708c2dd202b3f5217fcd7053405f75861b",
|
|
78
78
|
"locale/en.json": "e7a5b39324d6162e7d29957fbc7a0f4bde9c588de2000c874f058df5520f472c",
|
|
79
79
|
"locale/zh.json": "dd29dcecb35aa6e95a295af228fd39f833c1f492cc5ca41567bb6945ab134510",
|
|
80
|
-
"package-lock.json": "
|
|
81
|
-
"package.json": "
|
|
80
|
+
"package-lock.json": "1d9271123b860f6d833ba6033900c22e59792cd3d8825f2f4b98a90c96adc6bc",
|
|
81
|
+
"package.json": "2f606a3c350456eb37c1a3cf137287dd461568a8ce113b095b6bd981a44ad9f3"
|
|
82
82
|
}
|
|
83
83
|
}
|