From 4e655fb97755dfb42dbc36d6098e3da56a4f52da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=AB=A0=E6=B5=A9?= Date: Wed, 21 Oct 2026 18:06:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(qaops):=20=E5=A2=9E=E5=8A=A0=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E4=B8=8E=E5=85=A8=E5=91=98=E6=8F=90=E9=97=AE=E6=8E=92?= =?UTF-8?q?=E8=A1=8C=E5=8F=8A=E4=BA=94=E5=8D=81=E4=BA=BA=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 保留部门树并复用同一统计快照;区域内去重,跨区域和未归属单列,不改配置或主归属。按提问次数降序,保留零提问人员,每页50人。 验证:401项前端测试与类型检查通过,排序、区域去重、跨区域、零使用和123人三页边界红绿验证通过。 同镜像、正式网页和部署尚未验收。 --- CHANGELOG.md | 10 ++ web/src/QADepartmentStatistics.test.tsx | 2 + web/src/QADepartmentStatistics.tsx | 146 ++++++++++++--------- web/src/QAPeopleAnalysis.test.tsx | 41 ++++++ web/src/QAPeopleAnalysis.tsx | 161 ++++++++++++++++++++++++ web/src/qaDepartmentStatistics.css | 124 ++++++++++++++++++ web/src/qaPeopleAnalysis.test.ts | 60 +++++++++ web/src/qaPeopleAnalysis.ts | 78 ++++++++++++ 8 files changed, 563 insertions(+), 59 deletions(-) create mode 100644 web/src/QAPeopleAnalysis.test.tsx create mode 100644 web/src/QAPeopleAnalysis.tsx create mode 100644 web/src/qaPeopleAnalysis.test.ts create mode 100644 web/src/qaPeopleAnalysis.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index d001b83..b6c3681 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,16 @@ > `0.1.12`),由 `scripts/version.py` 从 git **算出来**;开发交付的独立说明写入本文件“开发快照”章节,并打 `snapshot/vX.Y.Z` 注释标签 ⇒ 每次开发交付均可追溯, > 但"发布版本"仍然只能由人定(CI 不会自动升版本、不会打 tag)。 +## 开发快照 snapshot/v0.1.46 - 2026-10-21 + +### Added + +- 区域统计新增“按部门/按区域/按人”分析切换;按部门保留原树形与直属人员。按区域查看已保存区域内人员,按人查看完整去重名册,均按提问次数降序并保留零提问人员,固定50人/页与页码选择,展示区域、所属部门、次数和最近提问时间。 + +### Changed + +- 新分析复用同一累计/自然月/自然周快照,不额外创建模型或聚合作业;同区域多部门人员只列一次,跨区域及未归属者单列待核对,不自动选主区域。分析分页与切换只读,不改变原问答、区域映射、部门汇总、已保存周报及外部发送闸门。 + ## 开发快照 snapshot/v0.1.45 - 2026-10-21 ### Added diff --git a/web/src/QADepartmentStatistics.test.tsx b/web/src/QADepartmentStatistics.test.tsx index af2989d..0e1e25b 100644 --- a/web/src/QADepartmentStatistics.test.tsx +++ b/web/src/QADepartmentStatistics.test.tsx @@ -6,6 +6,8 @@ import { departmentStatisticsFixture } from './qaDepartmentStatistics.fixture' it('offers all, natural-month and natural-week scopes and never switches the selected-department action to a second mapping page', () => { const html = renderToStaticMarkup() for (const label of ['按累计统计', '按自然月统计', '按自然周统计', '绑定选中部门']) expect(html).toContain(label) + for (const label of ['按部门', '按区域', '按人']) expect(html).toContain('>' + label + '<') + expect(html).toContain('aria-label="分析维度"') expect(html).not.toContain('设置选中部门的区域') expect(html).not.toContain('返回部门统计') }) diff --git a/web/src/QADepartmentStatistics.tsx b/web/src/QADepartmentStatistics.tsx index 3d450f2..98224a6 100644 --- a/web/src/QADepartmentStatistics.tsx +++ b/web/src/QADepartmentStatistics.tsx @@ -10,6 +10,8 @@ import { currentQAWeekValue } from './qaWeeks' import { bindOrganizationDepartments } from './qaOrg' import type { RegionDefinition } from './qaOrg' import { QARegions } from './QARegions' +import { PeopleAnalysisView } from './QAPeopleAnalysis' +import { departmentTime } from './qaPeopleAnalysis' import './qaDepartmentStatistics.css' import { QAPeriodInput } from './QAPeriodInput' export interface DepartmentStatisticsViewProps { @@ -21,16 +23,7 @@ export interface DepartmentStatisticsViewProps { onSelect?: (ids: string[]) => void onCollapse?: (id: string) => void } -export const departmentTime = (value: string) => - new Date(value).toLocaleString('zh-CN', { - timeZone: 'Asia/Shanghai', - year: 'numeric', - month: '2-digit', - day: '2-digit', - hour: '2-digit', - minute: '2-digit', - hour12: false, - }) +export { departmentTime } from './qaPeopleAnalysis' export function defaultStatisticsCollapsed(data: DepartmentStatisticsSnapshot): Set { const direct = new Set(data.people.flatMap((p) => p.department_ids)) return new Set( @@ -267,6 +260,7 @@ export function DepartmentRegionBinding({ } const currentWeekValue = currentQAWeekValue export function QARegionalStatistics({ onSaved }: { onSaved?: () => void } = {}) { + const [analysisMode, setAnalysisMode] = useState<'departments' | 'regions' | 'people'>('departments') const [period, setPeriod] = useState<'all' | 'month' | 'week'>('all'), [month, setMonth] = useState(currentMonth), [week, setWeek] = useState(currentWeekValue), @@ -390,6 +384,19 @@ export function QARegionalStatistics({ onSaved }: { onSaved?: () => void } = {}) +