diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e1ef63..1a18fdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,12 @@ > `0.1.12`),由 `scripts/version.py` 从 git **算出来**;开发交付的独立说明写入本文件“开发快照”章节,并打 `snapshot/vX.Y.Z` 注释标签 ⇒ 每次开发交付均可追溯, > 但"发布版本"仍然只能由人定(CI 不会自动升版本、不会打 tag)。 +## 开发快照 snapshot/v0.1.50 - 2026-10-24 + +### Changed + +- 按区域人员表“所属部门”直接显示部门名称,多部门逐行列出并保留完整路径悬停说明;移除该视图的“个直属部门”折叠入口。人员与部门列加宽,区域列收紧;按人视图保留原详情入口和列宽,排序、去重、周期与分页不变。 + ## 开发快照 snapshot/v0.1.49 - 2026-10-24 ### Changed diff --git a/web/src/QAPeopleAnalysis.test.tsx b/web/src/QAPeopleAnalysis.test.tsx index acfaa13..6bd8624 100644 --- a/web/src/QAPeopleAnalysis.test.tsx +++ b/web/src/QAPeopleAnalysis.test.tsx @@ -24,6 +24,29 @@ it('renders at most fifty ranked people with actual question counts and no depar expect(html).not.toContain('checkbox') expect(html).not.toContain('绑定选中部门') }) +it('shows region department names immediately with full-path titles while leaving all-person details unchanged', () => { + const data = fixture() + data.rows.find((d) => d.id === 'root')!.name = '研发/视觉' + const html = renderToStaticMarkup() + expect(html).toContain('qa-people-departments-inline') + expect(html).toContain('title="研发/视觉/Fixture Child"') + expect(html).toContain('>研发/视觉') + expect(html).toContain('>Fixture Child') + expect(html).not.toContain(') + expect(all).toContain(' { + const data = fixture() + const widths = (mode: 'regions' | 'people') => + [ + ...renderToStaticMarkup().matchAll(/ Number(m[1])) + expect(widths('regions')).toEqual([6, 20, 9, 36, 9, 20]) + expect(widths('people')).toEqual([6, 19, 16, 29, 10, 20]) +}) it('region analysis lists the saved region members once and all-person analysis retains unassigned and zero-use people', () => { const data = fixture() const region = renderToStaticMarkup() diff --git a/web/src/QAPeopleAnalysis.tsx b/web/src/QAPeopleAnalysis.tsx index 6a8dd27..8309bad 100644 --- a/web/src/QAPeopleAnalysis.tsx +++ b/web/src/QAPeopleAnalysis.tsx @@ -8,13 +8,16 @@ export function PeopleRankingTable({ page, onPage, label, + inlineDepartments = false, }: { people: PersonRankingRow[] page: number onPage: (n: number) => void label: string + inlineDepartments?: boolean }) { const window = peoplePage(people, page) + const columnWidths = inlineDepartments ? [6, 20, 9, 36, 9, 20] : [6, 19, 16, 29, 10, 20] return (
- - - - - - + {columnWidths.map((width, i) => ( + + ))} @@ -60,7 +60,15 @@ export function PeopleRankingTable({
{person.region_label} - {person.department_paths.length ? ( + {person.department_paths.length && inlineDepartments ? ( +
    + {person.department_paths.map((d) => ( +
  • + {d.name} +
  • + ))} +
+ ) : person.department_paths.length ? (
d.path).join(';')}> {person.department_paths.length} 个直属部门 @@ -152,6 +160,7 @@ export function PeopleAnalysisView({ data, mode }: { data: DepartmentStatisticsS page={page} onPage={setPage} label={mode === 'regions' ? '区域人员排行' : '全体人员排行'} + inlineDepartments={mode === 'regions'} />

沿用当前已同步通讯录及已保存区域配置;同一区域多部门人员去重,跨区域人员单列“跨区域待核对”,未配置者列“未归属”,不擅自裁决主归属或生成绩效结论。 diff --git a/web/src/qaDepartmentStatistics.css b/web/src/qaDepartmentStatistics.css index 7a17a5f..2787de2 100644 --- a/web/src/qaDepartmentStatistics.css +++ b/web/src/qaDepartmentStatistics.css @@ -82,6 +82,14 @@ padding-left: 16px; margin: 6px 0 0; } +.qa-people-paths .qa-people-departments-inline { + list-style: none; + padding: 0; + margin: 0; +} +.qa-people-departments-inline li + li { + margin-top: 4px; +} .qa-people-question-count { font-weight: 600; } diff --git a/web/src/qaPeopleAnalysis.test.ts b/web/src/qaPeopleAnalysis.test.ts index 11aee72..d20233e 100644 --- a/web/src/qaPeopleAnalysis.test.ts +++ b/web/src/qaPeopleAnalysis.test.ts @@ -13,6 +13,17 @@ it('ranks every unique roster person by questions descending including zero use expect(result.people.find((p) => p.visits === 0)?.name).toBe('') expect(JSON.stringify(data)).toBe(before) }) +it('keeps the actual department name separately from its complete path without splitting name slashes', () => { + const data = fixture() + data.rows.find((d) => d.id === 'root')!.name = '研发/视觉' + const person = peopleAnalysis(data).people.find((p) => p.visits === 2)! + expect(person.department_paths.find((d) => d.id === 'root')?.name).toBe('研发/视觉') + expect(person.department_paths.find((d) => d.id === 'child')).toEqual({ + id: 'child', + name: 'Fixture Child', + path: '研发/视觉/Fixture Child', + }) +}) it('groups same-region memberships once and separates cross-region and unassigned without choosing a primary', () => { const data = fixture() data.regions.push({ id: 'industrial', name: 'Industrial' }, { id: 'empty', name: 'Empty' }) diff --git a/web/src/qaPeopleAnalysis.ts b/web/src/qaPeopleAnalysis.ts index 723cbb4..7e821c2 100644 --- a/web/src/qaPeopleAnalysis.ts +++ b/web/src/qaPeopleAnalysis.ts @@ -15,7 +15,7 @@ export type PersonRankingRow = DepartmentPersonStatistic & { region_state: 'matched' | 'cross_region' | 'unassigned' group_key: string region_label: string - department_paths: Array<{ id: string; path: string }> + department_paths: Array<{ id: string; name: string; path: string }> } export type PeopleAnalysisGroup = { key: string; name: string; people: PersonRankingRow[]; visits: number } export function peopleAnalysis(data: DepartmentStatisticsSnapshot): { @@ -39,7 +39,7 @@ export function peopleAnalysis(data: DepartmentStatisticsSnapshot): { names.unshift(d.name) current = d.parent_id } - return { id, path: names.join('/') } + return { id, name: nodes.get(id)!.name, path: names.join('/') } }), })) .sort((a, b) => b.visits - a.visits || a.name.localeCompare(b.name, 'zh-CN') || a.key.localeCompare(b.key))