统一:DSH 智能分析、Top100 与图表静默恢复

接入 DSH 专用运行时和对话界面,保留模型原始回答,支持会话分页、连续追问与显式报告。
补齐组合筛选、各维度 Top100、分组查询到排名图的转换,图表故障静默省略并基于保存数据自动恢复。
优化报告风格、图表顺序和表格换行,更新接入说明及构建输入。

验证:独立目录前后端构建通过;118 项 Java、102 项前端、102 项图表、14 项 DSH 应用和 13 项组合筛选检查通过。
仅提交相关源码、锁定依赖与测试;不包含凭据、会话、业务数据或本地产物。
This commit is contained in:
2026-11-12 11:57:41 +08:00
parent cc8832c8e5
commit f1a2fbd494
166 changed files with 26281 additions and 2248 deletions
@@ -20,6 +20,14 @@ test('fallback title comes from the period and scope, never the user question',
assert.notEqual(title, question);
});
test('generic titles use the topic of a verified figure while specific generated titles retain priority', () => {
assert.equal(resolveAnalysisReportTitle('质量数据分析', '', '', '2026年10月', '', '产品规格报废总重排名'),
'2026年10月 产品规格报废总重排名');
assert.equal(resolveAnalysisReportTitle('质量数据分析', '产品报废核查', '', '2026年10月', '', '产品规格报废总重排名'),
'产品报废核查');
assert.equal(resolveAnalysisReportTitle('质量数据分析', '', '', '2026年10月', ''), '2026年10月质量分析报告');
});
test('a matching Markdown H1 is removed from the body without dropping detailed report content', () => {
const markdown = '# AI生成标题\n\n## 执行摘要\n综合合格率下降。\n\n## 重点产品\n完整投入、报废重量与率变化明细。';
const body = stripDuplicateFirstMarkdownH1(markdown, 'AI生成标题');
@@ -41,8 +49,8 @@ test('download names stay concise and use a single report suffix', () => {
});
test('the complete long report retains its dimensions beyond the old canvas auto-scale limit', () => {
assert.deepEqual(longReportImageSize(900, 11912), { width: 900, height: 11912, pixelRatio: 1.5 });
assert.equal(longReportImageSize(900, 11912).height * 1.5, 17868);
assert.deepEqual(longReportImageSize(900, 11912), { width: 900, height: 11912, pixelRatio: 2 });
assert.equal(longReportImageSize(900, 11912).height * 2, 23824);
});
test('very long reports fit one bounded canvas by scaling the entire image without dropping content', () => {
@@ -54,7 +62,7 @@ test('very long reports fit one bounded canvas by scaling the entire image witho
assert.ok(height * result.pixelRatio <= 30000);
assert.ok(width * height * result.pixelRatio ** 2 <= 48000001);
}
assert.deepEqual(longReportImageSize(900, 830.2), { width: 900, height: 831, pixelRatio: 1.5 });
assert.deepEqual(longReportImageSize(900, 830.2), { width: 900, height: 831, pixelRatio: 2 });
assert.throws(() => longReportImageSize(900, NaN), /尺寸无效/);
});