fix(qaops): 按人视图同步直接展示部门及列宽
build / build (push) Successful in 1m10s

按人和按区域均直接显示部门名称与完整路径悬停,统一列宽;移除不再使用的折叠摘要、模式开关和样式。统计、兼属与分页不变。

验证:按人部门直显与统一列宽回归先红后绿,14项相关测试与类型检查通过。完整门禁、候选及上线验收待执行。
This commit is contained in:
姚章浩
2026-10-24 14:33:44 +08:00
parent f38541db06
commit 1c065846f6
4 changed files with 17 additions and 29 deletions
+6
View File
@@ -76,6 +76,12 @@
> `0.1.12`),由 `scripts/version.py` 从 git **算出来**;开发交付的独立说明写入本文件“开发快照”章节,并打 `snapshot/vX.Y.Z` 注释标签 ⇒ 每次开发交付均可追溯,
> 但"发布版本"仍然只能由人定(CI 不会自动升版本、不会打 tag)。
## 开发快照 snapshot/v0.1.51 - 2026-10-24
### Changed
- 按人视图也直接展示所属部门名称,多部门逐行显示、完整路径悬停可看,去掉“个直属部门”折叠摘要;列宽与按区域统一。两个排行复用同一展示实现,移除不再使用的旧分支和样式;统计、兼属和50人分页不变。
## 开发快照 snapshot/v0.1.50 - 2026-10-24
### Changed
+9 -5
View File
@@ -24,7 +24,7 @@ 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', () => {
it('shows both regional and all-person department names inline with complete path titles', () => {
const data = fixture()
data.rows.find((d) => d.id === 'root')!.name = '研发/视觉'
const html = renderToStaticMarkup(<PeopleAnalysisView data={data} mode="regions" />)
@@ -35,17 +35,21 @@ it('shows region department names immediately with full-path titles while leavin
expect(html).not.toContain('<summary')
expect(html).not.toContain('个直属部门')
const all = renderToStaticMarkup(<PeopleAnalysisView data={data} mode="people" />)
expect(all).toContain('<summary')
expect(all).toContain('个直属部门')
expect(all).not.toContain('<summary')
expect(all).not.toContain('个直属部门')
expect(all).toContain('qa-people-departments-inline')
expect(all).toContain('title="研发/视觉/Fixture Child"')
expect(all).toContain('>研发/视觉</li>')
expect(all).toContain('>Fixture Child</li>')
})
it('widens region names and departments without changing all-person column widths', () => {
it('uses the same widened personnel and department columns in both ranking views', () => {
const data = fixture()
const widths = (mode: 'regions' | 'people') =>
[
...renderToStaticMarkup(<PeopleAnalysisView data={data} mode={mode} />).matchAll(/<col style="width:(\d+)%"/g),
].map((m) => Number(m[1]))
expect(widths('regions')).toEqual([6, 20, 9, 36, 9, 20])
expect(widths('people')).toEqual([6, 19, 16, 29, 10, 20])
expect(widths('people')).toEqual([6, 20, 9, 36, 9, 20])
})
it('region analysis lists the saved region members once and all-person analysis retains unassigned and zero-use people', () => {
const data = fixture()
+2 -16
View File
@@ -8,16 +8,14 @@ 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]
const columnWidths = [6, 20, 9, 36, 9, 20]
return (
<section
className="qa-people-ranking"
@@ -60,7 +58,7 @@ export function PeopleRankingTable({
</td>
<td className="qa-people-region-cell">{person.region_label}</td>
<td className="qa-people-paths">
{person.department_paths.length && inlineDepartments ? (
{person.department_paths.length ? (
<ul className="qa-people-departments-inline">
{person.department_paths.map((d) => (
<li key={d.id} title={d.path} aria-label={d.path}>
@@ -68,17 +66,6 @@ export function PeopleRankingTable({
</li>
))}
</ul>
) : person.department_paths.length ? (
<details>
<summary title={person.department_paths.map((d) => d.path).join(';')}>
{person.department_paths.length} 个直属部门
</summary>
<ul>
{person.department_paths.map((d) => (
<li key={d.id}>{d.path}</li>
))}
</ul>
</details>
) : (
'未关联部门'
)}
@@ -160,7 +147,6 @@ export function PeopleAnalysisView({ data, mode }: { data: DepartmentStatisticsS
page={page}
onPage={setPage}
label={mode === 'regions' ? '区域人员排行' : '全体人员排行'}
inlineDepartments={mode === 'regions'}
/>
<p className="qa-department-note">
沿用当前已同步通讯录及已保存区域配置;同一区域多部门人员去重,跨区域人员单列“跨区域待核对”,未配置者列“未归属”,不擅自裁决主归属或生成绩效结论。
-8
View File
@@ -74,14 +74,6 @@
font-size: 11px;
font-weight: 400;
}
.qa-people-paths summary {
cursor: pointer;
color: #536c88;
}
.qa-people-paths ul {
padding-left: 16px;
margin: 6px 0 0;
}
.qa-people-paths .qa-people-departments-inline {
list-style: none;
padding: 0;