fix(qa-dashboard): 区域面板注明分母是当前通讯录而非选中月份
build / build (push) Failing after 24s

This commit is contained in:
Zhero & 助理
2026-12-03 22:50:01 +08:00
committed by 姚章浩
parent d7a3aed80a
commit 07a74cf54e
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -506,7 +506,7 @@ function RegionTable({
y += h
return (
<g key={r.id}>
<title>{`${r.name};${caption};提问 ${r.questions} 次;去重使用 ${r.users ?? '未知'} 人 / ${month} 月通讯录归属 ${r.roster_people ?? '未知'} 人`}</title>
<title>{`${r.name};${caption};提问 ${r.questions} 次;去重使用 ${r.users ?? '未知'} 人 / 当前通讯录归属 ${r.roster_people ?? '未知'} 人`}</title>
{i % 2 === 0 ? <rect x={11} y={at - 15} width={box.w - 22} height={h} fill="#f7faff" /> : null}
{value !== null && i < 3 ? (
<circle cx={30} cy={at - 4} r={9} fill={['#e9bd54', '#a8b6c9', '#dc9c73'][i]} />
@@ -547,7 +547,7 @@ export function QADashboardDrawing({
week = currentQAWeek(new Date(data.week_start)),
filterLines = wrap(data.keyword ? `关键词:${data.keyword}` : '', inner - 16, 11),
heading = data.period
? `${data.period.label} · 全部指标按所选范围统计 · 区域统计按所选区间(分母为 ${new Date(Date.parse(data.month_start) + 8 * 3600000).toISOString().slice(0, 7)} 月通讯录)`
? `${data.period.label} · 全部指标按所选范围统计 · 区域统计按所选区间(分母为当前通讯录)`
: `${data.week_start.slice(0, 10)} 起的自然周${data.quality_period ? ` · 质量 ${data.quality_period.month} 月内累计` : ''} · 区域统计 ${new Date(Date.parse(data.month_start) + 8 * 3600000).toISOString().slice(0, 7)} 月累计`,
headingLines = (mobile ? [heading.split(' · ')[0], heading.split(' · ').slice(1).join(' · ')] : [heading]).flatMap(
(row) => wrap(row, inner - 16, 10.5)
@@ -609,7 +609,7 @@ export function QADashboardDrawing({
const frozen = (correctness: boolean): PlotPoint[] => historicalTrend(data, correctness)
const month = new Date(Date.parse(data.month_start) + 8 * 3600000).toISOString().slice(0, 7)
// 有 granularity 时区域面板跟所选区间走,分母仍是月度通讯录;老周看板保持"月累计"。
const regionCaption = data.period ? `所选区间提问 / 去重使用 ÷ ${month} 月通讯录` : `${month}月累计`
const regionCaption = data.period ? '所选区间提问 / 去重使用 ÷ 当前通讯录' : `${month}月累计`
const tipWidth = Math.min(334, inner),
tipLines = wrap(tip ? definitions[tip.id] : '', tipWidth - 26, 11.5),
tipHeight = tipLines.length * 15.525 + 26,
+2 -2
View File
@@ -61,8 +61,8 @@ describe('monthly dashboard range', () => {
const data = parseQADashboard(monthFixture)
const html = renderToStaticMarkup(<QADashboardView data={data} loading={false} error="" onRetry={vi.fn()} />)
expect(html).toContain('区域统计按所选区间')
expect(html).toContain('分母为 2026-11 月通讯录')
expect(html).toContain('所选区间提问 / 去重使用 ÷ 2026-11 月通讯录')
expect(html).toContain('分母为当前通讯录')
expect(html).toContain('所选区间提问 / 去重使用 ÷ 当前通讯录')
expect(html).not.toContain('2026-11月累计')
})