Repository navigation
feat(frontend): 预约记录与工单表套用设备表样式 - #33
Merged
Merged
Conversation
- 抽出 components/table.tsx:状态圆点 StateBadge(全部设备/预约/工单状态的 配色表)、设备单元格 EquipmentCell、portal 行菜单 MoreMenu 与 menuEntries, 三张表共用,设备页改为从这里引用 - 工单表:设备列显示图标、名称和编号,优先级标签跟在标题后;每行只留一个 前进动作(接单/开始处理/标记解决/关闭),取消和重新打开收进更多菜单 - 预约记录表:设备列前置,批准/拒绝和完成保留在行内,取消自己的预约收进菜单 - 工单页单独加载完整设备名录(不复用设备页已筛选的列表) - 维修员看自己的工单时显示本人姓名,而不是「维修员 #id」 - 工具栏的「+」字符换成 Icon;删除不再使用的 .entity 样式 - 测试:状态配色全覆盖、各角色的行操作、名录缺失时回退到设备编号、 菜单在滚动容器外、设备页筛选后工单仍能显示设备名
- 工单、预约、首页三处都把设备名录从 Promise.all 里拆出来,用 settle 单独等待: 页面自己的数据先显示,名录失败时设备列回退到「设备 #id」并单独提示 - 回归测试:三个页面各覆盖「主数据成功、名录失败」;改回 Promise.all 时三条均失败 - table-parts 测试复用 mountDom 创建的 root,消除重复 createRoot 的 React 警告 - AGENTS.md 前端约定补充:装饰性数据不与页面数据放进同一个 Promise.all
Emryswu
force-pushed
the
feat/table-restyle
branch
from
October 19, 2026 10:29
730169b to
326b80e
Compare
This was referenced Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#31 只改了设备表,预约记录和工单两张表还是旧样式(操作按钮平铺、灰色状态胶囊、只显示设备 ID 或名称)。这次把三张表统一,共用的部分抽成组件,避免以后各写各的。
改了什么
components/table.tsx,三张表共用:StateBadge:状态圆点,设备 / 预约 / 工单全部状态的配色在一张表STATE_TONES里EquipmentCell:设备图标 + 名称 + 编号,名录里找不到时回退到「设备 #id」MoreMenu+menuEntries:feat(equipment): 设备页改为表格,补类别筛选、详情与行内预约/报修 #31 那个 portal 行菜单,挂到 body,不被滚动容器裁切Icon;删掉不再使用的.entity样式操作的权限判断没有改,只是换了摆放位置:每个按钮出现的条件和原来一一对应。
review 修复(第二轮)
Promise.all,名录失败时已经拿到的工单也不显示。同类写法在首页和预约页本来就有,一起改了:新增settle,名录单独等待,页面数据先显示,名录失败时设备列回退到「设备 #id」并提示「设备名录加载失败」。三个页面各加一条「主数据成功、名录失败」的回归测试,改回Promise.all时三条都会失败(已验证)。AGENTS.md 前端约定补了对应一条。table-parts的用例改为复用mountDom返回的 root,React 警告消失。防止跑偏的约束
menuEntries(cond && {...}写法,类型安全)tests/table-parts.test.mjs:statusLabels里每个状态都必须在STATE_TONES有配色,新增状态忘了配色会直接失败.table-scroll外、点得到验证
npm run lint、npm run typecheck、npm test(73 项)全部通过menuEntries截图
下面是假后端(照抄 DemoDataInitializer / DemoUserInitializer 的种子数据)上的截图,我这边连不上 Maven 中央仓库,起不了真后端。README 写明截图来自真实运行的服务,所以本 PR 没有替换 README 截图,合并后需要在真后端上重拍 04、05、08(03 设备页 #31 之后也该重拍)。