|
@@ -0,0 +1,455 @@
|
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
|
+<html lang="zh-CN">
|
|
|
|
|
+<head>
|
|
|
|
|
+<meta charset="UTF-8">
|
|
|
|
|
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
+<title>家庭工作台 · 方向 A 预览(2026-11-27)</title>
|
|
|
|
|
+<link rel="stylesheet" href="../../cfc-web/src/styles/family-workbench.tokens.css">
|
|
|
|
|
+<style>
|
|
|
|
|
+ /* ===== 基础(全部引用 tokens,禁硬编码色值)===== */
|
|
|
|
|
+ * { margin: 0; padding: 0; box-sizing: border-box; }
|
|
|
|
|
+ body {
|
|
|
|
|
+ background: var(--bg); color: var(--fg);
|
|
|
|
|
+ font-family: var(--font-sans); font-size: var(--text-body); line-height: var(--text-body-lh); line-height: var(--leading-normal);
|
|
|
|
|
+ }
|
|
|
|
|
+ button { font-family: inherit; cursor: pointer; }
|
|
|
|
|
+ :focus-visible { outline: 2px solid var(--primary-active); outline-offset: 2px; }
|
|
|
|
|
+
|
|
|
|
|
+ /* ===== 演示控制条(仅预览用,非产品元素)===== */
|
|
|
|
|
+ .demo-bar {
|
|
|
|
|
+ display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
|
|
|
|
|
+ padding: var(--space-2) var(--space-4); background: var(--surface-2);
|
|
|
|
|
+ border-bottom: 1px solid var(--border); font-size: var(--text-caption); line-height: var(--text-caption-lh); color: var(--fg-muted);
|
|
|
|
|
+ }
|
|
|
|
|
+ .demo-bar b { color: var(--fg); font-weight: var(--weight-medium); }
|
|
|
|
|
+ .demo-bar .demo-btn {
|
|
|
|
|
+ border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg);
|
|
|
|
|
+ border-radius: var(--radius-control); padding: 2px 10px; font-size: var(--text-caption); line-height: var(--text-caption-lh);
|
|
|
|
|
+ }
|
|
|
|
|
+ .demo-bar .demo-btn.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
|
|
|
|
|
+
|
|
|
|
|
+ /* ===== 页头 56px ===== */
|
|
|
|
|
+ .wb-header {
|
|
|
|
|
+ height: var(--wb-header-h); display: flex; align-items: center; justify-content: space-between;
|
|
|
|
|
+ padding: 0 var(--space-6); background: var(--surface); border-bottom: 1px solid var(--border);
|
|
|
|
|
+ }
|
|
|
|
|
+ .wb-header-left { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
|
|
|
|
|
+ .wb-back {
|
|
|
|
|
+ display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border-strong);
|
|
|
|
|
+ background: var(--surface); color: var(--fg); border-radius: var(--radius-control);
|
|
|
|
|
+ height: 32px; padding: 0 12px; font-size: var(--text-body); line-height: var(--text-body-lh);
|
|
|
|
|
+ }
|
|
|
|
|
+ .wb-back:hover { color: var(--primary-hover); border-color: var(--primary-hover); }
|
|
|
|
|
+ .wb-title { font-size: var(--text-title); line-height: var(--text-title-lh); font-weight: var(--weight-semibold); }
|
|
|
|
|
+ .wb-sub { font-size: var(--text-caption); line-height: var(--text-caption-lh); color: var(--fg-muted); }
|
|
|
|
|
+ .wb-sub .adm-num { font-variant-numeric: tabular-nums; }
|
|
|
|
|
+
|
|
|
|
|
+ /* ===== 按钮 ===== */
|
|
|
|
|
+ .btn {
|
|
|
|
|
+ display: inline-flex; align-items: center; justify-content: center; gap: 4px;
|
|
|
|
|
+ height: 32px; padding: 0 15px; border-radius: var(--radius-control); font-size: var(--text-body); line-height: var(--text-body-lh);
|
|
|
|
|
+ border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg);
|
|
|
|
|
+ transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
|
|
|
|
|
+ }
|
|
|
|
|
+ .btn:hover { color: var(--primary-hover); border-color: var(--primary-hover); }
|
|
|
|
|
+ .btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
|
|
|
|
|
+ .btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
|
|
|
|
|
+ .btn-sm { height: 28px; padding: 0 12px; font-size: var(--text-caption); line-height: var(--text-caption-lh); }
|
|
|
|
|
+ .btn-text { border: none; background: none; color: var(--primary); padding: 0 2px; min-height: 24px; min-width: 24px; }
|
|
|
|
|
+ .btn-text:hover { color: var(--primary-hover); background: none; }
|
|
|
|
|
+
|
|
|
|
|
+ /* ===== KPI 条 52px ===== */
|
|
|
|
|
+ .wb-kpi {
|
|
|
|
|
+ min-height: var(--wb-kpi-h); display: flex; align-items: center; gap: var(--wb-kpi-gap);
|
|
|
|
|
+ padding: 0 var(--space-6); background: var(--bg); overflow-x: auto;
|
|
|
|
|
+ }
|
|
|
|
|
+ .wb-kpi-item {
|
|
|
|
|
+ display: flex; flex-direction: column; justify-content: center; gap: 2px;
|
|
|
|
|
+ border: none; background: none; text-align: left; padding: var(--space-1) 0;
|
|
|
|
|
+ position: relative; flex: 0 0 auto;
|
|
|
|
|
+ }
|
|
|
|
|
+ .wb-kpi-item .k-label { font-size: var(--wb-kpi-label-size); color: var(--fg-muted); line-height: 18px; }
|
|
|
|
|
+ .wb-kpi-item .k-value {
|
|
|
|
|
+ font-size: var(--wb-kpi-value-size); font-weight: var(--weight-semibold); color: var(--fg);
|
|
|
|
|
+ line-height: 28px; font-variant-numeric: tabular-nums;
|
|
|
|
|
+ transition: color var(--dur-fast) var(--ease-standard);
|
|
|
|
|
+ }
|
|
|
|
|
+ .wb-kpi-item:hover .k-value { color: var(--primary); }
|
|
|
|
|
+ .wb-kpi-item.is-active .k-value { color: var(--primary); }
|
|
|
|
|
+ .wb-kpi-item.is-active::after {
|
|
|
|
|
+ content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary);
|
|
|
|
|
+ }
|
|
|
|
|
+ .wb-kpi-item .k-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); display: inline-block; margin-left: 4px; vertical-align: 4px; }
|
|
|
|
|
+
|
|
|
|
|
+ /* ===== 主体:左导航 + 右内容 ===== */
|
|
|
|
|
+ .wb-shell { display: flex; gap: var(--space-4); padding: var(--space-4) var(--space-6); align-items: flex-start; }
|
|
|
|
|
+ .wb-nav {
|
|
|
|
|
+ width: var(--wb-nav-w); flex: 0 0 auto; background: var(--surface);
|
|
|
|
|
+ border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card);
|
|
|
|
|
+ padding: var(--space-2); position: sticky; top: var(--space-4);
|
|
|
|
|
+ }
|
|
|
|
|
+ .wb-nav-group { font-size: var(--text-caption); line-height: var(--text-caption-lh); color: var(--fg-muted); padding: var(--space-2) var(--space-3) var(--space-1); }
|
|
|
|
|
+ .wb-nav-item {
|
|
|
|
|
+ display: flex; align-items: center; gap: var(--space-2); width: 100%;
|
|
|
|
|
+ height: var(--wb-nav-item-h); padding: 0 var(--space-3); border: none; background: none;
|
|
|
|
|
+ border-radius: var(--radius-md); color: var(--fg-muted); font-size: var(--text-body); line-height: var(--text-body-lh); text-align: left;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
|
|
|
|
|
+ }
|
|
|
|
|
+ .wb-nav-item:hover { background: var(--surface-2); color: var(--fg); }
|
|
|
|
|
+ .wb-nav-item.is-active { background: var(--info-bg); color: var(--primary); font-weight: var(--weight-medium); }
|
|
|
|
|
+ .wb-nav-item.is-active::before {
|
|
|
|
|
+ content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: var(--wb-nav-bar-w);
|
|
|
|
|
+ background: var(--primary); border-radius: 0 2px 2px 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ .wb-nav-item .n-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); flex: 0 0 auto; }
|
|
|
|
|
+ .wb-nav-item .n-count { margin-left: auto; font-size: var(--text-caption); line-height: var(--text-caption-lh); color: var(--fg-muted); font-variant-numeric: tabular-nums; }
|
|
|
|
|
+
|
|
|
|
|
+ .wb-main { flex: 1 1 auto; min-width: 0; }
|
|
|
|
|
+ .wb-panel {
|
|
|
|
|
+ background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
|
|
|
|
|
+ box-shadow: var(--shadow-card); overflow: hidden;
|
|
|
|
|
+ }
|
|
|
|
|
+ .wb-panel-head {
|
|
|
|
|
+ min-height: var(--wb-panel-head-h); display: flex; align-items: center; justify-content: space-between;
|
|
|
|
|
+ gap: var(--space-3); padding: var(--space-2) var(--wb-panel-pad); border-bottom: 1px solid var(--border);
|
|
|
|
|
+ }
|
|
|
|
|
+ .wb-panel-title { font-size: var(--text-title); line-height: var(--text-title-lh); font-weight: var(--weight-medium); }
|
|
|
|
|
+ .wb-panel-head .head-actions { display: flex; align-items: center; gap: var(--space-2); }
|
|
|
|
|
+
|
|
|
|
|
+ /* 曲线区 120px */
|
|
|
|
|
+ .wb-curve { height: var(--wb-curve-h); padding: var(--space-2) var(--wb-panel-pad); border-bottom: 1px solid var(--border); }
|
|
|
|
|
+ .wb-curve svg { display: block; width: 100%; height: 100%; }
|
|
|
|
|
+ .curve-empty {
|
|
|
|
|
+ height: 100%; display: flex; align-items: center; justify-content: center;
|
|
|
|
|
+ background: var(--surface-2); border-radius: var(--radius-md);
|
|
|
|
|
+ font-size: var(--text-caption); line-height: var(--text-caption-lh); color: var(--fg-muted);
|
|
|
|
|
+ }
|
|
|
|
|
+ .curve-tip { font-size: var(--text-caption); line-height: var(--text-caption-lh); color: var(--fg-muted); margin-bottom: 2px; }
|
|
|
|
|
+
|
|
|
|
|
+ /* 工具栏 */
|
|
|
|
|
+ .wb-toolbar {
|
|
|
|
|
+ display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
|
|
|
|
|
+ padding: var(--space-3) var(--wb-panel-pad); border-bottom: 1px solid var(--border);
|
|
|
|
|
+ }
|
|
|
|
|
+ .wb-toolbar .t-right { margin-left: auto; display: flex; gap: var(--space-2); }
|
|
|
|
|
+ .sel {
|
|
|
|
|
+ height: 32px; border: 1px solid var(--border-strong); border-radius: var(--radius-md);
|
|
|
|
|
+ background: var(--surface); color: var(--fg); font-size: var(--text-body); line-height: var(--text-body-lh); padding: 0 var(--space-2);
|
|
|
|
|
+ }
|
|
|
|
|
+ .sel:hover { border-color: var(--primary-hover); }
|
|
|
|
|
+
|
|
|
|
|
+ /* 表格 */
|
|
|
|
|
+ .wb-table { width: 100%; border-collapse: collapse; font-size: var(--text-table); line-height: var(--text-table-lh); }
|
|
|
|
|
+ .wb-table th {
|
|
|
|
|
+ background: var(--surface-2); color: var(--fg); font-weight: var(--weight-medium);
|
|
|
|
|
+ height: 36px; padding: 0 var(--space-2); text-align: left; border-bottom: 1px solid var(--border);
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ }
|
|
|
|
|
+ .wb-table td { padding: 6px var(--space-2); border-bottom: 1px solid var(--border); color: var(--fg); }
|
|
|
|
|
+ .wb-table tbody tr:hover { background: var(--surface-2); }
|
|
|
|
|
+ .wb-table .num { text-align: right; font-variant-numeric: tabular-nums; }
|
|
|
|
|
+ .wb-pager { display: flex; justify-content: flex-end; gap: var(--space-1); padding: var(--space-3) var(--wb-panel-pad); }
|
|
|
|
|
+ .pg {
|
|
|
|
|
+ min-width: 28px; height: 28px; border: 1px solid var(--border); background: var(--surface);
|
|
|
|
|
+ border-radius: var(--radius-md); font-size: var(--text-caption); line-height: var(--text-caption-lh); color: var(--fg-muted);
|
|
|
|
|
+ }
|
|
|
|
|
+ .pg.is-active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
|
|
|
|
|
+ .pg:hover:not(.is-active) { color: var(--primary); border-color: var(--primary-hover); }
|
|
|
|
|
+
|
|
|
|
|
+ /* 状态三件套标签(无边框,scoped fix 3)*/
|
|
|
|
|
+ .adm-status {
|
|
|
|
|
+ display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; font-size: var(--text-caption); line-height: var(--text-caption-lh);
|
|
|
|
|
+ line-height: 20px; border-radius: var(--radius-sm); white-space: nowrap; border: 1px solid transparent;
|
|
|
|
|
+ }
|
|
|
|
|
+ .adm-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
|
|
|
|
|
+ .adm-status--success { background: var(--success-bg); color: var(--success-text); }
|
|
|
|
|
+ .adm-status--warning { background: var(--warning-bg); color: var(--warning-text); }
|
|
|
|
|
+ .adm-status--info { background: var(--info-bg); color: var(--info-text); }
|
|
|
|
|
+ .adm-status--danger { background: var(--danger-bg); color: var(--danger-text); }
|
|
|
|
|
+ .adm-status--default { background: var(--surface-2); color: var(--fg-muted); }
|
|
|
|
|
+
|
|
|
|
|
+ /* 五态 */
|
|
|
|
|
+ .state-loading { padding: var(--wb-panel-pad); }
|
|
|
|
|
+ .sk { background: var(--surface-2); border-radius: var(--radius-md); animation: skpulse 1.2s var(--ease-standard) infinite; }
|
|
|
|
|
+ @keyframes skpulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
|
|
|
|
|
+ .sk-row { height: 40px; margin-bottom: var(--space-2); }
|
|
|
|
|
+ .state-empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-12) 0; color: var(--fg-muted); }
|
|
|
|
|
+ .state-error {
|
|
|
|
|
+ display: flex; align-items: center; gap: var(--space-3); margin: var(--wb-panel-pad);
|
|
|
|
|
+ padding: var(--space-3); background: var(--danger-bg); color: var(--danger-text);
|
|
|
|
|
+ border-radius: var(--radius-md); font-size: var(--text-body); line-height: var(--text-body-lh);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 表单抽屉(520px,仅表单)*/
|
|
|
|
|
+ .drawer-mask {
|
|
|
|
|
+ position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: var(--z-overlay);
|
|
|
|
|
+ display: none; opacity: 0; transition: opacity var(--dur-base) var(--ease-standard);
|
|
|
|
|
+ }
|
|
|
|
|
+ .drawer-mask.is-open { display: block; opacity: 1; }
|
|
|
|
|
+ .wb-drawer {
|
|
|
|
|
+ position: fixed; top: 0; right: 0; bottom: 0; width: var(--wb-form-w); max-width: 92vw;
|
|
|
|
|
+ background: var(--surface); box-shadow: var(--shadow-popup); z-index: var(--z-drawer);
|
|
|
|
|
+ transform: translateX(100%); transition: transform var(--dur-slow) var(--ease-standard);
|
|
|
|
|
+ display: flex; flex-direction: column;
|
|
|
|
|
+ }
|
|
|
|
|
+ .wb-drawer.is-open { transform: translateX(0); }
|
|
|
|
|
+ .drawer-head {
|
|
|
|
|
+ display: flex; align-items: center; justify-content: space-between;
|
|
|
|
|
+ padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border);
|
|
|
|
|
+ }
|
|
|
|
|
+ .drawer-title { font-size: var(--text-title); line-height: var(--text-title-lh); font-weight: var(--weight-medium); }
|
|
|
|
|
+ .drawer-close { border: none; background: none; color: var(--fg-muted); font-size: 18px; line-height: 1; padding: 4px; }
|
|
|
|
|
+ .drawer-close:hover { color: var(--primary); }
|
|
|
|
|
+ .drawer-body { flex: 1 1 auto; overflow: auto; padding: var(--space-4); }
|
|
|
|
|
+ .form-item { margin-bottom: var(--space-4); }
|
|
|
|
|
+ .form-item label { display: block; font-size: var(--text-body); line-height: var(--text-body-lh); color: var(--fg-muted); font-weight: var(--weight-medium); margin-bottom: var(--space-1); }
|
|
|
|
|
+ .form-item .inp {
|
|
|
|
|
+ width: 100%; height: 32px; border: 1px solid var(--border-strong); border-radius: var(--radius-md);
|
|
|
|
|
+ padding: 0 var(--space-2); font-size: var(--text-body); line-height: var(--text-body-lh); color: var(--fg); font-family: inherit;
|
|
|
|
|
+ }
|
|
|
|
|
+ .form-item .inp:focus { border-color: var(--primary); }
|
|
|
|
|
+ .form-item .inp::placeholder { color: var(--fg-muted); }
|
|
|
|
|
+ .form-item .err { font-size: var(--text-caption); line-height: var(--text-caption-lh); color: var(--danger-text); margin-top: var(--space-1); }
|
|
|
|
|
+ .drawer-foot { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }
|
|
|
|
|
+
|
|
|
|
|
+ /* ===== 响应式(五档断点)===== */
|
|
|
|
|
+ @media (max-width: 1023px) { .wb-nav { width: var(--wb-nav-w-compact); } }
|
|
|
|
|
+ @media (max-width: 767px) {
|
|
|
|
|
+ .wb-shell { flex-direction: column; }
|
|
|
|
|
+ .wb-nav { width: 100%; position: static; display: flex; overflow-x: auto; gap: var(--space-2); padding: var(--space-2); }
|
|
|
|
|
+ .wb-nav-group { display: none; }
|
|
|
|
|
+ .wb-nav-item { flex: 0 0 auto; }
|
|
|
|
|
+ .wb-nav-item.is-active::before { display: none; }
|
|
|
|
|
+ .wb-kpi { flex-wrap: wrap; height: auto; }
|
|
|
|
|
+ .wb-header { flex-wrap: wrap; height: auto; padding: var(--space-3) var(--space-4); gap: var(--space-2); }
|
|
|
|
|
+ }
|
|
|
|
|
+ @media (max-width: 479px) { .wb-toolbar .t-right { margin-left: 0; } }
|
|
|
|
|
+ @media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
|
|
|
|
|
+</style>
|
|
|
|
|
+</head>
|
|
|
|
|
+<body>
|
|
|
|
|
+
|
|
|
|
|
+<!-- 演示控制条(非产品元素,用于查看五态与抽屉) -->
|
|
|
|
|
+<div class="demo-bar">
|
|
|
|
|
+ <b>演示控制</b>
|
|
|
|
|
+ <span>面板状态:</span>
|
|
|
|
|
+ <button class="demo-btn is-on" data-state="data">有数据</button>
|
|
|
|
|
+ <button class="demo-btn" data-state="loading">加载中</button>
|
|
|
|
|
+ <button class="demo-btn" data-state="empty">空数据</button>
|
|
|
|
|
+ <button class="demo-btn" data-state="error">错误</button>
|
|
|
|
|
+ <button class="demo-btn" id="drawerToggle">打开表单抽屉</button>
|
|
|
|
|
+ <span>(导航项 / KPI 可点击切换模块)</span>
|
|
|
|
|
+</div>
|
|
|
|
|
+
|
|
|
|
|
+<!-- 页头 56px -->
|
|
|
|
|
+<header class="wb-header">
|
|
|
|
|
+ <div class="wb-header-left">
|
|
|
|
|
+ <button class="wb-back" type="button">
|
|
|
|
|
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 18 9 12 15 6"></polyline></svg>
|
|
|
|
|
+ 返回家庭列表
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <span class="wb-title">家庭工作台</span>
|
|
|
|
|
+ <span class="wb-sub">张三家(邀请码 <span class="adm-num">FAM-8F2K</span>)· 成员 <span class="adm-num">4</span> 人 · 创建于 <span class="adm-num">2026-03-12</span></span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="head-actions">
|
|
|
|
|
+ <button class="btn btn-primary" type="button" onclick="document.getElementById('drawerToggle').click()">
|
|
|
|
|
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
|
|
|
|
|
+ 新增任务
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</header>
|
|
|
|
|
+
|
|
|
|
|
+<!-- KPI 条 52px(后端 6 卡 1:1;点击 = 切换左导航) -->
|
|
|
|
|
+<div class="wb-kpi" id="kpiStrip" role="tablist" aria-label="家庭统计">
|
|
|
|
|
+ <button class="wb-kpi-item is-active" data-module="reports" role="tab" aria-selected="true"><span class="k-label">报告</span><span class="k-value">12</span></button>
|
|
|
|
|
+ <button class="wb-kpi-item" data-module="plans" role="tab" aria-selected="false"><span class="k-label">方案</span><span class="k-value">3</span><span class="k-dot" title="2 个待审核"></span></button>
|
|
|
|
|
+ <button class="wb-kpi-item" data-module="tasks" role="tab" aria-selected="false"><span class="k-label">任务</span><span class="k-value">28</span><span class="k-dot" title="5 个待办"></span></button>
|
|
|
|
|
+ <button class="wb-kpi-item" data-module="cf" role="tab" aria-selected="false"><span class="k-label">CF值</span><span class="k-value">1,280</span></button>
|
|
|
|
|
+ <button class="wb-kpi-item" data-module="messages" role="tab" aria-selected="false"><span class="k-label">消息</span><span class="k-value">5</span></button>
|
|
|
|
|
+ <button class="wb-kpi-item" data-module="coupons" role="tab" aria-selected="false"><span class="k-label">优惠券</span><span class="k-value">6</span></button>
|
|
|
|
|
+</div>
|
|
|
|
|
+
|
|
|
|
|
+<div class="wb-shell">
|
|
|
|
|
+ <!-- 左竖向导航(单一导航轴;● = 有待办) -->
|
|
|
|
|
+ <nav class="wb-nav" id="wbNav" aria-label="家庭模块">
|
|
|
|
|
+ <div class="wb-nav-group">健康与方案</div>
|
|
|
|
|
+ <button class="wb-nav-item is-active" data-module="reports"><span class="n-dot"></span>报告</button>
|
|
|
|
|
+ <button class="wb-nav-item" data-module="plans"><span class="n-dot"></span>方案</button>
|
|
|
|
|
+ <button class="wb-nav-item" data-module="tasks">任务</button>
|
|
|
|
|
+ <button class="wb-nav-item" data-module="cf">CF值</button>
|
|
|
|
|
+ <div class="wb-nav-group">成长与激励</div>
|
|
|
|
|
+ <button class="wb-nav-item" data-module="children">孩子管理</button>
|
|
|
|
|
+ <button class="wb-nav-item" data-module="points">积分记录</button>
|
|
|
|
|
+ <button class="wb-nav-item" data-module="wishes">心愿</button>
|
|
|
|
|
+ <button class="wb-nav-item" data-module="rewards">奖励</button>
|
|
|
|
|
+ <div class="wb-nav-group">资产与沟通</div>
|
|
|
|
|
+ <button class="wb-nav-item" data-module="coupons">优惠券<span class="n-count">6</span></button>
|
|
|
|
|
+ <button class="wb-nav-item" data-module="earnings">收益</button>
|
|
|
|
|
+ <button class="wb-nav-item" data-module="messages">消息<span class="n-count">5</span></button>
|
|
|
|
|
+ </nav>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 右内容区 -->
|
|
|
|
|
+ <main class="wb-main">
|
|
|
|
|
+ <section class="wb-panel" id="panel">
|
|
|
|
|
+ <div class="wb-panel-head">
|
|
|
|
|
+ <span class="wb-panel-title" id="panelTitle">报告</span>
|
|
|
|
|
+ <div class="head-actions">
|
|
|
|
|
+ <button class="btn btn-sm btn-primary" type="button">代传报告</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 指标曲线 120px(card.series 30 天,迁自原统计卡) -->
|
|
|
|
|
+ <div class="wb-curve" id="curveBox">
|
|
|
|
|
+ <div class="curve-tip">近 30 天趋势(数据源:卡片 series)</div>
|
|
|
|
|
+ <svg viewBox="0 0 600 96" preserveAspectRatio="none" role="img" aria-label="近 30 天报告数量趋势">
|
|
|
|
|
+ <defs>
|
|
|
|
|
+ <linearGradient id="areaGrad" x1="0" y1="0" x2="0" y2="1">
|
|
|
|
|
+ <stop offset="0%" stop-color="var(--primary)" stop-opacity="0.10"/>
|
|
|
|
|
+ <stop offset="100%" stop-color="var(--primary)" stop-opacity="0.01"/>
|
|
|
|
|
+ </linearGradient>
|
|
|
|
|
+ </defs>
|
|
|
|
|
+ <path d="M0,80 L40,74 L80,78 L120,62 L160,66 L200,52 L240,58 L280,44 L320,50 L360,38 L400,42 L440,30 L480,36 L520,26 L560,32 L600,22 L600,96 L0,96 Z" fill="url(#areaGrad)"/>
|
|
|
|
|
+ <path d="M0,80 L40,74 L80,78 L120,62 L160,66 L200,52 L240,58 L280,44 L320,50 L360,38 L400,42 L440,30 L480,36 L520,26 L560,32 L600,22" fill="none" stroke="var(--primary)" stroke-width="1.5" vector-effect="non-scaling-stroke"/>
|
|
|
|
|
+ </svg>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 工具栏 -->
|
|
|
|
|
+ <div class="wb-toolbar">
|
|
|
|
|
+ <select class="sel" aria-label="状态筛选"><option>全部状态</option><option>已完成</option><option>解析中</option><option>待处理</option><option>失败</option></select>
|
|
|
|
|
+ <select class="sel" aria-label="成员筛选"><option>全部成员</option><option>张三</option><option>李四</option></select>
|
|
|
|
|
+ <div class="t-right">
|
|
|
|
|
+ <button class="btn btn-sm" type="button">刷新</button>
|
|
|
|
|
+ <button class="btn btn-sm" type="button">导出</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 五态容器:有数据 / 加载中 / 空 / 错误 -->
|
|
|
|
|
+ <div id="stateData">
|
|
|
|
|
+ <table class="wb-table">
|
|
|
|
|
+ <thead><tr><th>日期</th><th>成员</th><th>类型</th><th class="num">综合分</th><th>状态</th><th>操作</th></tr></thead>
|
|
|
|
|
+ <tbody>
|
|
|
|
|
+ <tr><td class="adm-num">2026-11-20</td><td>张三</td><td>肠道菌群检测</td><td class="num">82</td><td><span class="adm-status adm-status--success">已完成</span></td><td><button class="btn-text" type="button">查看</button></td></tr>
|
|
|
|
|
+ <tr><td class="adm-num">2026-11-18</td><td>李四</td><td>肠道菌群检测</td><td class="num">76</td><td><span class="adm-status adm-status--success">已完成</span></td><td><button class="btn-text" type="button">查看</button></td></tr>
|
|
|
|
|
+ <tr><td class="adm-num">2026-11-15</td><td>张三</td><td>DAN 心理测评</td><td class="num">—</td><td><span class="adm-status adm-status--info">解析中</span></td><td><button class="btn-text" type="button">查看</button></td></tr>
|
|
|
|
|
+ <tr><td class="adm-num">2026-11-12</td><td>王五</td><td>肠道菌群检测</td><td class="num">—</td><td><span class="adm-status adm-status--warning">待处理</span></td><td><button class="btn-text" type="button">查看</button></td></tr>
|
|
|
|
|
+ <tr><td class="adm-num">2026-11-08</td><td>张三</td><td>年度体检</td><td class="num">65</td><td><span class="adm-status adm-status--danger">失败</span></td><td><button class="btn-text" type="button">重试</button></td></tr>
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ <div class="wb-pager">
|
|
|
|
|
+ <button class="pg" type="button" aria-label="上一页">‹</button>
|
|
|
|
|
+ <button class="pg is-active" type="button">1</button>
|
|
|
|
|
+ <button class="pg" type="button">2</button>
|
|
|
|
|
+ <button class="pg" type="button">3</button>
|
|
|
|
|
+ <button class="pg" type="button" aria-label="下一页">›</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div id="stateLoading" class="state-loading" hidden>
|
|
|
|
|
+ <div class="sk sk-row"></div><div class="sk sk-row"></div><div class="sk sk-row"></div><div class="sk sk-row"></div><div class="sk sk-row"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div id="stateEmpty" class="state-empty" hidden>
|
|
|
|
|
+ <svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="9" y1="15" x2="15" y2="15"/></svg>
|
|
|
|
|
+ <span>暂无报告,可通过上方「代传报告」上传</span>
|
|
|
|
|
+ <button class="btn btn-sm btn-primary" type="button">去代传报告</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div id="stateError" class="state-error" hidden>
|
|
|
|
|
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
|
|
|
|
|
+ <span>加载失败,请稍后重试</span>
|
|
|
|
|
+ <button class="btn-text" type="button" style="color: var(--danger-text); text-decoration: underline;">重试</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </section>
|
|
|
|
|
+ </main>
|
|
|
|
|
+</div>
|
|
|
|
|
+
|
|
|
|
|
+<!-- 表单抽屉(520px,仅新增/编辑表单;列表已全部出抽屉) -->
|
|
|
|
|
+<div class="drawer-mask" id="drawerMask"></div>
|
|
|
|
|
+<aside class="wb-drawer" id="wbDrawer" role="dialog" aria-modal="true" aria-label="新增任务">
|
|
|
|
|
+ <div class="drawer-head">
|
|
|
|
|
+ <span class="drawer-title">新增任务</span>
|
|
|
|
|
+ <button class="drawer-close" id="drawerClose" type="button" aria-label="关闭">✕</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="drawer-body">
|
|
|
|
|
+ <div class="form-item">
|
|
|
|
|
+ <label for="f-title">标题</label>
|
|
|
|
|
+ <input class="inp" id="f-title" type="text" placeholder="请输入任务标题">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-item">
|
|
|
|
|
+ <label for="f-points">积分</label>
|
|
|
|
|
+ <input class="inp" id="f-points" type="number" min="0" value="10">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-item">
|
|
|
|
|
+ <label for="f-type">类型</label>
|
|
|
|
|
+ <select class="sel" id="f-type" style="width:100%"><option>一次性</option><option>循环</option></select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-item">
|
|
|
|
|
+ <label for="f-desc">描述</label>
|
|
|
|
|
+ <input class="inp" id="f-desc" type="text" placeholder="选填">
|
|
|
|
|
+ <div class="err">示例:校验错误就近显示在字段下方</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="drawer-foot">
|
|
|
|
|
+ <button class="btn" id="drawerCancel" type="button">取消</button>
|
|
|
|
|
+ <button class="btn btn-primary" type="button">保存</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</aside>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+ // 模块清单(与规范 §7.3 一致)
|
|
|
|
|
+ var MODULES = {
|
|
|
|
|
+ reports: { title: '报告', note: '代传上传 + 解析预览 + 列表 + 曲线(原抽屉改为面板)' },
|
|
|
|
|
+ plans: { title: '方案', note: '方案列表 + 待审角标 + 审核入口(原抽屉改为面板)' },
|
|
|
|
|
+ tasks: { title: '任务', note: '任务列表 + 执行率统计 + 创建任务(表单收 520px 抽屉)' },
|
|
|
|
|
+ cf: { title: 'CF值', note: '成员余额表 + 合计 + 流水(原抽屉改为面板)' },
|
|
|
|
|
+ messages: { title: '消息', note: '会话列表 → 消息时间线两级(只读,原抽屉改为面板)' },
|
|
|
|
|
+ children: { title: '孩子管理', note: '复用既有 ChildrenPanel 组件(familyId 锁定),本期仅样式对齐' },
|
|
|
|
|
+ points: { title: '积分记录', note: '复用既有 PointsPanel 组件,本期仅样式对齐' },
|
|
|
|
|
+ wishes: { title: '心愿', note: '复用既有 WishesPanel 组件,本期仅样式对齐' },
|
|
|
|
|
+ rewards: { title: '奖励', note: '复用既有 RewardsPanel 组件,本期仅样式对齐' },
|
|
|
|
|
+ coupons: { title: '优惠券', note: '复用既有 FamilyCouponPanel 组件,本期仅样式对齐' },
|
|
|
|
|
+ earnings: { title: '收益', note: '复用既有 FamilyEarningsPanel 组件,本期仅样式对齐' }
|
|
|
|
|
+ };
|
|
|
|
|
+ var panelTitle = document.getElementById('panelTitle');
|
|
|
|
|
+ var kpiItems = document.querySelectorAll('.wb-kpi-item');
|
|
|
|
|
+ var navItems = document.querySelectorAll('.wb-nav-item');
|
|
|
|
|
+
|
|
|
|
|
+ function activate(module) {
|
|
|
|
|
+ kpiItems.forEach(function (el) {
|
|
|
|
|
+ var on = el.getAttribute('data-module') === module;
|
|
|
|
|
+ el.classList.toggle('is-active', on);
|
|
|
|
|
+ el.setAttribute('aria-selected', on ? 'true' : 'false');
|
|
|
|
|
+ });
|
|
|
|
|
+ navItems.forEach(function (el) {
|
|
|
|
|
+ el.classList.toggle('is-active', el.getAttribute('data-module') === module);
|
|
|
|
|
+ });
|
|
|
|
|
+ panelTitle.textContent = MODULES[module].title + '(' + MODULES[module].note + ')';
|
|
|
|
|
+ }
|
|
|
|
|
+ kpiItems.forEach(function (el) { el.addEventListener('click', function () { activate(el.getAttribute('data-module')); }); });
|
|
|
|
|
+ navItems.forEach(function (el) { el.addEventListener('click', function () { activate(el.getAttribute('data-module')); }); });
|
|
|
|
|
+
|
|
|
|
|
+ // 五态演示
|
|
|
|
|
+ var stateBtns = document.querySelectorAll('.demo-btn[data-state]');
|
|
|
|
|
+ var states = { data: document.getElementById('stateData'), loading: document.getElementById('stateLoading'), empty: document.getElementById('stateEmpty'), error: document.getElementById('stateError') };
|
|
|
|
|
+ stateBtns.forEach(function (btn) {
|
|
|
|
|
+ btn.addEventListener('click', function () {
|
|
|
|
|
+ stateBtns.forEach(function (b) { b.classList.remove('is-on'); });
|
|
|
|
|
+ btn.classList.add('is-on');
|
|
|
|
|
+ Object.keys(states).forEach(function (k) { states[k].hidden = (k !== btn.getAttribute('data-state')); });
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 表单抽屉
|
|
|
|
|
+ var mask = document.getElementById('drawerMask');
|
|
|
|
|
+ var drawer = document.getElementById('wbDrawer');
|
|
|
|
|
+ function openDrawer() { mask.classList.add('is-open'); drawer.classList.add('is-open'); }
|
|
|
|
|
+ function closeDrawer() { mask.classList.remove('is-open'); drawer.classList.remove('is-open'); }
|
|
|
|
|
+ document.getElementById('drawerToggle').addEventListener('click', openDrawer);
|
|
|
|
|
+ document.getElementById('drawerClose').addEventListener('click', closeDrawer);
|
|
|
|
|
+ document.getElementById('drawerCancel').addEventListener('click', closeDrawer);
|
|
|
|
|
+ mask.addEventListener('click', closeDrawer);
|
|
|
|
|
+ document.addEventListener('keydown', function (e) { if (e.key === 'Escape') closeDrawer(); });
|
|
|
|
|
+</script>
|
|
|
|
|
+</body>
|
|
|
|
|
+</html>
|