From 65c4642444377b6a84b2b872dbe5c1b68bda86c4 Mon Sep 17 00:00:00 2001 From: gs Date: Tue, 29 Sep 2026 21:08:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=98=BE=E7=A4=BA=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/pages/SettingsPage.vue | 10 +- apps/web/src/pages/StatsPage.vue | 3 +- apps/web/src/pages/TimelinePage.vue | 301 +++++++++++++++----- apps/web/src/style.css | 419 +++++++++++++++++++++++++++- doc/2026-09-29.md | 22 ++ doc/README.md | 2 +- 6 files changed, 677 insertions(+), 80 deletions(-) diff --git a/apps/web/src/pages/SettingsPage.vue b/apps/web/src/pages/SettingsPage.vue index f7c5e04..9118186 100644 --- a/apps/web/src/pages/SettingsPage.vue +++ b/apps/web/src/pages/SettingsPage.vue @@ -1,5 +1,5 @@ diff --git a/apps/web/src/style.css b/apps/web/src/style.css index eec9244..a05df3f 100644 --- a/apps/web/src/style.css +++ b/apps/web/src/style.css @@ -1167,7 +1167,11 @@ button { } .page-header { - margin-bottom: 18px; + margin-bottom: 12px; +} + +.page-header h1 { + line-height: 1.15; } .stats-page { @@ -1709,6 +1713,59 @@ button { cursor: pointer; } +.record-quality-chip { + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 24px; + height: 22px; + background: #fff3cd; + color: #9a5f11; + border: 1px solid #f4d58a; + border-radius: 999px; + padding: 0 6px; + font-size: 12px; + font-weight: 900; + line-height: 1; + cursor: pointer; +} + +.record-quality-chip.soft { + background: #f8fafc; + color: #64748b; + border-color: #e2e8f0; +} + +.record-quality-chip.warning { + background: #fff3cd; + color: #9a5f11; + border-color: #f4d58a; +} + +.record-quality-note { + display: inline-flex; + width: fit-content; + margin: 0; + padding: 5px 9px; + border-radius: 8px; + background: #fff8e6; + color: #8a540d; + font-size: 12px; + font-weight: 800; + cursor: pointer; + text-align: left; +} + +.record-quality-note.soft { + background: #f8fafc; + color: #64748b; +} + +.record-quality-note.warning { + background: #fff8e6; + color: #8a540d; +} + .modal-backdrop { position: fixed; inset: 0; @@ -2170,7 +2227,7 @@ button { margin-bottom: 16px; background: #ffffff; border-radius: 14px; - padding: 12px 14px; + padding: 12px; border: 1px solid #ede8de; } @@ -2182,6 +2239,13 @@ button { gap: 10px; } +.timeline-toolbar-top { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; +} + .date-filter-box { display: flex; align-items: center; @@ -2192,6 +2256,51 @@ button { gap: 6px; } +.timeline-count-summary { + flex: 0 0 auto; + color: #65707d; + font-size: 12px; + font-weight: 800; +} + +.timeline-count-summary strong { + color: #8a540d; + font-size: 14px; +} + +.behavior-filter-row { + display: flex; + align-items: center; + flex-wrap: nowrap; + gap: 7px; + margin-top: 10px; + padding-bottom: 2px; + overflow-x: auto; + scrollbar-width: none; +} + +.behavior-filter-row::-webkit-scrollbar { + display: none; +} + +.behavior-filter-chip { + flex: 0 0 auto; + min-height: 30px; + padding: 6px 11px; + border-radius: 999px; + background: #f4efe6; + color: #5d6470; + border: 1px solid transparent; + font-size: 12px; + font-weight: 800; + cursor: pointer; +} + +.behavior-filter-chip.active { + background: #8a540d; + color: #ffffff; +} + .filter-icon { font-size: 14px; line-height: 1; @@ -2225,11 +2334,35 @@ button { } .toolbar-actions { + display: grid; + gap: 8px; + margin-top: 10px; +} + +.toolbar-actions .primary-pill-button, +.toolbar-actions .secondary-pill-button, +.toolbar-actions .sort-toggle-btn, +.toolbar-actions .manage-toggle-btn { + min-height: 34px; + justify-content: center; + white-space: nowrap; +} + +.record-action-row { display: flex; align-items: center; gap: 8px; } +.record-action-row.primary { + display: grid; + grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); +} + +.record-action-row.subtle { + justify-content: flex-end; +} + .sort-toggle-btn { background: #f8fafc; color: #475569; @@ -2255,6 +2388,23 @@ button { border-color: #93c5fd; } +.manage-toggle-btn { + min-height: 34px; + padding: 7px 13px; + border-radius: 999px; + background: #f8fafc; + color: #475569; + border: 1px solid #cbd5e1; + font-size: 12px; + font-weight: 800; +} + +.manage-toggle-btn.active { + background: #fff1cf; + color: #8a540d; + border-color: #e2be79; +} + .sort-icon { font-weight: 800; } @@ -2266,6 +2416,8 @@ button { display: flex; align-items: center; justify-content: space-between; + gap: 8px; + min-height: 18px; } .meta-filter-active strong { @@ -2328,13 +2480,227 @@ button { } .timeline-day-list { - padding: 0 14px; + padding: 0 12px 4px; } .timeline-day-list .timeline-item:last-child { border-bottom: none; } +.timeline-day-list .timeline-item { + position: relative; + display: grid; + grid-template-columns: 56px minmax(0, 1fr); + gap: 8px; + justify-content: stretch; + align-items: start; + padding: 10px 0; + cursor: default; + background: #ffffff; +} + +.timeline-day-list .timeline-item.selected { + background: #fffaf1; +} + +.timeline-day-list .timeline-item.selecting { + grid-template-columns: 28px 56px minmax(0, 1fr); +} + +.timeline-day-list .timeline-item.selected { + background: #fffaf1; +} + +.record-select-control { + align-self: start; + display: inline-flex; + align-items: center; + justify-content: center; + width: 24px; + height: 24px; + margin-top: 1px; + border-radius: 999px; + background: #ffffff; + border: 1.5px solid #d8c9b0; +} + +.record-select-control span { + display: block; + width: 10px; + height: 10px; + border-radius: 999px; + background: transparent; +} + +.record-select-control.selected { + border-color: #1f7a5c; + background: #e9f8f1; +} + +.record-select-control.selected span { + background: #1f7a5c; +} + +.timeline-item-time { + display: flex; + flex-direction: column; + gap: 3px; + justify-items: center; + align-items: center; + padding-top: 2px; + font-variant-numeric: tabular-nums; +} + +.timeline-time-value { + display: block; + color: #5a3a12; + font-size: 15px; + font-weight: 700; + letter-spacing: 0; + line-height: 1.1; +} + +.timeline-item-time .timeline-time-separator { + display: block; + width: 2px; + height: 10px; + border-radius: 999px; + background: #eadfce; + color: transparent; + font-size: 0; + line-height: 0; +} + +.timeline-item-body { + min-width: 0; + display: grid; + gap: 4px; + padding-left: 11px; + border-left: 2px solid #f1e7d6; +} + +.timeline-record-head { + display: flex; + align-items: stretch; + justify-content: space-between; + gap: 8px; +} + +.timeline-record-head strong { + min-width: 0; + color: #17202a; + font-size: 16px; + line-height: 1.25; + word-break: break-word; +} + +.timeline-record-title { + min-width: 0; + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 5px; +} + +.timeline-record-title strong { + min-width: 0; +} + +.record-card-cue { + flex: 0 0 auto; + display: inline-flex; + align-items: center; + justify-content: center; + align-self: stretch; + min-width: 30px; + min-height: 100%; + padding: 0 8px; + border-radius: 8px; + background: #eef6ff; + color: #175cd3; + font-size: 13px; + font-weight: 800; + line-height: 1; + cursor: pointer; +} + +.timeline-record-badges { + display: flex; + flex-wrap: wrap; + gap: 6px; +} + +.timeline-badge { + padding: 2px 6px; + border-radius: 6px; + font-size: 11px; + font-weight: 800; + line-height: 1.25; +} + +.timeline-badge.amount { + background: #fff1cf; + color: #8a540d; +} + +.timeline-badge.duration { + background: #eee9ff; + color: #5925dc; +} + +.timeline-record-detail { + margin: 0; + color: #65707d; + font-size: 12px; + line-height: 1.4; + word-break: break-word; + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 5px; + overflow: hidden; +} + +.timeline-record-note { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.operator-mini-badge { + flex: 0 0 auto; + display: inline-flex; + align-items: center; + min-height: 18px; + padding: 1px 6px; + border-radius: 999px; + background: #f4efe6; + color: #7a5a2b; + font-size: 11px; + font-weight: 900; +} + +.operator-mini-badge::before { + content: ""; + width: 5px; + height: 5px; + margin-right: 4px; + border-radius: 999px; + background: #c28a2c; +} + +.timeline-record-footer { + margin-top: 2px; +} + +.timeline-record-footer small { + min-width: 0; + color: #8c7853; + font-size: 12px; + font-weight: 700; +} + .timeline-empty-card { background: #ffffff; border-radius: 14px; @@ -2344,6 +2710,45 @@ button { margin-top: 16px; } +.batch-action-bar { + position: fixed; + left: 50%; + bottom: 76px; + z-index: 20; + width: min(520px, calc(100% - 28px)); + transform: translateX(-50%); + display: grid; + grid-template-columns: auto 1fr auto; + align-items: center; + gap: 10px; + padding: 10px; + border: 1px solid #eadfce; + border-radius: 16px; + background: rgba(255, 253, 250, 0.98); + box-shadow: 0 12px 30px rgba(80, 64, 43, 0.14); +} + +.batch-action-bar span { + color: #4b5563; + font-size: 13px; + font-weight: 800; + text-align: center; +} + +.batch-delete-button { + min-height: 38px; + padding: 8px 15px; + border-radius: 999px; + background: #fee4e2; + color: #b42318; + font-size: 13px; + font-weight: 900; +} + +.batch-delete-button:disabled { + opacity: 0.45; +} + .tag-badge { display: inline-block; padding: 2px 8px; @@ -2404,4 +2809,12 @@ button { .feeding-status { grid-template-columns: 1fr; } + + .toolbar-actions { + gap: 8px; + } + + .record-action-row.primary { + grid-template-columns: 1fr 1fr; + } } diff --git a/doc/2026-09-29.md b/doc/2026-09-29.md index fe86107..870031d 100644 --- a/doc/2026-09-29.md +++ b/doc/2026-09-29.md @@ -72,3 +72,25 @@ http://服务器IP:9899/api/... - 暂不引入 Thymeleaf,Vue 构建产物作为静态资源处理即可。 - 暂不引入公共 Nginx、Caddy 或 Traefik;后续多服务统一入口可以在服务器层独立推进。 - 暂不把前端构建交给 Maven 自动执行,避免后端构建强依赖 Node 环境。 + +--- + +## mobile-timeline-time-completion + +### 背景 + +照护记录页的实际使用场景以手机为主,用户补录历史记录时常常只记得大概开始时间,部分行为后续才补结束时间。此前列表更接近桌面管理表:每条记录右侧常驻编辑/删除按钮,时间、标签、备注混排,且“待补充”提示只覆盖喂奶。 + +### 目标 + +- 所有照护行为都按“可能有开始和结束时间”的记录模型展示,不把结束时间能力限制在喂奶或睡眠。 +- 没有结束时间或持续时长推导不完整时,在记录卡片内给出轻量提示,用户可点提示直接进入编辑补齐。 +- 手机端列表改为时间线扫读:左侧显示开始/结束时刻,右侧显示行为、关键标签、备注和操作,降低管理后台感。 +- 顶部记录控制区拆分为日期统计、行为筛选、补记操作和筛选状态,避免所有控件挤在同一条工具栏里。 +- 手机底部四个主 Tab 已承担导航语义,页面顶部不再展示解释性描述文字,仅保留短标题或必要上下文。 +- 默认状态下记录内容可直接阅读和复制,修改入口收敛到右侧箭头按钮;删除改为进入“管理”模式后多选批量删除,避免单条左滑删除入口不清晰和误删风险。 + +### 暂不处理 + +- 暂不修改数据库字段,继续复用 `start_time`、`end_time`、`duration_minutes`。 +- 暂不强制所有排泄记录都必须填写结束时间;当前只做可补充提示和编辑入口。 diff --git a/doc/README.md b/doc/README.md index 80824dd..f5d1868 100644 --- a/doc/README.md +++ b/doc/README.md @@ -9,7 +9,7 @@ - [2026-09-25.md](./2026-09-25.md): 2026-09-25 MVP 重构、旧原型清理与部署目录结构调整记录。 - [2026-09-26.md](./2026-09-26.md): 2026-09-26 总体架构、MVP 边界、数据模型、后端规范、前端交互、照护记录与部署流程的集中变更记录。 - [2026-09-28.md](./2026-09-28.md): 2026-09-28 统计页跨天汇总与趋势回顾调整记录。 -- [2026-09-29.md](./2026-09-29.md): 2026-09-29 Vue 静态资源打入 Spring Boot Jar、部署收敛为单后端镜像的调整记录。 +- [2026-09-29.md](./2026-09-29.md): 2026-09-29 Vue 静态资源打入 Spring Boot Jar、记录页移动端时间线和结束时间补充提示的调整记录。 ## 记录原则