@@ -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))
|