Files
EAP_Interface_html/.preview/user_manage/option_1_modern_stream.html
T
zhy200308 96c82ad25d 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 页已完工)
2026-08-17 18:04:39 +08:00

528 lines
23 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!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>