Files
shz-backend/docs/test-reports/job-fair/2026-07-25/bugs/BUG-025-admin-statistics-date-accessibility.md

46 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# BUG-025管理端招聘会统计日期字段缺少语义关联
- 严重级别P3可访问性与统计筛选自动化兼容性问题
- 状态:代码已修复,待测试环境浏览器复验
- 环境test
- 角色PC 监管管理员
- 入口:`/shihezi/jobfair/jobfair/fair-statistics`
- 发现时间2026-07-25
## 前置条件
使用测试环境监管管理员角色登录,进入“招聘会管理 → 招聘会数据统计”,保持默认“线上招聘会”和“按起始时间统计”。
## 复现步骤
1. 打开招聘会数据统计页面。
2. 观察“起始日期”和“结束日期”两个日期输入框。
3. 在 Chrome DevTools Console/Issues 或无障碍树中检查日期字段。
## 预期结果
起始日期和结束日期应有唯一、稳定的 `id/name`,并通过标签或 `aria-labelledby` 建立语义关联;辅助技术和自动化工具应能区分日期范围两端。
## 实际结果
页面加载后 Chrome DevTools 报告:`A form field element should have an id or name attribute (count: 2)`。两个日期字段能显示默认日期并触发统计请求,但均缺少稳定的字段标识。
## 浏览器证据
- 页面截图:[JF-AD-018-admin-fair-statistics-online.png](../screenshots/JF-AD-018-admin-fair-statistics-online.png)
- accessibility snapshot 显示“起始日期”和“结束日期”两个 textbox但未呈现对应 `id/name`
- 控制台 Issue`msgid=124 [issue] A form field element should have an id or name attribute (count: 2)`
- `GET /api/shihezi/cms/fair-statistics/summary?fairType=online&startDate=2025-07-25&endDate=2026-07-25`HTTP 200页面显示统计结果问题发生在日期筛选表单 DOM 语义层。
## 影响范围
监管管理员使用读屏、键盘辅助技术或自动化工具时,无法稳定定位统计区间起止日期;日期范围是统计结果的核心筛选条件,字段不可区分会增加误查统计的风险。
## 初步定位
统计页日期 DatePicker/Input 组件只输出了可见名称,未为两个原生字段提供稳定 `id/name` 或关联属性。统计接口和线上统计结果正常返回。
## 建议
为起始日期和结束日期补充唯一 `id/name`,使用显式标签或 `aria-labelledby` 建立关联;线上/户外切换及“统计单场”模式应共用同一字段规范,并复查 Console Issues 和键盘焦点顺序。