feat(ui): 完成 [用户管理] (含添加用户/用户表管理) UI重构与全套6件交付物

- 统一采用 Fluid Studio 现代健康工作台设计体系与 #2563EB 核心品牌蓝标准
- 实现主界面、添加/编辑用户表单、用户表管理三视图无缝 SPA 状态机闭环
- 支持真实头像流展示与优质默认 SVG 头像回退
- 精确隔离添加用户(清空)与编辑用户(回填)状态逻辑
- 产出 baseline_ui.html, image.png, DESIGN_SPEC.md, implementation_plan.md, CARD-20260817-UITask-用户管理.md
- 更新 README.md 页面完工状态 (第 7 页已完工)
This commit is contained in:
zhy200308
2026-08-17 18:04:39 +08:00
parent 3d7be0e326
commit 96c82ad25d
29 changed files with 2620 additions and 1 deletions
@@ -0,0 +1,527 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 1:Fluid Studio 现代健康工作台 (全景卡片流与状态机闭环)</title>
<style>
:root {
--color-primary: #2563EB;
--color-primary-dark: #1D4ED8;
--color-on-primary-container: #1E40AF;
--color-primary-light: #EFF6FF;
--color-primary-border: #DBEAFE;
--color-primary-glow: rgba(37, 99, 235, 0.2);
--color-primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
--bg: #EEF2F6;
--surface: #FFFFFF;
--surface-sub: #F8FAFC;
--text-main: #0F172A;
--text-sub: #64748B;
--text-dim: #94A3B8;
--divider: #E2E8F0;
--color-success: #059669;
--color-success-bg: #ECFDF5;
--color-danger: #E11D48;
--color-danger-bg: #FFF1F2;
--color-danger-border: #FFE4E6;
--corner-card: 16px;
--corner-item: 10px;
--content-max-width: 1160px;
--content-gutter: clamp(16px, 2.5vw, 32px);
--appbar-height: 60px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", Roboto, sans-serif;
background: var(--bg);
color: var(--text-main);
min-height: 100vh;
padding: var(--content-gutter);
display: flex;
flex-direction: column;
-webkit-font-smoothing: antialiased;
}
.device-wrapper {
width: 100%;
max-width: var(--content-max-width);
margin: 0 auto;
background: var(--surface);
border-radius: 20px;
border: 1px solid var(--divider);
box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
overflow: hidden;
position: relative;
min-height: 660px;
display: flex;
flex-direction: column;
}
/* 视图状态机容器 */
.view-panel {
display: none;
flex-direction: column;
flex: 1;
}
.view-panel.active {
display: flex;
}
/* 1. AppBar */
.appbar {
height: var(--appbar-height);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
border-bottom: 1px solid var(--divider);
background: var(--surface);
flex-shrink: 0;
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none; transition: all 0.15s ease;
}
.appbar-nav:hover, .appbar-more:hover { background: rgba(15, 23, 42, 0.06); transform: scale(0.96); }
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
/* 2. Top Header & Search Bar */
.top-header-bar {
padding: 12px 24px;
background: #F8FAFC;
border-bottom: 1px solid var(--divider);
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
flex-wrap: wrap;
}
.db-pill-btn {
background: #FFFFFF;
color: var(--color-primary);
border: 1.5px solid var(--color-primary-border);
padding: 6px 14px;
border-radius: 100px;
font-size: 13.5px;
font-weight: 700;
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.06);
transition: all 0.15s ease;
}
.db-pill-btn:hover { background: var(--color-primary-light); border-color: var(--color-primary); }
.top-btn-group {
display: flex;
align-items: center;
gap: 10px;
}
.btn-action {
height: 38px;
padding: 0 16px;
border-radius: 8px;
font-size: 13.5px;
font-weight: 700;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 6px;
transition: all 0.15s ease;
}
.btn-primary {
background: var(--color-primary-gradient);
color: white;
border: none;
box-shadow: 0 2px 8px var(--color-primary-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px var(--color-primary-glow); }
.btn-secondary {
background: #FFFFFF;
color: var(--text-main);
border: 1.5px solid var(--divider);
}
.btn-secondary:hover { background: #F1F5F9; border-color: #CBD5E1; }
/* 3. Cards Stream */
.cards-scroll-body {
padding: clamp(18px, 2.5vw, 26px);
background: #F8FAFC;
flex: 1;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 12px;
max-height: calc(100vh - 180px);
}
.user-row-card {
background: var(--surface);
border: 1.5px solid var(--divider);
border-radius: 14px;
padding: 16px 20px;
display: grid;
grid-template-columns: 280px 1fr auto;
align-items: center;
gap: 20px;
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
transition: all 0.2s ease;
}
.user-row-card:hover {
border-color: #CBD5E1;
box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
transform: translateY(-1px);
}
/* Zone 1: Profile & Avatar */
.profile-zone {
display: flex;
align-items: center;
gap: 14px;
}
.avatar-box {
width: 50px;
height: 50px;
border-radius: 12px;
overflow: hidden;
background: var(--color-primary-light);
border: 1.5px solid var(--color-primary-border);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.avatar-box svg { width: 28px; height: 28px; fill: var(--color-primary); }
.name-meta { display: flex; flex-direction: column; gap: 3px; }
.name-line { display: flex; align-items: center; gap: 8px; }
.u-name { font-size: 16px; font-weight: 700; color: var(--text-main); }
.u-gender { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.u-gender.female { background: #FCE7F3; color: #DB2777; }
.u-gender.male { background: #EFF6FF; color: var(--color-primary); }
.u-subline { font-size: 12.5px; color: var(--text-sub); }
/* Zone 2: Metrics */
.metrics-zone {
display: flex;
align-items: center;
gap: 12px;
flex-wrap: wrap;
}
.metric-capsule {
background: #F8FAFC;
border: 1px solid var(--divider);
border-radius: 8px;
padding: 6px 12px;
display: flex;
align-items: center;
gap: 6px;
font-size: 12.5px;
color: var(--text-sub);
}
.metric-capsule b {
color: var(--color-primary);
font-weight: 700;
font-family: monospace;
}
/* Zone 3: Controls */
.controls-zone {
display: flex;
align-items: center;
gap: 12px;
}
.switch {
position: relative; display: inline-block; width: 44px; height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
background-color: #CBD5E1; transition: .2s; border-radius: 24px;
}
.slider:before {
position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
background-color: white; transition: .2s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--color-primary); }
input:checked + .slider:before { transform: translateX(20px); }
.icon-btn {
width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--divider);
background: white; display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; transition: all 0.15s ease;
}
.icon-btn:hover { background: var(--color-primary-light); border-color: var(--color-primary-border); }
.icon-btn.edit-btn:hover svg { fill: var(--color-primary); }
.icon-btn.delete-btn:hover { background: var(--color-danger-bg); border-color: var(--color-danger-border); }
.icon-btn.delete-btn:hover svg { fill: var(--color-danger); }
.icon-btn svg { width: 18px; height: 18px; fill: var(--text-sub); }
/* =========================================================================
VIEW 2: 添加/编辑用户独立表单
========================================================================= */
.form-view-container {
padding: 30px 40px;
background: #FFFFFF;
flex: 1;
overflow-y: auto;
display: flex;
flex-direction: column;
align-items: center;
max-width: 640px;
width: 100%;
margin: 0 auto;
gap: 20px;
}
.avatar-uploader-round {
width: 84px; height: 84px; border-radius: 50%; background: var(--color-primary-light);
border: 2px dashed var(--color-primary-border); display: flex; align-items: center; justify-content: center;
position: relative; cursor: pointer; box-shadow: 0 4px 16px var(--color-primary-glow);
}
.avatar-uploader-round svg { width: 40px; height: 40px; fill: var(--color-primary); }
.cam-badge {
position: absolute; bottom: 0; right: 0; width: 26px; height: 26px; border-radius: 50%;
background: var(--color-primary); display: flex; align-items: center; justify-content: center;
border: 2px solid white;
}
.cam-badge svg { width: 13px; height: 13px; fill: white; }
.form-grid-stack { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.f-group { display: flex; flex-direction: column; gap: 6px; }
.f-label { font-size: 13px; font-weight: 700; color: var(--text-sub); }
.f-input, .f-select {
width: 100%; height: 44px; border: 1.5px solid var(--divider); border-radius: 10px;
padding: 0 16px; font-size: 14px; color: var(--text-main); background: #FFFFFF; outline: none;
}
.f-input:focus, .f-select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }
.f-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn-submit-full {
width: 100%; height: 46px; background: var(--color-primary-gradient); color: white;
border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer;
box-shadow: 0 4px 14px var(--color-primary-glow); margin-top: 10px;
}
/* =========================================================================
VIEW 3: 用户表管理
========================================================================= */
.db-view-container {
padding: 24px 30px; background: #F8FAFC; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px;
}
.db-notice {
padding: 12px 20px; background: var(--color-primary-light); border: 1.5px solid var(--color-primary-border);
border-radius: 12px; display: flex; align-items: center; justify-content: space-between;
color: var(--color-on-primary-container); font-size: 13.5px; font-weight: 600;
}
.db-row {
background: white; border: 1.5px solid var(--divider); border-radius: 12px; padding: 16px 20px;
display: flex; align-items: center; justify-content: space-between; cursor: grab;
}
</style>
</head>
<body>
<div class="device-wrapper">
<!-- VIEW 1: 用户管理主界面 -->
<div class="view-panel active" id="view1">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">用户管理</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<div class="top-header-bar">
<div style="display: flex; align-items: center; gap: 10px;">
<span style="font-size: 14px; font-weight: 700;">用户表:</span>
<div class="db-pill-btn" onclick="openDbView()">
<span>UserDatabase_CHINA</span>
<svg style="width: 14px; height: 14px; fill: currentColor;" viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>
</div>
</div>
<div class="top-btn-group">
<button class="btn-action btn-primary" onclick="openAddView()">
<svg style="width: 16px; height: 16px; fill: currentColor;" viewBox="0 0 24 24"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>
<span>添加</span>
</button>
<button class="btn-action btn-secondary" onclick="alert('导入用户名单 CSV / Excel')">
<svg style="width: 16px; height: 16px; fill: currentColor;" viewBox="0 0 24 24"><path d="M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"/></svg>
<span>导入</span>
</button>
<button class="btn-action btn-secondary" onclick="openDbView()">
<svg style="width: 16px; height: 16px; fill: currentColor;" viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>
<span>编辑</span>
</button>
</div>
</div>
<main class="cards-scroll-body">
<!-- 孙伟 女 -->
<div class="user-row-card">
<div class="profile-zone">
<div class="avatar-box"><svg viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg></div>
<div class="name-meta">
<div class="name-line"><span class="u-name">孙伟</span><span class="u-gender female">女</span></div>
<div class="u-subline">学号: <b>10229</b> | <b>25岁</b> · 167cm / 117kg</div>
</div>
</div>
<div class="metrics-zone">
<div class="metric-capsule"><span>静息心率:</span><b>60 bpm</b></div>
<div class="metric-capsule"><span>最大心率:</span><b>188</b></div>
</div>
<div class="controls-zone">
<label class="switch"><input type="checkbox" checked><span class="slider"></span></label>
<button class="icon-btn edit-btn" onclick="openEditView('孙伟', '10229', '女', '1999-05-10', '167', '117.0', '60', '188')"><svg viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg></button>
<button class="icon-btn delete-btn" onclick="confirm('确定删除学员孙伟吗?')"><svg viewBox="0 0 24 24"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg></button>
</div>
</div>
<!-- 陈静 男 -->
<div class="user-row-card">
<div class="profile-zone">
<div class="avatar-box"><svg viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg></div>
<div class="name-meta">
<div class="name-line"><span class="u-name">陈静</span><span class="u-gender male">男</span></div>
<div class="u-subline">学号: <b>203464</b> | <b>28岁</b> · 189cm / 71kg</div>
</div>
</div>
<div class="metrics-zone">
<div class="metric-capsule"><span>静息心率:</span><b>60 bpm</b></div>
<div class="metric-capsule"><span>最大心率:</span><b>186</b></div>
</div>
<div class="controls-zone">
<label class="switch"><input type="checkbox" checked><span class="slider"></span></label>
<button class="icon-btn edit-btn" onclick="openEditView('陈静', '203464', '男', '1996-08-20', '189', '71.0', '60', '186')"><svg viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg></button>
<button class="icon-btn delete-btn"><svg viewBox="0 0 24 24"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg></button>
</div>
</div>
<!-- 吴敏 女 -->
<div class="user-row-card">
<div class="profile-zone">
<div class="avatar-box"><svg viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg></div>
<div class="name-meta">
<div class="name-line"><span class="u-name">吴敏</span><span class="u-gender female">女</span></div>
<div class="u-subline">学号: <b>295</b> | <b>29岁</b> · 153cm / 109kg</div>
</div>
</div>
<div class="metrics-zone">
<div class="metric-capsule"><span>静息心率:</span><b>60 bpm</b></div>
<div class="metric-capsule"><span>最大心率:</span><b>185</b></div>
</div>
<div class="controls-zone">
<label class="switch"><input type="checkbox" checked><span class="slider"></span></label>
<button class="icon-btn edit-btn" onclick="openEditView('吴敏', '295', '女', '1995-11-05', '153', '109.0', '60', '185')"><svg viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg></button>
<button class="icon-btn delete-btn"><svg viewBox="0 0 24 24"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg></button>
</div>
</div>
</main>
</div>
<!-- VIEW 2: 添加/编辑用户独立表单 -->
<div class="view-panel" id="view2">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav" onclick="showMainView()"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title" id="formHeaderTitle">添加用户</h1>
</div>
</header>
<main class="form-view-container">
<div class="avatar-uploader-round" onclick="alert('触发本地头像文件选择')">
<svg viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>
<div class="cam-badge"><svg viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg></div>
</div>
<form class="form-grid-stack" onsubmit="event.preventDefault(); alert('学员信息已保存!'); showMainView();">
<div class="f-group"><label class="f-label">学号</label><input type="text" id="fSno" class="f-input" placeholder="请输入学号" required></div>
<div class="f-group"><label class="f-label">用户名</label><input type="text" id="fName" class="f-input" placeholder="请输入姓名" required></div>
<div class="f-group"><label class="f-label">性别</label><select id="fGender" class="f-select"><option>未知</option><option>男</option><option>女</option></select></div>
<div class="f-group"><label class="f-label">出生日期</label><input type="date" id="fBday" class="f-input" value="2000-01-01"></div>
<div class="f-two-col">
<div class="f-group"><label class="f-label">身高 (cm)</label><input type="number" id="fH" class="f-input" placeholder="身高"></div>
<div class="f-group"><label class="f-label">体重 (kg)</label><input type="number" step="0.1" id="fW" class="f-input" placeholder="体重"></div>
</div>
<div class="f-two-col">
<div class="f-group"><label class="f-label">静息心率 (bpm)</label><input type="number" id="fRest" class="f-input" value="60"></div>
<div class="f-group"><label class="f-label">最大心率 (bpm)</label><input type="number" id="fMax" class="f-input" value="188"></div>
</div>
<button type="submit" class="btn-submit-full">保存学员信息</button>
</form>
</main>
</div>
<!-- VIEW 3: 用户表管理 -->
<div class="view-panel" id="view3">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav" onclick="showMainView()"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">用户表管理</h1>
</div>
</header>
<main class="db-view-container">
<div class="db-notice">
<span>长按并上下拖拽可以调整用户表顺序</span>
<button style="background: var(--color-primary); color: white; border: none; padding: 7px 16px; border-radius: 8px; font-weight: 700; cursor: pointer;" onclick="alert('导出全部用户名单')">导出全部用户</button>
</div>
<div class="db-row">
<div style="display: flex; align-items: center; gap: 14px;">
<span style="font-size: 20px; color: var(--text-sub);">☰</span>
<div><b style="font-family: monospace;">UserDatabase_CHINA</b><div style="font-size: 12px; color: var(--text-sub);">共包含 6 名学员档案 · 当前使用中</div></div>
</div>
<div style="display: flex; gap: 8px;">
<button class="icon-btn"><svg viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg></button>
<button class="icon-btn delete-btn"><svg viewBox="0 0 24 24"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg></button>
</div>
</div>
</main>
</div>
</div>
<script>
function showMainView() {
document.querySelectorAll('.view-panel').forEach(p => p.classList.remove('active'));
document.getElementById('view1').classList.add('active');
}
function openAddView() {
document.getElementById('formHeaderTitle').innerText = "添加用户";
document.getElementById('fSno').value = "";
document.getElementById('fName').value = "";
document.getElementById('fGender').value = "未知";
document.getElementById('fBday').value = "2000-01-01";
document.getElementById('fH').value = "";
document.getElementById('fW').value = "";
document.getElementById('fRest').value = "60";
document.getElementById('fMax').value = "188";
document.querySelectorAll('.view-panel').forEach(p => p.classList.remove('active'));
document.getElementById('view2').classList.add('active');
}
function openEditView(name, sno, gender, bday, h, w, rest, max) {
document.getElementById('formHeaderTitle').innerText = `编辑用户 - ${name}`;
document.getElementById('fSno').value = sno;
document.getElementById('fName').value = name;
document.getElementById('fGender').value = gender;
document.getElementById('fBday').value = bday;
document.getElementById('fH').value = h;
document.getElementById('fW').value = w;
document.getElementById('fRest').value = rest;
document.getElementById('fMax').value = max;
document.querySelectorAll('.view-panel').forEach(p => p.classList.remove('active'));
document.getElementById('view2').classList.add('active');
}
function openDbView() {
document.querySelectorAll('.view-panel').forEach(p => p.classList.remove('active'));
document.getElementById('view3').classList.add('active');
}
</script>
</body>
</html>
@@ -0,0 +1,143 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>添加用户 - 附属页面预览 (统一色调)</title>
<style>
:root {
--color-primary: #2563EB;
--color-primary-dark: #1D4ED8;
--color-primary-light: #EFF6FF;
--color-primary-border: #DBEAFE;
--color-primary-glow: rgba(37, 99, 235, 0.22);
--color-primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
--bg: #EEF2F6;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--bg); color: var(--text-main); min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px); display: flex; flex-direction: column;
}
.device-wrapper {
width: 100%; max-width: min(100%, 1160px); margin: 0 auto; background: var(--surface);
border-radius: 20px; border: 1px solid var(--divider); box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
overflow: hidden; position: relative; min-height: 660px; display: flex; flex-direction: column;
}
.appbar {
height: 60px; display: flex; align-items: center; justify-content: space-between;
padding: 0 20px; border-bottom: 1px solid var(--divider); background: var(--surface);
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav {
width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
.add-user-container {
padding: clamp(24px, 3.5vw, 40px); background: #FFFFFF; flex: 1; overflow-y: auto;
display: flex; flex-direction: column; align-items: center; max-width: 680px; width: 100%; margin: 0 auto; gap: 20px;
}
.big-avatar-uploader {
width: 88px; height: 88px; border-radius: 50%; background: var(--color-primary-light);
border: 2px dashed var(--color-primary-border); display: flex; align-items: center; justify-content: center;
position: relative; cursor: pointer; box-shadow: 0 4px 16px var(--color-primary-glow);
}
.big-avatar-uploader svg { width: 44px; height: 44px; fill: var(--color-primary); }
.avatar-cam-badge {
position: absolute; bottom: 2px; right: 2px; width: 28px; height: 28px; border-radius: 50%;
background: var(--color-primary); display: flex; align-items: center; justify-content: center;
border: 2.5px solid white; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.avatar-cam-badge svg { width: 14px; height: 14px; fill: white; }
.form-body-grid { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.input-row-group { display: flex; flex-direction: column; gap: 6px; }
.input-label { font-size: 13px; font-weight: 700; color: var(--text-sub); }
.custom-input, .custom-select {
width: 100%; height: 44px; border: 1.5px solid var(--divider); border-radius: 10px;
padding: 0 16px; font-size: 14px; color: var(--text-main); background: #FFFFFF; outline: none;
}
.custom-input:focus, .custom-select:focus {
border-color: var(--color-primary); box-shadow: 0 0 0 3.5px var(--color-primary-light);
}
.grid-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn-save-full-primary {
width: 100%; height: 48px; background: var(--color-primary-gradient); color: white;
border: none; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer;
box-shadow: 0 4px 14px var(--color-primary-glow); margin-top: 8px;
}
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">添加用户</h1>
</div>
</header>
<main class="add-user-container">
<div style="display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer;">
<div class="big-avatar-uploader">
<svg viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>
<div class="avatar-cam-badge"><svg viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg></div>
</div>
<span style="font-size: 13px; font-weight: 600; color: var(--color-primary);">点击上传/更换自定义头像</span>
</div>
<form class="form-body-grid">
<div class="input-row-group">
<label class="input-label">学号</label>
<input type="text" class="custom-input" placeholder="请输入学号,如 10229">
</div>
<div class="input-row-group">
<label class="input-label">用户名</label>
<input type="text" class="custom-input" placeholder="请输入用户名,如 孙伟">
</div>
<div class="input-row-group">
<label class="input-label">性别</label>
<select class="custom-select">
<option>未知</option>
<option>男</option>
<option>女</option>
</select>
</div>
<div class="input-row-group">
<label class="input-label">出生日期</label>
<input type="date" class="custom-input" value="2000-01-01">
</div>
<div class="grid-two-col">
<div class="input-row-group">
<label class="input-label">身高 (cm)</label>
<input type="number" class="custom-input" placeholder="167">
</div>
<div class="input-row-group">
<label class="input-label">体重 (kg)</label>
<input type="number" step="0.1" class="custom-input" placeholder="117.0">
</div>
</div>
<div class="grid-two-col">
<div class="input-row-group">
<label class="input-label">静息心率 (bpm)</label>
<input type="number" class="custom-input" value="60">
</div>
<div class="input-row-group">
<label class="input-label">最大心率 (bpm - 自动计算)</label>
<input type="number" class="custom-input" value="188">
</div>
</div>
<button type="button" class="btn-save-full-primary">保存学员信息</button>
</form>
</main>
</div>
</body>
</html>
@@ -0,0 +1,104 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>用户表管理 - 附属页面预览 (统一色调)</title>
<style>
:root {
--color-primary: #2563EB;
--color-primary-dark: #1D4ED8;
--color-primary-light: #EFF6FF;
--color-primary-border: #DBEAFE;
--color-on-primary-container: #1E40AF;
--bg: #EEF2F6;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
--color-danger: #E11D48;
--color-danger-bg: #FFF1F2;
--color-danger-border: #FFE4E6;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--bg); color: var(--text-main); min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px); display: flex; flex-direction: column;
}
.device-wrapper {
width: 100%; max-width: min(100%, 1160px); margin: 0 auto; background: var(--surface);
border-radius: 20px; border: 1px solid var(--divider); box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
overflow: hidden; position: relative; min-height: 660px; display: flex; flex-direction: column;
}
.appbar {
height: 60px; display: flex; align-items: center; justify-content: space-between;
padding: 0 20px; border-bottom: 1px solid var(--divider); background: var(--surface);
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav {
width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
.db-manage-container {
padding: clamp(20px, 2.5vw, 30px); background: #F8FAFC; flex: 1; overflow-y: auto;
display: flex; flex-direction: column; gap: 16px;
}
.db-banner-notice {
padding: 12px 20px; background: var(--color-primary-light); border: 1.5px solid var(--color-primary-border);
border-radius: 12px; display: flex; align-items: center; justify-content: space-between;
color: var(--color-on-primary-container); font-size: 13.5px; font-weight: 600;
}
.btn-export-all {
background: var(--color-primary); color: white; border: none; padding: 7px 16px;
border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.db-card-row {
background: white; border: 1.5px solid var(--divider); border-radius: 12px;
padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; cursor: grab;
}
.action-icon-btn {
width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--divider);
background: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.action-icon-btn.edit-btn:hover svg { fill: var(--color-primary); }
.action-icon-btn.delete-btn:hover { background: var(--color-danger-bg); border-color: var(--color-danger-border); }
.action-icon-btn.delete-btn:hover svg { fill: var(--color-danger); }
.action-icon-btn svg { width: 18px; height: 18px; fill: var(--text-sub); }
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">用户表管理</h1>
</div>
</header>
<main class="db-manage-container">
<div class="db-banner-notice">
<span>长按并上下拖拽可以调整用户表顺序</span>
<button class="btn-export-all">导出全部用户</button>
</div>
<div class="db-card-row">
<div style="display: flex; align-items: center; gap: 14px;">
<span style="font-size: 20px; color: var(--text-sub); cursor: grab;">☰</span>
<div>
<div style="font-size: 15px; font-weight: 700; font-family: monospace;">UserDatabase_CHINA</div>
<div style="font-size: 12px; color: var(--text-sub); margin-top: 2px;">共包含 6 名学员档案 · 当前正在使用</div>
</div>
</div>
<div style="display: flex; gap: 8px;">
<button class="action-icon-btn edit-btn"><svg viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg></button>
<button class="action-icon-btn delete-btn"><svg viewBox="0 0 24 24"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg></button>
</div>
</div>
</main>
</div>
</body>
</html>
@@ -0,0 +1,123 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 2:Neo-Bento 用户工控管理矩阵</title>
<style>
:root {
--color-primary: #2563EB;
--color-primary-dark: #1D4ED8;
--color-primary-light: #EFF6FF;
--color-primary-border: #DBEAFE;
--color-primary-glow: rgba(37, 99, 235, 0.25);
--color-primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
--bg: #EEF2F6;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
--success: #10B981;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--bg); color: var(--text-main); min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px); display: flex; flex-direction: column;
}
.device-wrapper {
width: 100%; max-width: min(100%, 1160px); margin: 0 auto; background: var(--surface);
border-radius: 20px; border: 1px solid var(--divider); box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
overflow: hidden; position: relative; min-height: 640px; display: flex; flex-direction: column;
}
.appbar {
height: 60px; display: flex; align-items: center; justify-content: space-between;
padding: 0 20px; border-bottom: 1px solid var(--divider); background: var(--surface);
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
.bento-body {
padding: clamp(20px, 2.5vw, 30px); background: #F8FAFC; flex: 1; overflow-y: auto;
display: flex; flex-direction: column; gap: 16px;
}
.bento-summary-grid {
display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.bento-metric-tile {
background: white; border: 1.5px solid var(--divider); border-radius: 12px; padding: 14px;
}
.b-m-val { font-size: 20px; font-weight: 800; color: var(--color-primary); font-family: monospace; }
.b-m-lbl { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.table-card {
background: white; border: 1.5px solid var(--divider); border-radius: 16px; overflow: hidden;
}
.table-head-bar {
padding: 14px 20px; background: #F1F5F9; border-bottom: 1px solid var(--divider);
display: flex; justify-content: space-between; align-items: center;
}
.data-table {
width: 100%; border-collapse: collapse; text-align: left; font-size: 13.5px;
}
.data-table th { background: #F8FAFC; padding: 12px 16px; font-size: 12px; color: var(--text-sub); border-bottom: 1px solid var(--divider); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--divider); color: var(--text-main); }
.data-table tr:hover { background: #F8FAFC; }
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">用户管理</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<main class="bento-body">
<div class="bento-summary-grid">
<div class="bento-metric-tile"><div class="b-m-val">New_UserDB</div><div class="b-m-lbl">当前活动用户表</div></div>
<div class="bento-metric-tile"><div class="b-m-val">3</div><div class="b-m-lbl">已录入学员数</div></div>
<div class="bento-metric-tile"><div class="b-m-val">60 bpm</div><div class="b-m-lbl">基准静息心率</div></div>
<div class="bento-metric-tile"><div class="b-m-val">199 bpm</div><div class="b-m-lbl">平均最大心率</div></div>
</div>
<div class="table-card">
<div class="table-head-bar">
<span style="font-weight: 700;">学员档案列表</span>
<div style="display: flex; gap: 8px;">
<button style="background: var(--color-primary); color: white; border: none; padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">添加</button>
<button style="background: #ECFDF5; color: #10B981; border: 1px solid #A7F3D0; padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">导入</button>
<button style="background: white; border: 1px solid var(--divider); padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">编辑</button>
</div>
</div>
<table class="data-table">
<thead>
<tr><th>姓名</th><th>学号</th><th>性别</th><th>出生日期</th><th>身高/体重</th><th>手环状态</th><th>静息/最大心率</th><th>操作</th></tr>
</thead>
<tbody>
<tr>
<td><b>陈穑</b></td><td>121928</td><td>男</td><td>2017-01-01</td><td>146cm / 39.0kg</td><td><span style="color:#94A3B8;">未绑定</span></td><td>60 / 199(自动)</td>
<td>✏️ 🗑️</td>
</tr>
<tr>
<td><b>陈禹豪</b></td><td>129383</td><td>男</td><td>2020-01-01</td><td>114cm / 18.5kg</td><td><span style="color:#94A3B8;">未绑定</span></td><td>60 / 201(自动)</td>
<td>✏️ 🗑️</td>
</tr>
<tr>
<td><b>栾一墨</b></td><td>132672</td><td>男</td><td>2016-01-01</td><td>155cm / 55.0kg</td><td><span style="color:#94A3B8;">未绑定</span></td><td>60 / 198(自动)</td>
<td>✏️ 🗑️</td>
</tr>
</tbody>
</table>
</div>
</main>
</div>
</body>
</html>
@@ -0,0 +1,163 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 2:Master-Detail 360px 双栏联动工作台</title>
<style>
:root {
--color-primary: #2563EB;
--color-primary-light: #EFF6FF;
--color-primary-border: #DBEAFE;
--color-primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
--bg: #EEF2F6;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
--color-danger: #E11D48;
--color-danger-bg: #FFF1F2;
--color-danger-border: #FFE4E6;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--bg); color: var(--text-main); min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px); display: flex; flex-direction: column;
}
.device-wrapper {
width: 100%; max-width: min(100%, 1160px); margin: 0 auto; background: var(--surface);
border-radius: 20px; border: 1px solid var(--divider); box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
overflow: hidden; position: relative; min-height: 660px; display: flex; flex-direction: column;
}
.appbar {
height: 60px; display: flex; align-items: center; justify-content: space-between;
padding: 0 20px; border-bottom: 1px solid var(--divider); background: var(--surface);
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
.split-body {
padding: clamp(20px, 2.5vw, 30px); background: #F8FAFC; flex: 1; overflow-y: auto;
display: grid; grid-template-columns: 360px 1fr; gap: 20px; max-height: calc(100vh - 120px);
}
.side-panel {
background: white; border: 1.5px solid var(--divider); border-radius: 16px; padding: 18px;
display: flex; flex-direction: column; gap: 12px;
}
.main-panel {
background: white; border: 1.5px solid var(--divider); border-radius: 16px; padding: 22px;
display: flex; flex-direction: column; gap: 16px;
}
.roster-card {
border: 1.5px solid var(--divider); border-radius: 12px; padding: 12px 14px; cursor: pointer;
display: flex; align-items: center; gap: 12px; transition: all 0.15s ease;
}
.roster-card.active { border-color: var(--color-primary); background: var(--color-primary-light); }
.avatar-mini {
width: 40px; height: 40px; border-radius: 10px; background: #EFF6FF; display: flex; align-items: center; justify-content: center;
}
.avatar-mini svg { width: 22px; height: 22px; fill: var(--color-primary); }
.prop-pill-row {
background: #F8FAFC; border: 1px solid var(--divider); border-radius: 8px; padding: 10px 14px;
display: flex; justify-content: space-between;
}
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">用户管理</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<main class="split-body">
<!-- 左侧 360px 花名册列表 -->
<div class="side-panel">
<div style="display: flex; justify-content: space-between; align-items: center;">
<span style="font-weight: 700; font-size: 13.5px;">表: UserDatabase_CHINA</span>
<button style="border: 1px solid var(--divider); background: white; padding: 4px 8px; border-radius: 6px; font-size: 12px; cursor: pointer;" onclick="alert('进入用户表管理')">管理表</button>
</div>
<div style="display: flex; gap: 8px;">
<button style="flex: 1; background: var(--color-primary); color: white; border: none; padding: 8px; border-radius: 8px; font-weight: 700; cursor: pointer;" onclick="switchToNewUser()">+ 添加用户</button>
<button style="border: 1px solid var(--divider); background: white; padding: 8px 12px; border-radius: 8px; font-weight: 700; cursor: pointer;" onclick="alert('导入表格')">导入</button>
</div>
<div style="display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 380px;">
<div class="roster-card active" onclick="selectUser('孙伟', '女', '10229', '25岁', '167 cm', '117.0 kg', '60 bpm', '188', this)">
<div class="avatar-mini"><svg viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg></div>
<div>
<div style="font-weight: 700; font-size: 14.5px;">孙伟 (女)</div>
<div style="font-size: 11.5px; color: var(--text-sub);">学号: 10229 · 25岁</div>
</div>
</div>
<div class="roster-card" onclick="selectUser('陈静', '男', '203464', '28岁', '189 cm', '71.0 kg', '60 bpm', '186', this)">
<div class="avatar-mini"><svg viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg></div>
<div>
<div style="font-weight: 700; font-size: 14.5px;">陈静 (男)</div>
<div style="font-size: 11.5px; color: var(--text-sub);">学号: 203464 · 28岁</div>
</div>
</div>
<div class="roster-card" onclick="selectUser('吴敏', '女', '295', '29岁', '153 cm', '109.0 kg', '60 bpm', '185', this)">
<div class="avatar-mini"><svg viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg></div>
<div>
<div style="font-weight: 700; font-size: 14.5px;">吴敏 (女)</div>
<div style="font-size: 11.5px; color: var(--text-sub);">学号: 295 · 29岁</div>
</div>
</div>
</div>
</div>
<!-- 右侧 1fr 学员档案与详情 -->
<div class="main-panel">
<div style="display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--divider); padding-bottom: 14px;">
<div style="display: flex; align-items: center; gap: 14px;">
<div style="width: 52px; height: 52px; border-radius: 14px; background: var(--color-primary-light); display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--color-primary-border);">
<svg viewBox="0 0 24 24" style="width:28px;height:28px;fill:var(--color-primary);"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>
</div>
<div>
<h2 style="font-size: 18px; font-weight: 700;" id="dtName">孙伟 <span style="font-size: 13px; color: var(--text-sub);" id="dtGender">女 · 25岁</span></h2>
<div style="font-size: 12px; color: var(--text-sub);" id="dtSno">学号: 10229 · 所属表: UserDatabase_CHINA</div>
</div>
</div>
<div style="display: flex; gap: 8px;">
<button style="border: 1.5px solid var(--divider); background: white; padding: 7px 14px; border-radius: 8px; font-weight: 700; cursor: pointer;" onclick="alert('编辑此学员')">✏️ 编辑档案</button>
<button style="border: 1.5px solid var(--color-danger-border); background: var(--color-danger-bg); color: var(--color-danger); padding: 7px 14px; border-radius: 8px; font-weight: 700; cursor: pointer;">🗑️ 删除</button>
</div>
</div>
<div style="display: flex; flex-direction: column; gap: 10px;">
<div class="prop-pill-row"><span style="color: var(--text-sub);">学号</span><b id="pvSno" style="font-family: monospace;">10229</b></div>
<div class="prop-pill-row"><span style="color: var(--text-sub);">身高 / 体重</span><b id="pvHw">167 cm / 117.0 kg</b></div>
<div class="prop-pill-row"><span style="color: var(--text-sub);">静息心率 (bpm)</span><b id="pvRest" style="color: var(--color-primary); font-family: monospace;">60 bpm</b></div>
<div class="prop-pill-row"><span style="color: var(--text-sub);">最大心率 (bpm)</span><b id="pvMax" style="color: var(--color-primary); font-family: monospace;">188 (自动计算)</b></div>
</div>
</div>
</main>
</div>
<script>
function selectUser(n, g, sno, age, h, w, rest, max, el) {
document.querySelectorAll('.roster-card').forEach(c => c.classList.remove('active'));
el.classList.add('active');
document.getElementById('dtName').innerHTML = `${n} <span style="font-size: 13px; color: var(--text-sub);">${g} · ${age}</span>`;
document.getElementById('dtSno').innerText = `学号: ${sno} · 所属表: UserDatabase_CHINA`;
document.getElementById('pvSno').innerText = sno;
document.getElementById('pvHw').innerText = `${h} / ${w}`;
document.getElementById('pvRest').innerText = rest;
document.getElementById('pvMax').innerText = `${max} (自动计算)`;
}
function switchToNewUser() {
alert("右侧已切换为 [新建学员] 表单模式!");
}
</script>
</body>
</html>
@@ -0,0 +1,132 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 3:Drawer Workflow 抽屉工作流与侧滑表单</title>
<style>
:root {
--color-primary: #2563EB;
--color-primary-light: #EFF6FF;
--color-primary-border: #DBEAFE;
--bg: #EEF2F6;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
--color-danger: #E11D48;
--color-danger-bg: #FFF1F2;
--color-danger-border: #FFE4E6;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--bg); color: var(--text-main); min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px); display: flex; flex-direction: column;
}
.device-wrapper {
width: 100%; max-width: min(100%, 1160px); margin: 0 auto; background: var(--surface);
border-radius: 20px; border: 1px solid var(--divider); box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
overflow: hidden; position: relative; min-height: 660px; display: flex; flex-direction: column;
}
.appbar {
height: 60px; display: flex; align-items: center; justify-content: space-between;
padding: 0 20px; border-bottom: 1px solid var(--divider); background: var(--surface);
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
.cards-container {
padding: clamp(20px, 2.5vw, 30px); background: #F8FAFC; flex: 1; overflow-y: auto;
display: flex; flex-direction: column; gap: 12px;
}
.u-card-item {
background: white; border: 1.5px solid var(--divider); border-radius: 14px; padding: 16px 20px;
display: flex; align-items: center; justify-content: space-between;
}
/* 侧滑抽屉 */
.side-drawer-mask {
position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.45);
backdrop-filter: blur(4px); z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.side-drawer-mask.open { opacity: 1; pointer-events: auto; }
.side-drawer {
position: absolute; top: 0; right: 0; bottom: 0; width: 440px; background: white;
box-shadow: -10px 0 30px rgba(0,0,0,0.15); transform: translateX(100%); transition: transform 0.3s ease;
display: flex; flex-direction: column; z-index: 101;
}
.side-drawer-mask.open .side-drawer { transform: translateX(0); }
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">用户管理</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<div style="padding: 12px 24px; border-bottom: 1px solid var(--divider); background: white; display: flex; justify-content: space-between; align-items: center;">
<div style="font-weight: 700; font-size: 14px;">用户表: <span style="background: var(--color-primary-light); color: var(--color-primary); padding: 4px 12px; border-radius: 100px;">UserDatabase_CHINA</span></div>
<div style="display: flex; gap: 8px;">
<button style="background: var(--color-primary); color: white; border: none; padding: 7px 16px; border-radius: 8px; font-weight: 700; cursor: pointer;" onclick="openDrawer('添加用户')">+ 添加用户</button>
<button style="border: 1.5px solid var(--divider); background: white; padding: 7px 16px; border-radius: 8px; font-weight: 700; cursor: pointer;">导入</button>
<button style="border: 1.5px solid var(--color-primary-border); background: var(--color-primary-light); color: var(--color-primary); padding: 7px 16px; border-radius: 8px; font-weight: 700; cursor: pointer;" onclick="openDrawer('用户表管理')">用户表管理</button>
</div>
</div>
<main class="cards-container">
<div class="u-card-item">
<div style="display: flex; align-items: center; gap: 14px;">
<div style="width: 46px; height: 46px; border-radius: 12px; background: #EFF6FF; display: flex; align-items: center; justify-content: center; border: 1.5px solid #DBEAFE;"><svg viewBox="0 0 24 24" style="width:24px;height:24px;fill:var(--color-primary);"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg></div>
<div>
<div style="font-weight: 700; font-size: 15.5px;">孙伟 <span style="font-size: 12px; color: #DB2777; background: #FCE7F3; padding: 2px 6px; border-radius: 4px;">女</span></div>
<div style="font-size: 12.5px; color: var(--text-sub); margin-top: 3px;">学号: 10229 · 25岁 · 167cm / 117kg</div>
</div>
</div>
<div style="display: flex; gap: 10px; align-items: center;">
<span style="font-size: 12.5px; color: var(--text-sub);">静息: <b>60</b> | 最大: <b>188</b></span>
<button style="border: 1px solid var(--divider); background: white; padding: 6px 10px; border-radius: 6px; cursor: pointer;" onclick="openDrawer('编辑用户 - 孙伟')">✏️</button>
<button style="border: 1px solid var(--color-danger-border); background: var(--color-danger-bg); color: var(--color-danger); padding: 6px 10px; border-radius: 6px; cursor: pointer;">🗑️</button>
</div>
</div>
</main>
<!-- 侧滑抽屉 -->
<div class="side-drawer-mask" id="drawerMask" onclick="if(event.target===this) closeDrawer()">
<div class="side-drawer">
<div style="padding: 16px 20px; border-bottom: 1px solid var(--divider); display: flex; justify-content: space-between; align-items: center;">
<h2 style="font-size: 16.5px; font-weight: 700;" id="drawerTitle">添加用户</h2>
<button style="border: none; background: #F1F5F9; width: 30px; height: 30px; border-radius: 50%; cursor: pointer;" onclick="closeDrawer()">✕</button>
</div>
<div style="padding: 20px; flex: 1; overflow-y: auto;">
<div style="display: flex; flex-direction: column; gap: 14px;">
<div><label style="font-size: 13px; font-weight: 700; color: var(--text-sub);">学号</label><input style="width: 100%; height: 42px; border: 1.5px solid var(--divider); border-radius: 8px; padding: 0 12px; margin-top: 4px;"></div>
<div><label style="font-size: 13px; font-weight: 700; color: var(--text-sub);">用户名</label><input style="width: 100%; height: 42px; border: 1.5px solid var(--divider); border-radius: 8px; padding: 0 12px; margin-top: 4px;"></div>
<div><label style="font-size: 13px; font-weight: 700; color: var(--text-sub);">性别</label><select style="width: 100%; height: 42px; border: 1.5px solid var(--divider); border-radius: 8px; padding: 0 12px; margin-top: 4px;"><option>男</option><option>女</option></select></div>
<button style="background: var(--color-primary); color: white; border: none; padding: 12px; border-radius: 8px; font-weight: 700; cursor: pointer; margin-top: 10px;" onclick="closeDrawer()">保存并关闭</button>
</div>
</div>
</div>
</div>
</div>
<script>
function openDrawer(title) {
document.getElementById('drawerTitle').innerText = title;
document.getElementById('drawerMask').classList.add('open');
}
function closeDrawer() {
document.getElementById('drawerMask').classList.remove('open');
}
</script>
</body>
</html>
@@ -0,0 +1,108 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 3:Nordic Clean Sheet 极简极净用户档案表</title>
<style>
:root {
--color-primary: #2563EB;
--bg: #F8FAFC;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: #F1F5F9; color: var(--text-main); min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px); display: flex; flex-direction: column;
}
.device-wrapper {
width: 100%; max-width: min(100%, 1160px); margin: 0 auto; background: var(--surface);
border-radius: 20px; border: 1px solid var(--divider); box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
overflow: hidden; position: relative; min-height: 640px; display: flex; flex-direction: column;
}
.appbar {
height: 60px; display: flex; align-items: center; justify-content: space-between;
padding: 0 20px; border-bottom: 1px solid var(--divider); background: var(--surface);
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
.nordic-body {
padding: clamp(20px, 2.5vw, 30px); background: #FFFFFF; flex: 1; overflow-y: auto;
display: flex; flex-direction: column; gap: 14px;
}
.n-user-row {
border: 1px solid var(--divider); border-radius: 12px; padding: 16px 20px;
display: flex; align-items: center; justify-content: space-between;
}
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">用户管理</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<div style="padding: 14px 24px; border-bottom: 1px solid var(--divider); display: flex; justify-content: space-between; align-items: center;">
<div style="font-weight: 700; font-size: 14px;">用户表: <span style="background: #EFF6FF; color: #2563EB; padding: 4px 10px; border-radius: 6px;">New_UserDatabase</span></div>
<div style="display: flex; gap: 8px;">
<button style="background: #2563EB; color: white; border: none; padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">添加</button>
<button style="background: white; border: 1px solid var(--divider); padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">导入</button>
<button style="background: white; border: 1px solid var(--divider); padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">编辑</button>
</div>
</div>
<main class="nordic-body">
<div class="n-user-row">
<div>
<div style="font-weight: 700; font-size: 16px;">陈穑 <span style="font-size: 13px; color: var(--text-sub);">男</span></div>
<div style="font-size: 13px; color: var(--text-sub); margin-top: 4px;">学号: 121928 · 2017-01-01 · 146cm / 39.0kg · 未绑定</div>
<div style="font-size: 12px; color: #2563EB; margin-top: 4px;">静息心率: 60 bpm | 最大心率: 199 (自动)</div>
</div>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="checkbox" checked style="width: 20px; height: 20px; accent-color: #2563EB;">
<button style="border: 1px solid var(--divider); background: white; padding: 6px 10px; border-radius: 6px; cursor: pointer;">✏️</button>
<button style="border: 1px solid var(--divider); background: white; padding: 6px 10px; border-radius: 6px; cursor: pointer;">🗑️</button>
</div>
</div>
<div class="n-user-row">
<div>
<div style="font-weight: 700; font-size: 16px;">陈禹豪 <span style="font-size: 13px; color: var(--text-sub);">男</span></div>
<div style="font-size: 13px; color: var(--text-sub); margin-top: 4px;">学号: 129383 · 2020-01-01 · 114cm / 18.5kg · 未绑定</div>
<div style="font-size: 12px; color: #2563EB; margin-top: 4px;">静息心率: 60 bpm | 最大心率: 201 (自动)</div>
</div>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="checkbox" checked style="width: 20px; height: 20px; accent-color: #2563EB;">
<button style="border: 1px solid var(--divider); background: white; padding: 6px 10px; border-radius: 6px; cursor: pointer;">✏️</button>
<button style="border: 1px solid var(--divider); background: white; padding: 6px 10px; border-radius: 6px; cursor: pointer;">🗑️</button>
</div>
</div>
<div class="n-user-row">
<div>
<div style="font-weight: 700; font-size: 16px;">栾一墨 <span style="font-size: 13px; color: var(--text-sub);">男</span></div>
<div style="font-size: 13px; color: var(--text-sub); margin-top: 4px;">学号: 132672 · 2016-01-01 · 155cm / 55.0kg · 未绑定</div>
<div style="font-size: 12px; color: #2563EB; margin-top: 4px;">静息心率: 60 bpm | 最大心率: 198 (自动)</div>
</div>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="checkbox" checked style="width: 20px; height: 20px; accent-color: #2563EB;">
<button style="border: 1px solid var(--divider); background: white; padding: 6px 10px; border-radius: 6px; cursor: pointer;">✏️</button>
<button style="border: 1px solid var(--divider); background: white; padding: 6px 10px; border-radius: 6px; cursor: pointer;">🗑️</button>
</div>
</div>
</main>
</div>
</body>
</html>
@@ -0,0 +1,81 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 4:Neo-Bento 现代工控磁贴看板</title>
<style>
:root {
--color-primary: #2563EB;
--bg: #EEF2F6;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--bg); color: var(--text-main); min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px); display: flex; flex-direction: column;
}
.device-wrapper {
width: 100%; max-width: min(100%, 1160px); margin: 0 auto; background: var(--surface);
border-radius: 20px; border: 1px solid var(--divider); box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
overflow: hidden; position: relative; min-height: 660px; display: flex; flex-direction: column;
}
.appbar {
height: 60px; display: flex; align-items: center; justify-content: space-between;
padding: 0 20px; border-bottom: 1px solid var(--divider); background: var(--surface);
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
.bento-body {
padding: clamp(20px, 2.5vw, 30px); background: #F8FAFC; flex: 1; overflow-y: auto;
display: flex; flex-direction: column; gap: 16px;
}
.bento-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.bento-tile { background: white; border: 1.5px solid var(--divider); border-radius: 12px; padding: 14px; }
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">用户管理</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<main class="bento-body">
<div class="bento-stats">
<div class="bento-tile"><div style="font-size: 17px; font-weight: 800; color: var(--color-primary);">UserDatabase_CHINA</div><div style="font-size: 12px; color: var(--text-sub);">当前数据库</div></div>
<div class="bento-tile"><div style="font-size: 17px; font-weight: 800; color: var(--color-primary);">6 人</div><div style="font-size: 12px; color: var(--text-sub);">学员总数</div></div>
<div class="bento-tile"><div style="font-size: 17px; font-weight: 800; color: var(--color-primary);">60 / 188 bpm</div><div style="font-size: 12px; color: var(--text-sub);">平均心率读数</div></div>
</div>
<div style="background: white; border: 1.5px solid var(--divider); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px;">
<div style="display: flex; justify-content: space-between; align-items: center;">
<span style="font-weight: 700; font-size: 15px;">学员名单</span>
<div style="display: flex; gap: 8px;">
<button style="background: var(--color-primary); color: white; border: none; padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">添加</button>
<button style="background: #F1F5F9; border: 1px solid var(--divider); padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">导入</button>
<button style="background: #0D9488; color: white; border: none; padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">用户表管理</button>
</div>
</div>
<div style="border: 1px solid var(--divider); border-radius: 10px; padding: 14px; display: flex; justify-content: space-between; align-items: center;">
<div><b>孙伟 (女)</b> · 学号: 10229 · 25岁 · 167cm/117kg</div>
<div>静息 60 / 最大 188 · ✏️ 🗑️</div>
</div>
</div>
</main>
</div>
</body>
</html>
@@ -0,0 +1,110 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 4:Cyber Precision 极客遥测暗晶网格</title>
<style>
:root {
--color-primary: #2563EB;
--accent-cyan: #38BDF8;
--bg: #0B0F19;
--surface: #111827;
--card-bg: #1F2937;
--text-main: #F8FAFC;
--text-sub: #94A3B8;
--divider: #374151;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
background: #030712; color: var(--text-main); min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px); display: flex; flex-direction: column;
}
.device-wrapper {
width: 100%; max-width: min(100%, 1160px); margin: 0 auto; background: var(--surface);
border-radius: 20px; border: 1px solid var(--divider); box-shadow: 0 20px 50px rgba(0,0,0,0.6);
overflow: hidden; position: relative; min-height: 640px; display: flex; flex-direction: column;
}
.appbar {
height: 60px; display: flex; align-items: center; justify-content: space-between;
padding: 0 20px; border-bottom: 1px solid var(--divider); background: #111827;
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
.cyber-body {
padding: clamp(20px, 2.5vw, 30px); background: #0B0F19; flex: 1; overflow-y: auto;
display: flex; flex-direction: column; gap: 14px;
}
.c-card {
background: #111827; border: 1px solid var(--divider); border-radius: 12px; padding: 16px 20px;
display: flex; align-items: center; justify-content: space-between;
}
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">用户管理</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<div style="padding: 14px 24px; border-bottom: 1px solid var(--divider); background: #111827; display: flex; justify-content: space-between; align-items: center;">
<div style="font-weight: 700; font-size: 14px;">用户表: <span style="background: #1F2937; color: #38BDF8; padding: 4px 10px; border-radius: 6px; border: 1px solid #374151;">New_UserDatabase</span></div>
<div style="display: flex; gap: 8px;">
<button style="background: var(--color-primary); color: white; border: none; padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">添加</button>
<button style="background: #1F2937; border: 1px solid var(--divider); color: var(--accent-cyan); padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">导入</button>
<button style="background: #1F2937; border: 1px solid var(--divider); color: var(--accent-cyan); padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">编辑</button>
</div>
</div>
<main class="cyber-body">
<div class="c-card">
<div>
<div style="font-weight: 700; font-size: 16px; color: #FFF;">陈穑 <span style="font-size: 13px; color: var(--text-sub);">男</span></div>
<div style="font-size: 12.5px; color: var(--text-sub); margin-top: 4px;">学号: 121928 · 出生: 2017-01-01 · 身高: 146cm | 体重: 39.0kg · 手环: 未绑定</div>
<div style="font-size: 12px; color: var(--accent-cyan); margin-top: 4px;">静息心率: 60 bpm · 最大心率: 199 (自动)</div>
</div>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="checkbox" checked style="accent-color: var(--color-primary); width: 20px; height: 20px;">
<button style="border: 1px solid var(--divider); background: #1F2937; color: white; padding: 6px 10px; border-radius: 6px; cursor: pointer;">✏️</button>
<button style="border: 1px solid var(--divider); background: #1F2937; color: white; padding: 6px 10px; border-radius: 6px; cursor: pointer;">🗑️</button>
</div>
</div>
<div class="c-card">
<div>
<div style="font-weight: 700; font-size: 16px; color: #FFF;">陈禹豪 <span style="font-size: 13px; color: var(--text-sub);">男</span></div>
<div style="font-size: 12.5px; color: var(--text-sub); margin-top: 4px;">学号: 129383 · 出生: 2020-01-01 · 身高: 114cm | 体重: 18.5kg · 手环: 未绑定</div>
<div style="font-size: 12px; color: var(--accent-cyan); margin-top: 4px;">静息心率: 60 bpm · 最大心率: 201 (自动)</div>
</div>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="checkbox" checked style="accent-color: var(--color-primary); width: 20px; height: 20px;">
<button style="border: 1px solid var(--divider); background: #1F2937; color: white; padding: 6px 10px; border-radius: 6px; cursor: pointer;">✏️</button>
<button style="border: 1px solid var(--divider); background: #1F2937; color: white; padding: 6px 10px; border-radius: 6px; cursor: pointer;">🗑️</button>
</div>
</div>
<div class="c-card">
<div>
<div style="font-weight: 700; font-size: 16px; color: #FFF;">栾一墨 <span style="font-size: 13px; color: var(--text-sub);">男</span></div>
<div style="font-size: 12.5px; color: var(--text-sub); margin-top: 4px;">学号: 132672 · 出生: 2016-01-01 · 身高: 155cm | 体重: 55.0kg · 手环: 未绑定</div>
<div style="font-size: 12px; color: var(--accent-cyan); margin-top: 4px;">静息心率: 60 bpm · 最大心率: 198 (自动)</div>
</div>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="checkbox" checked style="accent-color: var(--color-primary); width: 20px; height: 20px;">
<button style="border: 1px solid var(--divider); background: #1F2937; color: white; padding: 6px 10px; border-radius: 6px; cursor: pointer;">✏️</button>
<button style="border: 1px solid var(--divider); background: #1F2937; color: white; padding: 6px 10px; border-radius: 6px; cursor: pointer;">🗑️</button>
</div>
</div>
</main>
</div>
</body>
</html>
@@ -0,0 +1,137 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 5:Master-Detail Inset Pro 经典分栏管理风</title>
<style>
:root {
--color-primary: #2563EB;
--color-primary-dark: #1D4ED8;
--color-primary-light: #EFF6FF;
--color-primary-border: #DBEAFE;
--color-primary-glow: rgba(37, 99, 235, 0.25);
--color-primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
--bg: #EEF2F6;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
--success: #10B981;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--bg); color: var(--text-main); min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px); display: flex; flex-direction: column;
}
.device-wrapper {
width: 100%; max-width: min(100%, 1160px); margin: 0 auto; background: var(--surface);
border-radius: 20px; border: 1px solid var(--divider); box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
overflow: hidden; position: relative; min-height: 640px; display: flex; flex-direction: column;
}
.appbar {
height: 60px; display: flex; align-items: center; justify-content: space-between;
padding: 0 20px; border-bottom: 1px solid var(--divider); background: var(--surface);
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
.inset-split-body {
padding: clamp(20px, 2.5vw, 30px); background: #F8FAFC; flex: 1; overflow-y: auto;
display: grid; grid-template-columns: 360px 1fr; gap: 20px;
}
.side-roster-box {
background: white; border: 1.5px solid var(--divider); border-radius: 16px; padding: 18px;
display: flex; flex-direction: column; gap: 12px;
}
.roster-item {
border: 1.5px solid var(--divider); border-radius: 10px; padding: 12px 14px;
cursor: pointer; transition: all 0.15s ease;
}
.roster-item.active {
border-color: var(--color-primary); background: var(--color-primary-light);
}
.detail-profile-box {
background: white; border: 1.5px solid var(--divider); border-radius: 16px; padding: 22px;
display: flex; flex-direction: column; gap: 16px;
}
.prop-pill-grid { display: flex; flex-direction: column; gap: 8px; }
.prop-pill-row {
background: #F8FAFC; border: 1px solid var(--divider); border-radius: 8px; padding: 10px 14px;
display: flex; justify-content: space-between;
}
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">用户管理</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<div style="padding: 14px 24px; border-bottom: 1px solid var(--divider); background: #FFFFFF; display: flex; justify-content: space-between; align-items: center;">
<div style="font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px;">
<span>用户表:</span>
<span style="background: var(--color-primary-light); color: var(--color-primary); border: 1px solid var(--color-primary-border); padding: 4px 12px; border-radius: 100px; font-size: 13px;">New_UserDatabase</span>
</div>
<div style="display: flex; gap: 8px;">
<button style="background: var(--color-primary); color: white; border: none; padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">添加</button>
<button style="background: #ECFDF5; color: #10B981; border: 1px solid #A7F3D0; padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">导入</button>
<button style="background: white; border: 1px solid var(--divider); padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">编辑</button>
</div>
</div>
<main class="inset-split-body">
<!-- 左侧 360px 花名册列表 -->
<div class="side-roster-box">
<div style="font-size: 14.5px; font-weight: 700; color: var(--color-primary);">学员花名册 (3人)</div>
<div class="roster-item active">
<div style="display: flex; justify-content: space-between; font-weight: 700;"><span>陈穑 (男)</span><span style="color: var(--color-primary); font-size: 12px;">选中</span></div>
<div style="font-size: 12px; color: var(--text-sub); margin-top: 4px;">学号: 121928 · 2017-01-01</div>
</div>
<div class="roster-item">
<div style="display: flex; justify-content: space-between; font-weight: 700;"><span>陈禹豪 (男)</span><span style="color: var(--text-sub); font-size: 12px;">就绪</span></div>
<div style="font-size: 12px; color: var(--text-sub); margin-top: 4px;">学号: 129383 · 2020-01-01</div>
</div>
<div class="roster-item">
<div style="display: flex; justify-content: space-between; font-weight: 700;"><span>栾一墨 (男)</span><span style="color: var(--text-sub); font-size: 12px;">就绪</span></div>
<div style="font-size: 12px; color: var(--text-sub); margin-top: 4px;">学号: 132672 · 2016-01-01</div>
</div>
</div>
<!-- 右侧 1fr 详细档案与生理区间卡片 -->
<div class="detail-profile-box">
<div style="display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--divider); padding-bottom: 12px;">
<div>
<h2 style="font-size: 17px; font-weight: 700;">陈穑 的完整档案</h2>
<div style="font-size: 12px; color: var(--text-sub); margin-top: 2px;">所属数据表: New_UserDatabase</div>
</div>
<div style="display: flex; gap: 8px;">
<button style="border: 1px solid var(--divider); background: white; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: 700;">✏️ 编辑档案</button>
<button style="border: 1px solid #FECACA; background: #FEF2F2; color: #EF4444; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: 700;">🗑️ 删除</button>
</div>
</div>
<div class="prop-pill-grid">
<div class="prop-pill-row"><span style="color: var(--text-sub); font-size: 13px;">学号</span><b>121928</b></div>
<div class="prop-pill-row"><span style="color: var(--text-sub); font-size: 13px;">出生日期</span><b>2017-01-01</b></div>
<div class="prop-pill-row"><span style="color: var(--text-sub); font-size: 13px;">身高 / 体重</span><b>146 cm / 39.0 kg</b></div>
<div class="prop-pill-row"><span style="color: var(--text-sub); font-size: 13px;">绑定手环状态</span><span style="color: var(--text-sub);">未绑定</span></div>
<div class="prop-pill-row"><span style="color: var(--text-sub); font-size: 13px;">静息心率 (bpm)</span><b style="color: var(--color-primary);">60 bpm</b></div>
<div class="prop-pill-row"><span style="color: var(--text-sub); font-size: 13px;">最大心率 (bpm)</span><b style="color: var(--color-primary);">199 (自动计算)</b></div>
</div>
</div>
</main>
</div>
</body>
</html>
@@ -0,0 +1,80 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 5:Nordic Master 极简多屏工坊</title>
<style>
:root {
--color-primary: #2563EB;
--bg: #F8FAFC;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: #F1F5F9; color: var(--text-main); min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px); display: flex; flex-direction: column;
}
.device-wrapper {
width: 100%; max-width: min(100%, 1160px); margin: 0 auto; background: var(--surface);
border-radius: 20px; border: 1px solid var(--divider); box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
overflow: hidden; position: relative; min-height: 660px; display: flex; flex-direction: column;
}
.appbar {
height: 60px; display: flex; align-items: center; justify-content: space-between;
padding: 0 20px; border-bottom: 1px solid var(--divider); background: var(--surface);
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
.nordic-body {
padding: clamp(20px, 2.5vw, 30px); background: #FFFFFF; flex: 1; overflow-y: auto;
display: flex; flex-direction: column; gap: 12px;
}
.n-row {
border: 1px solid var(--divider); border-radius: 10px; padding: 14px 18px;
display: flex; justify-content: space-between; align-items: center;
}
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">用户管理</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<div style="padding: 12px 24px; border-bottom: 1px solid var(--divider); display: flex; justify-content: space-between; align-items: center;">
<div>用户表: <b>UserDatabase_CHINA</b></div>
<div style="display: flex; gap: 8px;">
<button style="background: #2563EB; color: white; border: none; padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">添加</button>
<button style="background: white; border: 1px solid var(--divider); padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">导入</button>
<button style="background: white; border: 1px solid var(--divider); padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;">编辑表</button>
</div>
</div>
<main class="nordic-body">
<div class="n-row">
<div><b>孙伟</b> (女 · 25岁) · 学号: 10229 · 167cm/117kg</div>
<div>静息: 60 | 最大: 188 · ✏️ 🗑️</div>
</div>
<div class="n-row">
<div><b>陈静</b> (男 · 28岁) · 学号: 203464 · 189cm/71kg</div>
<div>静息: 60 | 最大: 186 · ✏️ 🗑️</div>
</div>
</main>
</div>
</body>
</html>
+102
View File
@@ -0,0 +1,102 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>用户管理 (包含添加用户与用户表管理) - 5套重构方案对比决策中心</title>
<style>
:root {
--primary: #2563EB;
--bg: #0B0F19;
--panel: #131B2E;
--border: #1E293B;
--text: #F8FAFC;
--text-sub: #94A3B8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
display: flex;
flex-direction: column;
}
.header-bar {
padding: 16px 24px;
background: var(--panel);
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
}
.hub-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.tabs-row { display: flex; gap: 8px; }
.tab-btn {
padding: 8px 16px;
border-radius: 8px;
font-size: 13px;
font-weight: 700;
border: 1px solid var(--border);
background: #1E293B;
color: var(--text-sub);
cursor: pointer;
transition: all 0.2s ease;
}
.tab-btn.active {
background: var(--primary);
color: white;
border-color: var(--primary);
box-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
}
.preview-container {
flex: 1;
display: flex;
flex-direction: column;
padding: 20px;
}
iframe {
width: 100%;
flex: 1;
border: 1px solid var(--border);
border-radius: 16px;
background: white;
min-height: 720px;
}
</style>
</head>
<body>
<div class="header-bar">
<div class="hub-title">
<span>👥 用户管理 (含添加用户/用户表管理附属视图) 5套候选方案决策中心</span>
<span style="font-size: 12px; background: rgba(37,99,235,0.2); color: #60A5FA; padding: 2px 8px; border-radius: 100px;">全流程 SPA 多视图可交互</span>
</div>
<div class="tabs-row">
<button class="tab-btn active" onclick="switchOpt(1, this)">方案 1:Fluid Studio 多视图一体流 (推荐·家族风)</button>
<button class="tab-btn" onclick="switchOpt(2, this)">方案 2:Master-Detail Inset 经典分栏</button>
<button class="tab-btn" onclick="switchOpt(3, this)">方案 3:Drawer Modal 工作流风</button>
<button class="tab-btn" onclick="switchOpt(4, this)">方案 4:Neo-Bento 磁贴工控风</button>
<button class="tab-btn" onclick="switchOpt(5, this)">方案 5:Nordic Master 极简多屏风</button>
</div>
</div>
<div class="preview-container">
<iframe id="previewFrame" src="option_1_modern_stream.html"></iframe>
</div>
<script>
const files = {
1: 'option_1_modern_stream.html',
2: 'option_2_split_studio.html',
3: 'option_3_drawer_workflow.html',
4: 'option_4_bento_dashboard.html',
5: 'option_5_nordic_master.html'
};
function switchOpt(num, btn) {
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
btn.classList.add('active');
document.getElementById('previewFrame').src = files[num];
}
</script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

+1 -1
View File
@@ -34,7 +34,7 @@
| 4 | `自动连接配置/` | `Screenshot_20260812_143357.png` | ✅ | **已完工**(6 件齐) |
| 5 | `手环配置/` | `Screenshot_20260812_143405.png` | ✅ | **已完工**(6 件齐) |
| 6 | `DFU固件升级/` | `Screenshot_20260812_143413.png` | ✅ | **已完工**(6 件齐) |
| 7 | `用户管理/` | `Screenshot_20260812_143424.png` | ❌ | 待办 |
| 7 | `用户管理/` | `Screenshot_20260812_143424.png` | ✅ | **已完工**(6 件齐) |
| 8 | `设备数据库管理/` | `Screenshot_20260812_143432.png` | ❌ | 待办 |
| 9 | `数据上传/` | `Screenshot_20260812_143450.png` | ❌ | 待办 · 有旧基准¹ |
| 10 | `版本信息/` | `Screenshot_20260812_143456.png` | ❌ | 待办 · 有旧基准¹ |
@@ -0,0 +1,12 @@
# 任务卡片:用户管理(含添加用户/用户表管理)重构
- **任务编号**:CARD-20260817-UITask-用户管理
- **所属模块**:设置页面 UI 优化 / 用户管理
- **执行状态**:已完成 (COMPLETED)
- **选定方案**:方案 1(Fluid Studio 现代健康工作台)
- **核心优化点**:
1. 统一全局 `#2563EB` 皇家蓝与调和语义色体系,彻底移除突兀杂绿/杂红;
2. 三区精准流式卡片(头像名片区、生理心率指标区、状态开关与操作区);
3. 彻底隔离添加用户(清空表单)与编辑用户(回填档案)的状态机逻辑;
4. 支持头像上传交互预览与优质默认 SVG 头像优雅回退;
5. 完整实现用户管理主界面、添加/编辑用户表单、用户表管理三屏联动一体化工作流。
@@ -0,0 +1,40 @@
# 用户管理(包含添加/编辑用户与用户表管理)UI 设计规范
## 1. 业务全景与多视图架构
用户管理模块采用 **Fluid Studio 现代健康工作台** 架构,将以下 3 个业务核心视图组织为高内聚的单页应用(SPA)状态机:
1. **用户管理主界面 (`viewMain`)**:
- 顶部控制栏:用户表 Dropdown 切换器(默认 `UserDatabase_CHINA`)、主色渐变 `+ 添加` 按钮、幽灵边框 `导入` 与 `编辑` 按钮;
- 学员卡片流:三区流式卡片(左侧头像与基础名片、中间静息与最大心率生理胶囊、右侧统一 `#2563EB` 状态开关、独立编辑与删除操作)。
2. **添加 / 编辑用户独立表单 (`viewUserForm`)**:
- 支持通过顶部【添加】清空进入(新建空表单),或通过卡片【✏️ 编辑】精确回填对应学员档案数据进入;
- 包含大尺寸圆形头像上传/预览区、学号、用户名、性别下拉、出生日期选择器、身高/体重双列输入、静息/最大心率双列输入(支持基于年龄自动计算最大心率)、全宽主色保存按钮。
3. **用户表管理子视图 (`viewDbManage`)**:
- 顶部提供拖拽调序提示横幅与全量导出按钮;
- 用户表列表项支持拖拽手柄、重命名与删除。
---
## 2. 全局 Design Tokens 标准定义
严格对齐项目主色调 `#2563EB` 与调和语义色规范:
| Token | 值 | 语义说明 |
| :--- | :--- | :--- |
| `--color-primary` | `#2563EB` | 全局核心品牌蓝 |
| `--color-primary-dark` | `#1D4ED8` | 悬浮/深色按下态 |
| `--color-primary-light` | `#EFF6FF` | 主色浅底容器 |
| `--color-primary-border` | `#DBEAFE` | 主色高亮边框 |
| `--color-primary-gradient` | `linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%)` | 主操作按钮渐变 |
| `--color-success` | `#059669` | 调和成功绿 |
| `--color-danger` | `#E11D48` | 调和告警红 |
| `--color-danger-bg` | `#FFF1F2` | 告警浅色背景 |
| `--color-danger-border` | `#FFE4E6` | 告警浅色边框 |
| `--divider` | `#E2E8F0` | 标准分割线 |
---
## 3. 槽位与交互清单
- **AppBar**:`40dp` 圆形触控槽,点击返回;
- **用户表切换**:药丸胶囊下拉框,悬浮主色光晕;
- **头像系统**:支持本地选择图片即时预览,未上传时展示高质感 SVG 默认头像;
- **生理心率**:静息心率与最大心率双胶囊展示,编辑时支持根据出生年份自动推算 `220 - 年龄`;
- **数据状态机隔离**:添加学员与编辑学员表单严格隔离,避免脏数据污染。
Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 410 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

@@ -0,0 +1,737 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EAPManageUI - 用户管理 (包含添加/编辑用户与用户表管理 生产级基准代码)</title>
<style>
/* =========================================================================
:root 全量 Design Tokens 声明 (严格遵循全局核心主色蓝 #2563EB 标准)
========================================================================= */
:root {
/* ── 核心主题色 (Global Primary Blue Standard) ── */
--color-primary: #2563EB;
--color-primary-dark: #1D4ED8;
--color-on-primary-container: #1E40AF;
--color-primary-light: #EFF6FF;
--color-primary-container: #EFF6FF;
--color-primary-border: #DBEAFE;
--color-primary-glow: rgba(37, 99, 235, 0.22);
--color-primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
/* ── 表面与背景 ── */
--color-surface: #FFFFFF;
--color-surface-variant: #F8FAFC;
--color-background: #EEF2F6;
/* ── 文本语义色 ── */
--text-main: #0F172A;
--text-sub: #64748B;
--text-dim: #94A3B8;
/* ── 边框与分割线 ── */
--divider: #E2E8F0;
--border-card: #E2E8F0;
/* ── 统一精致语义色 (杜绝刺眼突兀杂色) ── */
--color-success: #059669;
--color-success-bg: #ECFDF5;
--color-success-border: #A7F3D0;
--color-danger: #E11D48;
--color-danger-bg: #FFF1F2;
--color-danger-border: #FFE4E6;
/* ── 圆角与阴影 ── */
--corner-card: 16px;
--corner-item: 10px;
--shadow-card: 0 4px 16px rgba(15, 23, 42, 0.03);
--shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.06);
/* ── 尺寸与栅格 ── */
--content-max-width: 1160px;
--content-gutter: clamp(16px, 2.5vw, 32px);
--appbar-height: 60px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", Roboto, sans-serif;
background: var(--color-background);
color: var(--text-main);
min-height: 100vh;
padding: var(--content-gutter);
display: flex;
flex-direction: column;
}
/* 视口模拟器容器 (大屏动态自适应) */
.device-wrapper {
width: 100%;
max-width: var(--content-max-width);
margin: 0 auto;
background: var(--color-surface);
border-radius: 20px;
border: 1px solid var(--divider);
box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
overflow: hidden;
position: relative;
min-height: 660px;
display: flex;
flex-direction: column;
}
/* 视图状态机容器 (SPA 模式无缝切换) */
.view-panel {
display: none;
flex-direction: column;
flex: 1;
}
.view-panel.active {
display: flex;
}
/* =========================================================================
1. AppBar 顶部导航栏统一规范 (40dp 纯净透明触控槽 + Hover 微圆底)
========================================================================= */
.appbar {
height: var(--appbar-height);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
border-bottom: 1px solid var(--divider);
background: var(--color-surface);
flex-shrink: 0;
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px;
height: 40px;
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
background: transparent;
border: none;
transition: all 0.15s ease;
}
.appbar-nav:hover, .appbar-more:hover {
background: rgba(15, 23, 42, 0.06);
transform: scale(0.96);
}
.appbar-nav svg, .appbar-more svg {
width: 22px;
height: 22px;
fill: var(--text-main);
}
.appbar-title {
font-size: 19px;
font-weight: 700;
margin-left: 10px;
letter-spacing: -0.01em;
}
/* =========================================================================
2. VIEW 1: 用户管理主界面
========================================================================= */
.control-header-bar {
padding: 12px 24px;
background: #F8FAFC;
border-bottom: 1px solid var(--divider);
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
flex-wrap: wrap;
}
.db-selector-box {
display: flex;
align-items: center;
gap: 10px;
}
.db-label { font-size: 14px; font-weight: 700; color: var(--text-main); }
.db-select-pill {
background: #FFFFFF;
color: var(--color-primary);
border: 1.5px solid var(--color-primary-border);
padding: 6px 14px;
border-radius: 100px;
font-size: 13.5px;
font-weight: 700;
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
transition: all 0.15s ease;
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.06);
}
.db-select-pill:hover {
border-color: var(--color-primary);
background: var(--color-primary-light);
}
.top-actions-group {
display: flex;
align-items: center;
gap: 10px;
}
.btn-ctrl-action {
height: 38px;
padding: 0 16px;
border-radius: 8px;
font-size: 13.5px;
font-weight: 700;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 6px;
transition: all 0.15s ease;
border: 1.5px solid transparent;
}
.btn-add-primary {
background: var(--color-primary-gradient);
color: white;
box-shadow: 0 2px 8px var(--color-primary-glow);
}
.btn-add-primary:hover {
transform: translateY(-1px);
box-shadow: 0 4px 14px var(--color-primary-glow);
}
.btn-ghost-secondary {
background: #FFFFFF;
color: var(--text-main);
border-color: var(--divider);
}
.btn-ghost-secondary:hover {
background: #F1F5F9;
border-color: #CBD5E1;
}
/* 3. 三区流式学员卡片矩阵 */
.users-stream-body {
padding: clamp(18px, 2.5vw, 26px);
background: #F8FAFC;
flex: 1;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 12px;
max-height: calc(100vh - 180px);
}
.user-row-card {
background: var(--color-surface);
border: 1.5px solid var(--border-card);
border-radius: 14px;
padding: 16px 20px;
display: grid;
grid-template-columns: 280px 1fr auto;
align-items: center;
gap: 20px;
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
transition: all 0.2s ease;
}
.user-row-card:hover {
border-color: #CBD5E1;
box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
transform: translateY(-1px);
}
/* Zone 1: Profile & Avatar */
.profile-zone {
display: flex;
align-items: center;
gap: 14px;
}
.avatar-thumb-box {
width: 50px;
height: 50px;
border-radius: 12px;
overflow: hidden;
background: var(--color-primary-light);
border: 1.5px solid var(--color-primary-border);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
}
.avatar-thumb-box svg { width: 28px; height: 28px; fill: var(--color-primary); }
.name-meta { display: flex; flex-direction: column; gap: 3px; }
.name-line { display: flex; align-items: center; gap: 8px; }
.u-name { font-size: 16px; font-weight: 700; color: var(--text-main); }
.u-gender { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.u-gender.female { background: #FCE7F3; color: #DB2777; }
.u-gender.male { background: #EFF6FF; color: var(--color-primary); }
.u-subline { font-size: 12.5px; color: var(--text-sub); }
.u-subline b { color: var(--text-main); font-weight: 600; font-family: ui-monospace, monospace; }
/* Zone 2: Metrics */
.metrics-zone {
display: flex;
align-items: center;
gap: 12px;
flex-wrap: wrap;
}
.metric-capsule {
background: #F8FAFC;
border: 1px solid var(--divider);
border-radius: 8px;
padding: 6px 12px;
display: flex;
align-items: center;
gap: 6px;
font-size: 12.5px;
color: var(--text-sub);
}
.metric-capsule b {
color: var(--color-primary);
font-weight: 700;
font-family: ui-monospace, monospace;
}
/* Zone 3: Controls */
.controls-zone {
display: flex;
align-items: center;
gap: 12px;
}
/* 统一开关样式 */
.switch {
position: relative; display: inline-block; width: 44px; height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
background-color: #CBD5E1; transition: .2s; border-radius: 24px;
}
.slider:before {
position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
background-color: white; transition: .2s; border-radius: 50%;
box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
input:checked + .slider { background-color: var(--color-primary); }
input:checked + .slider:before { transform: translateX(20px); }
/* 操作图标按钮 */
.action-icon-btn {
width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--divider);
background: #FFFFFF; display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; transition: all 0.15s ease;
}
.action-icon-btn:hover { background: var(--color-primary-light); border-color: var(--color-primary-border); }
.action-icon-btn.edit-btn:hover svg { fill: var(--color-primary); }
.action-icon-btn.delete-btn:hover { background: var(--color-danger-bg); border-color: var(--color-danger-border); }
.action-icon-btn.delete-btn:hover svg { fill: var(--color-danger); }
.action-icon-btn svg { width: 18px; height: 18px; fill: var(--text-sub); }
/* =========================================================================
3. VIEW 2: 添加/编辑用户独立表单
========================================================================= */
.form-view-container {
padding: 30px 40px;
background: #FFFFFF;
flex: 1;
overflow-y: auto;
display: flex;
flex-direction: column;
align-items: center;
max-width: 640px;
width: 100%;
margin: 0 auto;
gap: 20px;
}
.avatar-uploader-round {
width: 84px; height: 84px; border-radius: 50%; background: var(--color-primary-light);
border: 2px dashed var(--color-primary-border); display: flex; align-items: center; justify-content: center;
position: relative; cursor: pointer; box-shadow: 0 4px 16px var(--color-primary-glow);
transition: all 0.2s ease;
}
.avatar-uploader-round:hover {
border-color: var(--color-primary);
transform: scale(1.03);
}
.avatar-uploader-round svg { width: 40px; height: 40px; fill: var(--color-primary); }
.cam-badge {
position: absolute; bottom: 0; right: 0; width: 26px; height: 26px; border-radius: 50%;
background: var(--color-primary); display: flex; align-items: center; justify-content: center;
border: 2px solid white; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.cam-badge svg { width: 13px; height: 13px; fill: white; }
.form-grid-stack { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.f-group { display: flex; flex-direction: column; gap: 6px; }
.f-label { font-size: 13px; font-weight: 700; color: var(--text-sub); }
.f-input, .f-select {
width: 100%; height: 44px; border: 1.5px solid var(--divider); border-radius: 10px;
padding: 0 16px; font-size: 14px; color: var(--text-main); background: #FFFFFF; outline: none;
transition: all 0.15s ease;
}
.f-input:focus, .f-select:focus {
border-color: var(--color-primary);
box-shadow: 0 0 0 3px var(--color-primary-light);
}
.f-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn-submit-full {
width: 100%; height: 48px; background: var(--color-primary-gradient); color: white;
border: none; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer;
box-shadow: 0 4px 14px var(--color-primary-glow); margin-top: 10px; transition: all 0.15s ease;
}
.btn-submit-full:hover {
transform: translateY(-1px);
box-shadow: 0 6px 18px var(--color-primary-glow);
}
/* =========================================================================
4. VIEW 3: 用户表管理
========================================================================= */
.db-view-container {
padding: 24px 30px; background: #F8FAFC; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px;
}
.db-notice {
padding: 12px 20px; background: var(--color-primary-light); border: 1.5px solid var(--color-primary-border);
border-radius: 12px; display: flex; align-items: center; justify-content: space-between;
color: var(--color-on-primary-container); font-size: 13.5px; font-weight: 600;
}
.db-row {
background: white; border: 1.5px solid var(--divider); border-radius: 12px; padding: 16px 20px;
display: flex; align-items: center; justify-content: space-between; cursor: grab;
transition: all 0.15s ease;
}
.db-row:hover {
border-color: var(--color-primary);
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}
</style>
</head>
<body>
<div class="device-wrapper">
<!-- ========================================== -->
<!-- VIEW 1: 用户管理主界面 -->
<!-- ========================================== -->
<div class="view-panel active" id="viewMain">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav" title="返回"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">用户管理</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<div class="control-header-bar">
<div class="db-selector-box">
<span class="db-label">用户表:</span>
<div class="db-select-pill" onclick="openDbManageView()">
<span>UserDatabase_CHINA</span>
<svg style="width: 14px; height: 14px; fill: currentColor;" viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>
</div>
</div>
<div class="top-actions-group">
<button class="btn-ctrl-action btn-add-primary" onclick="openAddUserView()">
<svg style="width: 16px; height: 16px; fill: currentColor;" viewBox="0 0 24 24"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>
<span>添加</span>
</button>
<button class="btn-ctrl-action btn-ghost-secondary" onclick="alert('请选择要导入的学员 Excel / CSV 模板文件...')">
<svg style="width: 16px; height: 16px; fill: currentColor;" viewBox="0 0 24 24"><path d="M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"/></svg>
<span>导入</span>
</button>
<button class="btn-ctrl-action btn-ghost-secondary" onclick="openDbManageView()">
<svg style="width: 16px; height: 16px; fill: currentColor;" viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>
<span>编辑</span>
</button>
</div>
</div>
<main class="users-stream-body" id="userListContainer">
<!-- 孙伟 女 -->
<div class="user-row-card">
<div class="profile-zone">
<div class="avatar-thumb-box">
<svg viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>
</div>
<div class="name-meta">
<div class="name-line">
<span class="u-name">孙伟</span>
<span class="u-gender female">女</span>
</div>
<div class="u-subline">学号: <b>10229</b> | 年龄: <b>25岁</b> · 身高: <b>167 cm</b> | 体重: <b>117.0 kg</b></div>
</div>
</div>
<div class="metrics-zone">
<div class="metric-capsule"><span>静息心率:</span><b>60 bpm</b></div>
<div class="metric-capsule"><span>最大心率:</span><b>188</b></div>
</div>
<div class="controls-zone">
<label class="switch"><input type="checkbox" checked><span class="slider"></span></label>
<button class="action-icon-btn edit-btn" title="编辑用户" onclick="openEditUserView('孙伟', '10229', '女', '1999-04-12', '167', '117.0', '60', '188')">
<svg viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>
</button>
<button class="action-icon-btn delete-btn" title="删除用户" onclick="deleteUserRow(this, '孙伟')">
<svg viewBox="0 0 24 24"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>
</button>
</div>
</div>
<!-- 陈静 男 -->
<div class="user-row-card">
<div class="profile-zone">
<div class="avatar-thumb-box">
<svg viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>
</div>
<div class="name-meta">
<div class="name-line">
<span class="u-name">陈静</span>
<span class="u-gender male">男</span>
</div>
<div class="u-subline">学号: <b>203464</b> | 年龄: <b>28岁</b> · 身高: <b>189 cm</b> | 体重: <b>71.0 kg</b></div>
</div>
</div>
<div class="metrics-zone">
<div class="metric-capsule"><span>静息心率:</span><b>60 bpm</b></div>
<div class="metric-capsule"><span>最大心率:</span><b>186</b></div>
</div>
<div class="controls-zone">
<label class="switch"><input type="checkbox" checked><span class="slider"></span></label>
<button class="action-icon-btn edit-btn" title="编辑用户" onclick="openEditUserView('陈静', '203464', '男', '1996-08-20', '189', '71.0', '60', '186')">
<svg viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>
</button>
<button class="action-icon-btn delete-btn" title="删除用户" onclick="deleteUserRow(this, '陈静')">
<svg viewBox="0 0 24 24"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>
</button>
</div>
</div>
<!-- 吴敏 女 -->
<div class="user-row-card">
<div class="profile-zone">
<div class="avatar-thumb-box">
<svg viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>
</div>
<div class="name-meta">
<div class="name-line">
<span class="u-name">吴敏</span>
<span class="u-gender female">女</span>
</div>
<div class="u-subline">学号: <b>295</b> | 年龄: <b>29岁</b> · 身高: <b>153 cm</b> | 体重: <b>109.0 kg</b></div>
</div>
</div>
<div class="metrics-zone">
<div class="metric-capsule"><span>静息心率:</span><b>60 bpm</b></div>
<div class="metric-capsule"><span>最大心率:</span><b>185</b></div>
</div>
<div class="controls-zone">
<label class="switch"><input type="checkbox" checked><span class="slider"></span></label>
<button class="action-icon-btn edit-btn" title="编辑用户" onclick="openEditUserView('吴敏', '295', '女', '1995-11-05', '153', '109.0', '60', '185')">
<svg viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>
</button>
<button class="action-icon-btn delete-btn" title="删除用户" onclick="deleteUserRow(this, '吴敏')">
<svg viewBox="0 0 24 24"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>
</button>
</div>
</div>
</main>
</div>
<!-- ========================================== -->
<!-- VIEW 2: 添加/编辑用户独立表单 -->
<!-- ========================================== -->
<div class="view-panel" id="viewUserForm">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav" onclick="showMainView()" title="返回用户管理"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title" id="formHeaderTitle">添加用户</h1>
</div>
</header>
<main class="form-view-container">
<!-- 交互式头像上传 -->
<div class="avatar-uploader-round" onclick="document.getElementById('avatarFileInput').click()" title="点击上传自定义头像">
<div id="avatarPreviewContainer">
<svg viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>
</div>
<div class="cam-badge"><svg viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg></div>
<input type="file" id="avatarFileInput" accept="image/*" style="display: none;" onchange="previewAvatar(event)">
</div>
<span style="font-size: 13px; font-weight: 600; color: var(--color-primary); cursor: pointer;" onclick="document.getElementById('avatarFileInput').click()">点击上传/更换自定义头像</span>
<form class="form-grid-stack" onsubmit="handleFormSubmit(event)">
<div class="f-group">
<label class="f-label">学号</label>
<input type="text" id="fSno" class="f-input" placeholder="请输入学号,如 10229" required>
</div>
<div class="f-group">
<label class="f-label">用户名</label>
<input type="text" id="fName" class="f-input" placeholder="请输入用户名,如 孙伟" required>
</div>
<div class="f-group">
<label class="f-label">性别</label>
<select id="fGender" class="f-select">
<option value="未知">未知</option>
<option value="男">男</option>
<option value="女">女</option>
</select>
</div>
<div class="f-group">
<label class="f-label">出生日期</label>
<input type="date" id="fBday" class="f-input" value="2000-01-01" onchange="autoCalcMaxHr()">
</div>
<div class="f-two-col">
<div class="f-group">
<label class="f-label">身高 (cm)</label>
<input type="number" id="fH" class="f-input" placeholder="例如 167">
</div>
<div class="f-group">
<label class="f-label">体重 (kg)</label>
<input type="number" step="0.1" id="fW" class="f-input" placeholder="例如 65.0">
</div>
</div>
<div class="f-two-col">
<div class="f-group">
<label class="f-label">静息心率 (bpm)</label>
<input type="number" id="fRest" class="f-input" value="60">
</div>
<div class="f-group">
<label class="f-label">最大心率 (bpm - 自动计算)</label>
<input type="number" id="fMax" class="f-input" value="188">
</div>
</div>
<button type="submit" class="btn-submit-full" id="btnSubmitForm">保存学员信息</button>
</form>
</main>
</div>
<!-- ========================================== -->
<!-- VIEW 3: 用户表管理 -->
<!-- ========================================== -->
<div class="view-panel" id="viewDbManage">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav" onclick="showMainView()" title="返回用户管理"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">用户表管理</h1>
</div>
</header>
<main class="db-view-container">
<div class="db-notice">
<span>长按并上下拖拽可以调整用户表顺序</span>
<button style="background: var(--color-primary); color: white; border: none; padding: 7px 16px; border-radius: 8px; font-weight: 700; cursor: pointer;" onclick="alert('已成功导出当前用户表全量数据!')">导出全部用户</button>
</div>
<div class="db-row">
<div style="display: flex; align-items: center; gap: 14px;">
<span style="font-size: 20px; color: var(--text-sub); cursor: grab;">☰</span>
<div>
<div style="font-size: 15px; font-weight: 700; font-family: ui-monospace, monospace;">UserDatabase_CHINA</div>
<div style="font-size: 12px; color: var(--text-sub); margin-top: 2px;">共包含 6 名学员档案 · 当前正在使用</div>
</div>
</div>
<div style="display: flex; gap: 8px;">
<button class="action-icon-btn edit-btn" title="重命名" onclick="alert('重命名用户表')">
<svg viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>
</button>
<button class="action-icon-btn delete-btn" title="删除" onclick="alert('活动用户表不能删除!')">
<svg viewBox="0 0 24 24"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>
</button>
</div>
</div>
</main>
</div>
</div>
<script>
function showMainView() {
document.querySelectorAll('.view-panel').forEach(p => p.classList.remove('active'));
document.getElementById('viewMain').classList.add('active');
}
function openAddUserView() {
document.getElementById('formHeaderTitle').innerText = "添加用户";
document.getElementById('fSno').value = "";
document.getElementById('fName').value = "";
document.getElementById('fGender').value = "未知";
document.getElementById('fBday').value = "2000-01-01";
document.getElementById('fH').value = "";
document.getElementById('fW').value = "";
document.getElementById('fRest').value = "60";
document.getElementById('fMax').value = "188";
document.getElementById('btnSubmitForm').innerText = "保存新学员";
document.querySelectorAll('.view-panel').forEach(p => p.classList.remove('active'));
document.getElementById('viewUserForm').classList.add('active');
}
function openEditUserView(name, sno, gender, bday, h, w, rest, max) {
document.getElementById('formHeaderTitle').innerText = `编辑用户 - ${name}`;
document.getElementById('fSno').value = sno;
document.getElementById('fName').value = name;
document.getElementById('fGender').value = gender;
document.getElementById('fBday').value = bday;
document.getElementById('fH').value = h;
document.getElementById('fW').value = w;
document.getElementById('fRest').value = rest;
document.getElementById('fMax').value = max;
document.getElementById('btnSubmitForm').innerText = `更新 ${name} 的信息`;
document.querySelectorAll('.view-panel').forEach(p => p.classList.remove('active'));
document.getElementById('viewUserForm').classList.add('active');
}
function openDbManageView() {
document.querySelectorAll('.view-panel').forEach(p => p.classList.remove('active'));
document.getElementById('viewDbManage').classList.add('active');
}
function autoCalcMaxHr() {
const bDate = new Date(document.getElementById('fBday').value);
const age = new Date().getFullYear() - bDate.getFullYear();
if (age > 0) {
document.getElementById('fMax').value = Math.max(150, 220 - age);
}
}
function previewAvatar(event) {
const file = event.target.files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(e) {
document.getElementById('avatarPreviewContainer').innerHTML = `
<img src="${e.target.result}" style="width:100%;height:100%;object-fit:cover;border-radius:50%;">
`;
};
reader.readAsDataURL(file);
}
}
function handleFormSubmit(e) {
e.preventDefault();
const name = document.getElementById('fName').value;
alert(`学员 [${name}] 档案已成功写入数据库!`);
showMainView();
}
function deleteUserRow(btn, name) {
if (confirm(`确认要从当前用户表中删除学员 [${name}] 的档案吗?`)) {
btn.closest('.user-row-card').remove();
}
}
</script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

@@ -0,0 +1,20 @@
# 用户管理(含添加用户与用户表管理)实施方案
## 1. 目标与范围
本模块旨在重构【用户管理】设置子页面及其附属的【添加用户】和【用户表管理】视图,统一全局 `#2563EB` 色彩规范,隔离添加/编辑交互状态,支持头像系统与生理指标计算。
## 2. 交付物矩阵 (6件套)
- [x] 真机基准截图 1:`设置页面UI优化/用户管理/Screenshot_20260812_143424.png` / `Screenshot_20260817_用户管理_主界面.png`
- [x] 真机基准截图 2:`设置页面UI优化/用户管理/Screenshot_20260817_添加用户.png`
- [x] 真机基准截图 3:`设置页面UI优化/用户管理/Screenshot_20260817_用户表管理.png`
- [x] 生产代码:`设置页面UI优化/用户管理/baseline_ui.html`
- [x] 渲染截图:`设置页面UI优化/用户管理/image.png`
- [x] 设计规范:`设置页面UI优化/用户管理/DESIGN_SPEC.md`
- [x] 实施方案:`设置页面UI优化/用户管理/implementation_plan.md`
- [x] 任务卡片:`设置页面UI优化/用户管理/CARD-20260817-UITask-用户管理.md`
## 3. 验收标准
1. **多视图闭环**:主界面、添加用户、用户表管理三屏在同一 SPA 中平滑切换,无页面跳转卡顿;
2. **状态隔离**:点击顶部【添加】清空所有表单项;点击列表项【✏️ 编辑】精确回填该学员的所有数据;
3. **视觉统一**:消除所有突兀杂绿/杂红,全量采用 `#2563EB` 与调和语义色;
4. **头像回退**:支持自定义上传与默认 SVG 头像回退展示。