1613 lines
63 KiB
HTML
1613 lines
63 KiB
HTML
<!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 {
|
||
--primary-color: #3498db;
|
||
--secondary-color: #2c3e50;
|
||
--success-color: #27ae60;
|
||
--danger-color: #e74c3c;
|
||
--warning-color: #f39c12;
|
||
--light-color: #f8f9fa;
|
||
--dark-color: #343a40;
|
||
--gray-color: #7f8c8d;
|
||
--border-color: #ddd;
|
||
}
|
||
|
||
body {
|
||
font-family: 'Microsoft YaHei', sans-serif;
|
||
margin: 0;
|
||
padding: 0;
|
||
background-color: #f4f6f9;
|
||
color: #333;
|
||
}
|
||
|
||
.header {
|
||
background-color: var(--secondary-color);
|
||
color: white;
|
||
padding: 15px 20px;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
||
}
|
||
|
||
.header h1 {
|
||
margin: 0;
|
||
font-size: 22px;
|
||
}
|
||
|
||
.user-info {
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.user-info span {
|
||
margin-right: 15px;
|
||
}
|
||
|
||
.logout-btn {
|
||
background-color: var(--danger-color);
|
||
color: white;
|
||
border: none;
|
||
padding: 5px 10px;
|
||
border-radius: 3px;
|
||
cursor: pointer;
|
||
transition: background-color 0.3s;
|
||
}
|
||
|
||
.logout-btn:hover {
|
||
background-color: #c0392b;
|
||
}
|
||
|
||
.container {
|
||
display: flex;
|
||
min-height: calc(100vh - 60px);
|
||
}
|
||
|
||
.sidebar {
|
||
width: 220px;
|
||
background-color: #34495e;
|
||
color: white;
|
||
padding: 20px 0;
|
||
transition: width 0.3s;
|
||
}
|
||
|
||
.sidebar-menu {
|
||
list-style: none;
|
||
padding: 0;
|
||
margin: 0;
|
||
}
|
||
|
||
.sidebar-menu li {
|
||
padding: 12px 20px;
|
||
cursor: pointer;
|
||
transition: background-color 0.3s;
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.sidebar-menu li i {
|
||
margin-right: 10px;
|
||
width: 20px;
|
||
text-align: center;
|
||
}
|
||
|
||
.sidebar-menu li:hover {
|
||
background-color: var(--secondary-color);
|
||
}
|
||
|
||
.sidebar-menu li.active {
|
||
background-color: var(--secondary-color);
|
||
border-left: 4px solid var(--primary-color);
|
||
}
|
||
|
||
.main-content {
|
||
flex: 1;
|
||
padding: 20px;
|
||
transition: margin-left 0.3s;
|
||
}
|
||
|
||
.card {
|
||
background-color: white;
|
||
border-radius: 5px;
|
||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||
padding: 20px;
|
||
margin-bottom: 20px;
|
||
}
|
||
|
||
.card-header {
|
||
border-bottom: 1px solid var(--border-color);
|
||
padding-bottom: 10px;
|
||
margin-bottom: 15px;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
}
|
||
|
||
.card-header h2 {
|
||
margin: 0;
|
||
font-size: 18px;
|
||
color: var(--secondary-color);
|
||
}
|
||
|
||
table {
|
||
width: 100%;
|
||
border-collapse: collapse;
|
||
}
|
||
|
||
th, td {
|
||
padding: 12px 15px;
|
||
text-align: left;
|
||
border-bottom: 1px solid var(--border-color);
|
||
}
|
||
|
||
th {
|
||
background-color: var(--light-color);
|
||
font-weight: bold;
|
||
color: var(--secondary-color);
|
||
}
|
||
|
||
tr:hover {
|
||
background-color: #f5f5f5;
|
||
}
|
||
|
||
.btn {
|
||
padding: 8px 12px;
|
||
border-radius: 3px;
|
||
border: none;
|
||
cursor: pointer;
|
||
font-size: 14px;
|
||
margin-right: 5px;
|
||
transition: background-color 0.3s;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.btn i {
|
||
margin-right: 5px;
|
||
}
|
||
|
||
.btn-primary {
|
||
background-color: var(--primary-color);
|
||
color: white;
|
||
}
|
||
|
||
.btn-success {
|
||
background-color: var(--success-color);
|
||
color: white;
|
||
}
|
||
|
||
.btn-danger {
|
||
background-color: var(--danger-color);
|
||
color: white;
|
||
}
|
||
|
||
.btn-warning {
|
||
background-color: var(--warning-color);
|
||
color: white;
|
||
}
|
||
|
||
.btn-info {
|
||
background-color: #17a2b8;
|
||
color: white;
|
||
}
|
||
|
||
.btn-primary:hover {
|
||
background-color: #2980b9;
|
||
}
|
||
|
||
.btn-success:hover {
|
||
background-color: #219653;
|
||
}
|
||
|
||
.btn-danger:hover {
|
||
background-color: #c0392b;
|
||
}
|
||
|
||
.btn-warning:hover {
|
||
background-color: #e67e22;
|
||
}
|
||
|
||
.btn-info:hover {
|
||
background-color: #138496;
|
||
}
|
||
|
||
.status-active {
|
||
color: var(--success-color);
|
||
font-weight: bold;
|
||
}
|
||
|
||
.status-expired {
|
||
color: var(--danger-color);
|
||
font-weight: bold;
|
||
}
|
||
|
||
.status-pending {
|
||
color: var(--warning-color);
|
||
font-weight: bold;
|
||
}
|
||
|
||
.status-warning {
|
||
color: var(--warning-color);
|
||
font-weight: bold;
|
||
}
|
||
|
||
.health-record {
|
||
margin-bottom: 20px;
|
||
padding: 15px;
|
||
background-color: white;
|
||
border-radius: 5px;
|
||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||
}
|
||
|
||
.health-record-header {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
margin-bottom: 10px;
|
||
padding-bottom: 10px;
|
||
border-bottom: 1px solid var(--border-color);
|
||
}
|
||
|
||
.health-record-title {
|
||
font-weight: bold;
|
||
color: var(--secondary-color);
|
||
}
|
||
|
||
.health-record-date {
|
||
color: var(--gray-color);
|
||
font-size: 14px;
|
||
}
|
||
|
||
.health-record-content {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 20px;
|
||
}
|
||
|
||
.health-record-section {
|
||
flex: 1;
|
||
min-width: 250px;
|
||
}
|
||
|
||
.health-record-section h4 {
|
||
margin-top: 0;
|
||
color: var(--secondary-color);
|
||
border-bottom: 1px solid var(--border-color);
|
||
padding-bottom: 5px;
|
||
}
|
||
|
||
.health-record-item {
|
||
display: flex;
|
||
margin-bottom: 8px;
|
||
}
|
||
|
||
.health-record-label {
|
||
width: 120px;
|
||
font-weight: bold;
|
||
color: #555;
|
||
}
|
||
|
||
.health-record-value {
|
||
flex: 1;
|
||
}
|
||
|
||
.badge {
|
||
display: inline-block;
|
||
padding: 3px 8px;
|
||
border-radius: 10px;
|
||
font-size: 12px;
|
||
font-weight: bold;
|
||
margin-left: 5px;
|
||
}
|
||
|
||
.badge-success {
|
||
background-color: var(--success-color);
|
||
color: white;
|
||
}
|
||
|
||
.badge-warning {
|
||
background-color: var(--warning-color);
|
||
color: white;
|
||
}
|
||
|
||
.badge-danger {
|
||
background-color: var(--danger-color);
|
||
color: white;
|
||
}
|
||
|
||
.badge-info {
|
||
background-color: #17a2b8;
|
||
color: white;
|
||
}
|
||
|
||
.alert {
|
||
padding: 10px 15px;
|
||
border-radius: 4px;
|
||
margin-bottom: 15px;
|
||
}
|
||
|
||
.alert-warning {
|
||
background-color: #fff3cd;
|
||
color: #856404;
|
||
border-left: 4px solid var(--warning-color);
|
||
}
|
||
|
||
.alert-info {
|
||
background-color: #d1ecf1;
|
||
color: #0c5460;
|
||
border-left: 4px solid #17a2b8;
|
||
}
|
||
|
||
.toggle-sidebar {
|
||
display: none;
|
||
background: none;
|
||
border: none;
|
||
color: white;
|
||
font-size: 20px;
|
||
cursor: pointer;
|
||
margin-right: 15px;
|
||
}
|
||
|
||
.filter-bar {
|
||
display: flex;
|
||
margin-bottom: 20px;
|
||
gap: 10px;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.filter-bar select,
|
||
.filter-bar input {
|
||
padding: 8px;
|
||
border: 1px solid var(--border-color);
|
||
border-radius: 4px;
|
||
min-width: 150px;
|
||
}
|
||
|
||
.filter-bar button {
|
||
padding: 8px 15px;
|
||
background-color: var(--primary-color);
|
||
color: white;
|
||
border: none;
|
||
border-radius: 4px;
|
||
cursor: pointer;
|
||
transition: background-color 0.3s;
|
||
}
|
||
|
||
.filter-bar button:hover {
|
||
background-color: #2980b9;
|
||
}
|
||
|
||
.stat-cards {
|
||
display: flex;
|
||
gap: 20px;
|
||
margin-bottom: 20px;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.stat-card {
|
||
flex: 1;
|
||
min-width: 200px;
|
||
background-color: white;
|
||
border-radius: 5px;
|
||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||
padding: 20px;
|
||
text-align: center;
|
||
}
|
||
|
||
.stat-card h3 {
|
||
margin-top: 0;
|
||
color: var(--gray-color);
|
||
}
|
||
|
||
.stat-card .value {
|
||
font-size: 24px;
|
||
font-weight: bold;
|
||
margin: 10px 0;
|
||
}
|
||
|
||
.stat-card .trend {
|
||
font-size: 14px;
|
||
color: var(--success-color);
|
||
}
|
||
|
||
.stat-card .trend.down {
|
||
color: var(--danger-color);
|
||
}
|
||
|
||
.modal {
|
||
display: none;
|
||
position: fixed;
|
||
z-index: 1000;
|
||
left: 0;
|
||
top: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
overflow: auto;
|
||
background-color: rgba(0,0,0,0.4);
|
||
}
|
||
|
||
.modal-content {
|
||
background-color: #fefefe;
|
||
margin: 10% auto;
|
||
padding: 20px;
|
||
border: 1px solid #888;
|
||
width: 60%;
|
||
border-radius: 5px;
|
||
max-width: 800px;
|
||
box-shadow: 0 5px 15px rgba(0,0,0,0.3);
|
||
}
|
||
|
||
.close {
|
||
color: #aaa;
|
||
float: right;
|
||
font-size: 28px;
|
||
font-weight: bold;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.close:hover {
|
||
color: black;
|
||
}
|
||
|
||
.form-group {
|
||
margin-bottom: 15px;
|
||
}
|
||
|
||
.form-group label {
|
||
display: block;
|
||
margin-bottom: 5px;
|
||
font-weight: bold;
|
||
}
|
||
|
||
.form-group input,
|
||
.form-group select,
|
||
.form-group textarea {
|
||
width: 100%;
|
||
padding: 8px;
|
||
border: 1px solid var(--border-color);
|
||
border-radius: 4px;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.form-group textarea {
|
||
min-height: 100px;
|
||
resize: vertical;
|
||
}
|
||
|
||
.form-actions {
|
||
text-align: right;
|
||
margin-top: 20px;
|
||
}
|
||
|
||
.profile-section {
|
||
display: flex;
|
||
margin-bottom: 20px;
|
||
}
|
||
|
||
.profile-avatar {
|
||
width: 100px;
|
||
height: 100px;
|
||
border-radius: 50%;
|
||
background-color: #eee;
|
||
margin-right: 20px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
overflow: hidden;
|
||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
||
}
|
||
|
||
.profile-avatar img {
|
||
width: 100%;
|
||
height: 100%;
|
||
object-fit: cover;
|
||
}
|
||
|
||
.profile-info {
|
||
flex: 1;
|
||
}
|
||
|
||
.profile-name {
|
||
font-size: 20px;
|
||
font-weight: bold;
|
||
margin-bottom: 5px;
|
||
}
|
||
|
||
.profile-meta {
|
||
color: var(--gray-color);
|
||
margin-bottom: 10px;
|
||
}
|
||
|
||
.profile-actions {
|
||
margin-top: 10px;
|
||
}
|
||
|
||
.info-table {
|
||
width: 100%;
|
||
}
|
||
|
||
.info-table td {
|
||
padding: 10px;
|
||
border-bottom: 1px solid var(--border-color);
|
||
}
|
||
|
||
.info-table td:first-child {
|
||
width: 30%;
|
||
font-weight: bold;
|
||
color: #555;
|
||
}
|
||
|
||
.search-bar {
|
||
display: flex;
|
||
margin-bottom: 20px;
|
||
gap: 10px;
|
||
}
|
||
|
||
.search-bar input {
|
||
flex: 1;
|
||
padding: 10px;
|
||
border: 1px solid var(--border-color);
|
||
border-radius: 4px;
|
||
}
|
||
|
||
.search-bar button {
|
||
padding: 10px 15px;
|
||
background-color: var(--primary-color);
|
||
color: white;
|
||
border: none;
|
||
border-radius: 4px;
|
||
cursor: pointer;
|
||
transition: background-color 0.3s;
|
||
}
|
||
|
||
.search-bar button:hover {
|
||
background-color: #2980b9;
|
||
}
|
||
|
||
.pagination {
|
||
display: flex;
|
||
justify-content: center;
|
||
margin-top: 20px;
|
||
}
|
||
|
||
.pagination a {
|
||
color: var(--primary-color);
|
||
padding: 8px 16px;
|
||
text-decoration: none;
|
||
border: 1px solid var(--border-color);
|
||
margin: 0 4px;
|
||
}
|
||
|
||
.pagination a.active {
|
||
background-color: var(--primary-color);
|
||
color: white;
|
||
border: 1px solid var(--primary-color);
|
||
}
|
||
|
||
.pagination a:hover:not(.active) {
|
||
background-color: #ddd;
|
||
}
|
||
|
||
@media (max-width: 992px) {
|
||
.sidebar {
|
||
width: 60px;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.sidebar-menu li span {
|
||
display: none;
|
||
}
|
||
|
||
.sidebar-menu li i {
|
||
margin-right: 0;
|
||
font-size: 18px;
|
||
}
|
||
|
||
.sidebar.expanded {
|
||
width: 220px;
|
||
}
|
||
|
||
.sidebar.expanded .sidebar-menu li span {
|
||
display: inline;
|
||
}
|
||
|
||
.toggle-sidebar {
|
||
display: block;
|
||
}
|
||
}
|
||
|
||
@media (max-width: 768px) {
|
||
.container {
|
||
flex-direction: column;
|
||
}
|
||
|
||
.sidebar {
|
||
width: 100%;
|
||
padding: 10px 0;
|
||
}
|
||
|
||
.sidebar-menu {
|
||
display: flex;
|
||
overflow-x: auto;
|
||
}
|
||
|
||
.sidebar-menu li {
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.sidebar.expanded .sidebar-menu {
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.main-content {
|
||
padding: 15px;
|
||
}
|
||
|
||
.stat-cards {
|
||
flex-direction: column;
|
||
}
|
||
|
||
.health-record-content {
|
||
flex-direction: column;
|
||
}
|
||
|
||
.modal-content {
|
||
width: 90%;
|
||
margin: 20px auto;
|
||
}
|
||
}
|
||
</style>
|
||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
|
||
</head>
|
||
<body>
|
||
<div class="header">
|
||
<div>
|
||
<button class="toggle-sidebar" onclick="toggleSidebar()">
|
||
<i class="fas fa-bars"></i>
|
||
</button>
|
||
<h1>员工健康管理系统</h1>
|
||
</div>
|
||
<div class="user-info">
|
||
<span id="current-username">张三 (EMP001)</span>
|
||
<button class="logout-btn" onclick="logout()">
|
||
<i class="fas fa-sign-out-alt"></i> 退出
|
||
</button>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="container">
|
||
<div class="sidebar" id="sidebar">
|
||
<ul class="sidebar-menu">
|
||
<li class="active" data-target="dashboard">
|
||
<i class="fas fa-tachometer-alt"></i>
|
||
<span>工作台</span>
|
||
</li>
|
||
<li data-target="health-records">
|
||
<i class="fas fa-heartbeat"></i>
|
||
<span>健康档案</span>
|
||
</li>
|
||
<li data-target="medical-checkups">
|
||
<i class="fas fa-procedures"></i>
|
||
<span>体检记录</span>
|
||
</li>
|
||
<li data-target="health-monitoring">
|
||
<i class="fas fa-chart-line"></i>
|
||
<span>健康监测</span>
|
||
</li>
|
||
<li data-target="profile">
|
||
<i class="fas fa-user"></i>
|
||
<span>个人信息</span>
|
||
</li>
|
||
<li data-target="settings">
|
||
<i class="fas fa-cog"></i>
|
||
<span>系统设置</span>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="main-content" id="main-content">
|
||
<!-- 工作台 -->
|
||
<div id="dashboard" class="tab-content active">
|
||
<div class="card">
|
||
<div class="card-header">
|
||
<h2><i class="fas fa-tachometer-alt"></i> 健康概览</h2>
|
||
</div>
|
||
|
||
<div class="stat-cards">
|
||
<div class="stat-card">
|
||
<h3>健康评分</h3>
|
||
<div class="value">86</div>
|
||
<div class="trend">↑ 2% 较上月</div>
|
||
</div>
|
||
<div class="stat-card">
|
||
<h3>最近体检</h3>
|
||
<div class="value">2023-10-15</div>
|
||
<div class="trend">正常</div>
|
||
</div>
|
||
<div class="stat-card">
|
||
<h3>BMI指数</h3>
|
||
<div class="value">22.5</div>
|
||
<div class="trend">正常范围</div>
|
||
</div>
|
||
<div class="stat-card">
|
||
<h3>血压</h3>
|
||
<div class="value">120/80</div>
|
||
<div class="trend">正常</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="alert alert-warning">
|
||
<i class="fas fa-exclamation-triangle"></i> 您的下一次体检安排在 <strong>2024-04-15</strong>,请提前做好准备。
|
||
</div>
|
||
|
||
<div class="alert alert-info">
|
||
<i class="fas fa-info-circle"></i> 根据您的体检报告,建议您 <strong>减少高脂饮食,增加运动量</strong>。
|
||
</div>
|
||
|
||
<div class="card">
|
||
<div class="card-header">
|
||
<h2><i class="fas fa-bell"></i> 健康提醒</h2>
|
||
</div>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>事项</th>
|
||
<th>日期</th>
|
||
<th>状态</th>
|
||
<th>操作</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>年度体检</td>
|
||
<td>2024-04-15</td>
|
||
<td class="status-active">待安排</td>
|
||
<td>
|
||
<button class="btn btn-primary btn-sm">
|
||
<i class="fas fa-info-circle"></i> 详情
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>健康问卷</td>
|
||
<td>2023-12-01</td>
|
||
<td class="status-pending">待完成</td>
|
||
<td>
|
||
<button class="btn btn-primary btn-sm">
|
||
<i class="fas fa-edit"></i> 填写
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>血压复查</td>
|
||
<td>2023-12-10</td>
|
||
<td class="status-warning">即将到期</td>
|
||
<td>
|
||
<button class="btn btn-primary btn-sm">
|
||
<i class="fas fa-calendar"></i> 预约
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 健康档案 -->
|
||
<div id="health-records" class="tab-content">
|
||
<div class="card">
|
||
<div class="card-header">
|
||
<h2><i class="fas fa-heartbeat"></i> 健康档案</h2>
|
||
<button class="btn btn-success" onclick="showAddHealthRecordModal()">
|
||
<i class="fas fa-plus"></i> 添加记录
|
||
</button>
|
||
</div>
|
||
|
||
<div class="health-record">
|
||
<div class="health-record-header">
|
||
<div class="health-record-title">
|
||
2023年度体检报告
|
||
<span class="badge badge-success">正常</span>
|
||
</div>
|
||
<div class="health-record-date">
|
||
体检日期: 2023-10-15 | 有效期至: 2024-10-15
|
||
</div>
|
||
</div>
|
||
<div class="health-record-content">
|
||
<div class="health-record-section">
|
||
<h4><i class="fas fa-hospital"></i> 基本信息</h4>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">体检医院:</div>
|
||
<div class="health-record-value">北京协和医院</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">体检套餐:</div>
|
||
<div class="health-record-value">高级管理人员套餐</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">总评:</div>
|
||
<div class="health-record-value">健康状况良好,无明显异常</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">建议:</div>
|
||
<div class="health-record-value">保持规律作息,适量运动,控制饮食</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="health-record-section">
|
||
<h4><i class="fas fa-flask"></i> 检验结果</h4>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">血常规:</div>
|
||
<div class="health-record-value">正常</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">尿常规:</div>
|
||
<div class="health-record-value">正常</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">肝功能:</div>
|
||
<div class="health-record-value">正常</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">肾功能:</div>
|
||
<div class="health-record-value">正常</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">血脂:</div>
|
||
<div class="health-record-value">
|
||
总胆固醇 5.2 mmol/L <span class="badge badge-warning">偏高</span>
|
||
</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">血糖:</div>
|
||
<div class="health-record-value">5.1 mmol/L (正常)</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="health-record-section">
|
||
<h4><i class="fas fa-procedures"></i> 检查结果</h4>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">心电图:</div>
|
||
<div class="health-record-value">窦性心律,正常心电图</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">胸部X光:</div>
|
||
<div class="health-record-value">心肺膈未见明显异常</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">腹部B超:</div>
|
||
<div class="health-record-value">肝胆胰脾肾未见明显异常</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">眼科检查:</div>
|
||
<div class="health-record-value">
|
||
视力: 左眼1.0,右眼1.2
|
||
<span class="badge badge-warning">轻度视疲劳</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="health-record">
|
||
<div class="health-record-header">
|
||
<div class="health-record-title">
|
||
2022年度体检报告
|
||
<span class="badge badge-success">正常</span>
|
||
</div>
|
||
<div class="health-record-date">
|
||
体检日期: 2022-10-20 | 有效期至: 2023-10-20
|
||
</div>
|
||
</div>
|
||
<div class="health-record-content">
|
||
<div class="health-record-section">
|
||
<h4><i class="fas fa-hospital"></i> 基本信息</h4>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">体检医院:</div>
|
||
<div class="health-record-value">北京协和医院</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">体检套餐:</div>
|
||
<div class="health-record-value">高级管理人员套餐</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">总评:</div>
|
||
<div class="health-record-value">健康状况良好</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">建议:</div>
|
||
<div class="health-record-value">注意控制体重,减少高脂饮食</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="health-record-section">
|
||
<h4><i class="fas fa-flask"></i> 检验结果</h4>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">血常规:</div>
|
||
<div class="health-record-value">正常</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">尿常规:</div>
|
||
<div class="health-record-value">正常</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">肝功能:</div>
|
||
<div class="health-record-value">正常</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">肾功能:</div>
|
||
<div class="health-record-value">正常</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">血脂:</div>
|
||
<div class="health-record-value">
|
||
总胆固醇 5.0 mmol/L <span class="badge badge-warning">偏高</span>
|
||
</div>
|
||
</div>
|
||
<div class="health-record-item">
|
||
<div class="health-record-label">血糖:</div>
|
||
<div class="health-record-value">5.0 mmol/L (正常)</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 体检记录 -->
|
||
<div id="medical-checkups" class="tab-content">
|
||
<div class="card">
|
||
<div class="card-header">
|
||
<h2><i class="fas fa-procedures"></i> 体检记录</h2>
|
||
<button class="btn btn-success" onclick="showAddCheckupModal()">
|
||
<i class="fas fa-plus"></i> 添加体检记录
|
||
</button>
|
||
</div>
|
||
|
||
<div class="filter-bar">
|
||
<select id="checkup-year">
|
||
<option value="">所有年份</option>
|
||
<option value="2023" selected>2023年</option>
|
||
<option value="2022">2022年</option>
|
||
<option value="2021">2021年</option>
|
||
</select>
|
||
<select id="checkup-type">
|
||
<option value="">所有类型</option>
|
||
<option value="annual">年度体检</option>
|
||
<option value="pre-employment">入职体检</option>
|
||
<option value="special">专项体检</option>
|
||
</select>
|
||
<button class="btn btn-primary">
|
||
<i class="fas fa-filter"></i> 筛选
|
||
</button>
|
||
</div>
|
||
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>体检日期</th>
|
||
<th>体检类型</th>
|
||
<th>体检医院</th>
|
||
<th>体检结果</th>
|
||
<th>下次体检日期</th>
|
||
<th>操作</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>2023-10-15</td>
|
||
<td>年度体检</td>
|
||
<td>北京协和医院</td>
|
||
<td><span class="badge badge-success">正常</span></td>
|
||
<td>2024-10-15</td>
|
||
<td>
|
||
<button class="btn btn-primary btn-sm">
|
||
<i class="fas fa-eye"></i> 查看
|
||
</button>
|
||
<button class="btn btn-info btn-sm">
|
||
<i class="fas fa-download"></i> 下载报告
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>2022-10-20</td>
|
||
<td>年度体检</td>
|
||
<td>北京协和医院</td>
|
||
<td><span class="badge badge-success">正常</span></td>
|
||
<td>2023-10-20</td>
|
||
<td>
|
||
<button class="btn btn-primary btn-sm">
|
||
<i class="fas fa-eye"></i> 查看
|
||
</button>
|
||
<button class="btn btn-info btn-sm">
|
||
<i class="fas fa-download"></i> 下载报告
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>2021-11-05</td>
|
||
<td>年度体检</td>
|
||
<td>北京协和医院</td>
|
||
<td><span class="badge badge-success">正常</span></td>
|
||
<td>2022-11-05</td>
|
||
<td>
|
||
<button class="btn btn-primary btn-sm">
|
||
<i class="fas fa-eye"></i> 查看
|
||
</button>
|
||
<button class="btn btn-info btn-sm">
|
||
<i class="fas fa-download"></i> 下载报告
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>2020-05-10</td>
|
||
<td>入职体检</td>
|
||
<td>北京协和医院</td>
|
||
<td><span class="badge badge-success">正常</span></td>
|
||
<td>2021-05-10</td>
|
||
<td>
|
||
<button class="btn btn-primary btn-sm">
|
||
<i class="fas fa-eye"></i> 查看
|
||
</button>
|
||
<button class="btn btn-info btn-sm">
|
||
<i class="fas fa-download"></i> 下载报告
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 健康监测 -->
|
||
<div id="health-monitoring" class="tab-content">
|
||
<div class="card">
|
||
<div class="card-header">
|
||
<h2><i class="fas fa-chart-line"></i> 健康监测</h2>
|
||
<button class="btn btn-success" onclick="showAddHealthDataModal()">
|
||
<i class="fas fa-plus"></i> 添加数据
|
||
</button>
|
||
</div>
|
||
|
||
<div class="filter-bar">
|
||
<select id="health-metric">
|
||
<option value="weight">体重</option>
|
||
<option value="blood-pressure">血压</option>
|
||
<option value="heart-rate">心率</option>
|
||
<option value="blood-sugar">血糖</option>
|
||
<option value="cholesterol">胆固醇</option>
|
||
</select>
|
||
<select id="time-range">
|
||
<option value="7">最近7天</option>
|
||
<option value="30" selected>最近30天</option>
|
||
<option value="90">最近90天</option>
|
||
<option value="365">最近1年</option>
|
||
</select>
|
||
<button class="btn btn-primary">
|
||
<i class="fas fa-filter"></i> 筛选
|
||
</button>
|
||
</div>
|
||
|
||
<div class="card">
|
||
<div class="card-header">
|
||
<h2><i class="fas fa-weight"></i> 体重变化趋势</h2>
|
||
</div>
|
||
<div style="height: 300px; background-color: #f9f9f9; display: flex; align-items: center; justify-content: center;">
|
||
<p style="color: #999;">体重变化趋势图表</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="card">
|
||
<div class="card-header">
|
||
<h2><i class="fas fa-heartbeat"></i> 血压变化趋势</h2>
|
||
</div>
|
||
<div style="height: 300px; background-color: #f9f9f9; display: flex; align-items: center; justify-content: center;">
|
||
<p style="color: #999;">血压变化趋势图表</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="card">
|
||
<div class="card-header">
|
||
<h2><i class="fas fa-chart-bar"></i> 健康指标统计</h2>
|
||
</div>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>指标</th>
|
||
<th>最近值</th>
|
||
<th>变化趋势</th>
|
||
<th>正常范围</th>
|
||
<th>状态</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>体重 (kg)</td>
|
||
<td>72.5</td>
|
||
<td>↓ 0.5 (较上月)</td>
|
||
<td>60-80</td>
|
||
<td><span class="badge badge-success">正常</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td>BMI</td>
|
||
<td>22.5</td>
|
||
<td>→ 无变化</td>
|
||
<td>18.5-24</td>
|
||
<td><span class="badge badge-success">正常</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td>血压 (mmHg)</td>
|
||
<td>120/80</td>
|
||
<td>→ 无变化</td>
|
||
<td>90-140/60-90</td>
|
||
<td><span class="badge badge-success">正常</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td>空腹血糖 (mmol/L)</td>
|
||
<td>5.1</td>
|
||
<td>↑ 0.2 (较上月)</td>
|
||
<td>3.9-6.1</td>
|
||
<td><span class="badge badge-success">正常</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td>总胆固醇 (mmol/L)</td>
|
||
<td>5.2</td>
|
||
<td>↓ 0.3 (较上月)</td>
|
||
<td>2.8-5.2</td>
|
||
<td><span class="badge badge-warning">临界高值</span></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 个人信息 -->
|
||
<div id="profile" class="tab-content">
|
||
<div class="card">
|
||
<div class="card-header">
|
||
<h2><i class="fas fa-user"></i> 个人信息</h2>
|
||
<button class="btn btn-primary" id="edit-profile-btn">
|
||
<i class="fas fa-edit"></i> 编辑信息
|
||
</button>
|
||
</div>
|
||
|
||
<div class="profile-section">
|
||
<div class="profile-avatar">
|
||
<img src="https://randomuser.me/api/portraits/men/32.jpg" alt="员工头像">
|
||
</div>
|
||
<div class="profile-info">
|
||
<div class="profile-name" id="profile-name">张三</div>
|
||
<div class="profile-meta">
|
||
<span id="profile-empid">EMP001</span> |
|
||
<span id="profile-dept">技术部</span> |
|
||
<span id="profile-position">高级软件工程师</span>
|
||
</div>
|
||
<div class="profile-actions">
|
||
<button class="btn btn-primary btn-sm">
|
||
<i class="fas fa-camera"></i> 更换头像
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<table class="info-table">
|
||
<tr>
|
||
<td>员工编号</td>
|
||
<td id="employee-id">EMP001</td>
|
||
</tr>
|
||
<tr>
|
||
<td>部门</td>
|
||
<td id="department">技术部</td>
|
||
</tr>
|
||
<tr>
|
||
<td>职位</td>
|
||
<td id="position">高级软件工程师</td>
|
||
</tr>
|
||
<tr>
|
||
<td>入职日期</td>
|
||
<td id="hire-date">2020-05-15</td>
|
||
</tr>
|
||
<tr>
|
||
<td>联系电话</td>
|
||
<td id="phone">13800138001</td>
|
||
</tr>
|
||
<tr>
|
||
<td>电子邮箱</td>
|
||
<td id="email">zhangsan@company.com</td>
|
||
</tr>
|
||
<tr>
|
||
<td>出生日期</td>
|
||
<td id="birth-date">1985-08-20</td>
|
||
</tr>
|
||
<tr>
|
||
<td>血型</td>
|
||
<td id="blood-type">A型</td>
|
||
</tr>
|
||
<tr>
|
||
<td>过敏史</td>
|
||
<td id="allergies">青霉素</td>
|
||
</tr>
|
||
<tr>
|
||
<td>紧急联系人</td>
|
||
<td id="emergency-contact">李四 (配偶) 13800138002</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 系统设置 -->
|
||
<div id="settings" class="tab-content">
|
||
<div class="card">
|
||
<div class="tabs">
|
||
<div class="tab active" onclick="switchSettingsTab('notifications')">通知设置</div>
|
||
<div class="tab" onclick="switchSettingsTab="privacy"">隐私设置</div>
|
||
<div class="tab" onclick="switchSettingsTab="account"">账户设置</div>
|
||
</div>
|
||
|
||
<div id="settings-notifications" class="settings-tab-content active">
|
||
<h3><i class="fas fa-bell"></i> 健康提醒设置</h3>
|
||
<form>
|
||
<div class="form-group">
|
||
<label>
|
||
<input type="checkbox" checked> 体检提醒
|
||
</label>
|
||
</div>
|
||
<div class="form-group">
|
||
<label>
|
||
<input type="checkbox" checked> 健康问卷提醒
|
||
</label>
|
||
</div>
|
||
<div class="form-group">
|
||
<label>
|
||
<input type="checkbox"> 每日健康提示
|
||
</label>
|
||
</div>
|
||
<div class="form-group">
|
||
<label>提醒方式</label>
|
||
<select>
|
||
<option value="email">电子邮件</option>
|
||
<option value="sms" selected>短信</option>
|
||
<option value="both">两者都</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-actions">
|
||
<button type="submit" class="btn btn-success">
|
||
<i class="fas fa-check"></i> 保存设置
|
||
</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
|
||
<div id="settings-privacy" class="settings-tab-content">
|
||
<h3><i class="fas fa-lock"></i> 隐私设置</h3>
|
||
<form>
|
||
<div class="form-group">
|
||
<label>谁可以查看我的健康数据</label>
|
||
<select>
|
||
<option value="none">仅自己</option>
|
||
<option value="hr" selected>人事部门</option>
|
||
<option value="manager">直属经理</option>
|
||
<option value="all">所有管理人员</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group">
|
||
<label>
|
||
<input type="checkbox" checked> 允许匿名统计使用我的健康数据
|
||
</label>
|
||
</div>
|
||
<div class="form-group">
|
||
<label>
|
||
<input type="checkbox"> 在团队健康报告中显示我的数据
|
||
</label>
|
||
</div>
|
||
<div class="form-actions">
|
||
<button type="submit" class="btn btn-success">
|
||
<i class="fas fa-check"></i> 保存设置
|
||
</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
|
||
<div id="settings-account" class="settings-tab-content">
|
||
<h3><i class="fas fa-user-cog"></i> 账户设置</h3>
|
||
<form>
|
||
<div class="form-group">
|
||
<label>语言</label>
|
||
<select>
|
||
<option value="zh-CN" selected>简体中文</option>
|
||
<option value="en-US">English</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group">
|
||
<label>时区</label>
|
||
<select>
|
||
<option value="UTC+8" selected>UTC+8 (北京时间)</option>
|
||
<option value="UTC+0">UTC+0 (伦敦时间)</option>
|
||
<option value="UTC-5">UTC-5 (纽约时间)</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group">
|
||
<label>主题</label>
|
||
<select>
|
||
<option value="light" selected>浅色</option>
|
||
<option value="dark">深色</option>
|
||
<option value="system">跟随系统</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-actions">
|
||
<button type="submit" class="btn btn-success">
|
||
<i class="fas fa-check"></i> 保存设置
|
||
</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 添加健康记录模态框 -->
|
||
<div id="addHealthRecordModal" class="modal">
|
||
<div class="modal-content">
|
||
<span class="close" onclick="hideModal('addHealthRecordModal')">×</span>
|
||
<h2><i class="fas fa-plus-circle"></i> 添加健康记录</h2>
|
||
<form>
|
||
<div class="form-group">
|
||
<label for="record-date">记录日期</label>
|
||
<input type="date" id="record-date">
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="record-type">记录类型</label>
|
||
<select id="record-type">
|
||
<option value="general">一般记录</option>
|
||
<option value="symptom">症状记录</option>
|
||
<option value="medication">用药记录</option>
|
||
<option value="vaccination">疫苗接种</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="record-title">标题</label>
|
||
<input type="text" id="record-title" placeholder="请输入记录标题">
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="record-description">描述</label>
|
||
<textarea id="record-description" rows="3" placeholder="请输入详细描述"></textarea>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="record-attachment">附件</label>
|
||
<input type="file" id="record-attachment">
|
||
</div>
|
||
<div class="form-actions">
|
||
<button type="button" class="btn btn-danger" onclick="hideModal('addHealthRecordModal')">
|
||
<i class="fas fa-times"></i> 取消
|
||
</button>
|
||
<button type="submit" class="btn btn-success">
|
||
<i class="fas fa-check"></i> 保存
|
||
</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 添加体检记录模态框 -->
|
||
<div id="addCheckupModal" class="modal">
|
||
<div class="modal-content">
|
||
<span class="close" onclick="hideModal('addCheckupModal')">×</span>
|
||
<h2><i class="fas fa-procedures"></i> 添加体检记录</h2>
|
||
<form>
|
||
<div class="form-group">
|
||
<label for="checkup-date">体检日期</label>
|
||
<input type="date" id="checkup-date">
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="checkup-hospital">体检医院</label>
|
||
<input type="text" id="checkup-hospital" placeholder="请输入体检医院">
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="checkup-type">体检类型</label>
|
||
<select id="checkup-type">
|
||
<option value="annual">年度体检</option>
|
||
<option value="pre-employment">入职体检</option>
|
||
<option value="special">专项体检</option>
|
||
<option value="other">其他</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="checkup-result">体检结果</label>
|
||
<select id="checkup-result">
|
||
<option value="normal">正常</option>
|
||
<option value="mild-abnormal">轻度异常</option>
|
||
<option value="abnormal">异常</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="next-checkup">下次体检日期</label>
|
||
<input type="date" id="next-checkup">
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="checkup-summary">体检总结</label>
|
||
<textarea id="checkup-summary" rows="3" placeholder="请输入体检总结"></textarea>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="checkup-report">体检报告</label>
|
||
<input type="file" id="checkup-report">
|
||
</div>
|
||
<div class="form-actions">
|
||
<button type="button" class="btn btn-danger" onclick="hideModal('addCheckupModal')">
|
||
<i class="fas fa-times"></i> 取消
|
||
</button>
|
||
<button type="submit" class="btn btn-success">
|
||
<i class="fas fa-check"></i> 保存
|
||
</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 添加健康数据模态框 -->
|
||
<div id="addHealthDataModal" class="modal">
|
||
<div class="modal-content">
|
||
<span class="close" onclick="hideModal('addHealthDataModal')">×</span>
|
||
<h2><i class="fas fa-chart-line"></i> 添加健康数据</h2>
|
||
<form>
|
||
<div class="form-group">
|
||
<label for="data-date">记录日期</label>
|
||
<input type="date" id="data-date">
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="data-time">记录时间</label>
|
||
<input type="time" id="data-time">
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="data-type">数据类型</label>
|
||
<select id="data-type">
|
||
<option value="weight">体重</option>
|
||
<option value="blood-pressure">血压</option>
|
||
<option value="heart-rate">心率</option>
|
||
<option value="blood-sugar">血糖</option>
|
||
<option value="temperature">体温</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="data-value">数值</label>
|
||
<input type="text" id="data-value" placeholder="请输入数值">
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="data-unit">单位</label>
|
||
<input type="text" id="data-unit" placeholder="请输入单位">
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="data-notes">备注</label>
|
||
<textarea id="data-notes" rows="2" placeholder="请输入备注"></textarea>
|
||
</div>
|
||
<div class="form-actions">
|
||
<button type="button" class="btn btn-danger" onclick="hideModal('addHealthDataModal')">
|
||
<i class="fas fa-times"></i> 取消
|
||
</button>
|
||
<button type="submit" class="btn btn-success">
|
||
<i class="fas fa-check"></i> 保存
|
||
</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|
||
<script>
|
||
// 初始化页面
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
// 绑定侧边栏菜单点击事件
|
||
bindSidebarMenuEvents();
|
||
|
||
// 绑定其他事件
|
||
bindEvents();
|
||
});
|
||
|
||
// 绑定侧边栏菜单点击事件
|
||
function bindSidebarMenuEvents() {
|
||
const menuItems = document.querySelectorAll('.sidebar-menu li');
|
||
|
||
menuItems.forEach(item => {
|
||
item.addEventListener('click', function() {
|
||
// 移除所有菜单项的active类
|
||
menuItems.forEach(li => li.classList.remove('active'));
|
||
|
||
// 给当前点击的菜单项添加active类
|
||
this.classList.add('active');
|
||
|
||
// 获取目标内容区域ID
|
||
const targetId = this.getAttribute('data-target');
|
||
|
||
// 隐藏所有内容区域
|
||
document.querySelectorAll('.tab-content').forEach(content => {
|
||
content.classList.remove('active');
|
||
});
|
||
|
||
// 显示目标内容区域
|
||
document.getElementById(targetId).classList.add('active');
|
||
});
|
||
});
|
||
}
|
||
|
||
// 绑定其他事件
|
||
function bindEvents() {
|
||
// 点击模态框外部关闭模态框
|
||
window.addEventListener('click', function(event) {
|
||
if (event.target.classList.contains('modal')) {
|
||
event.target.style.display = 'none';
|
||
}
|
||
});
|
||
}
|
||
|
||
// 显示模态框
|
||
function showModal(modalId) {
|
||
document.getElementById(modalId).style.display = 'block';
|
||
}
|
||
|
||
// 隐藏模态框
|
||
function hideModal(modalId) {
|
||
document.getElementById(modalId).style.display = 'none';
|
||
}
|
||
|
||
// 显示添加健康记录模态框
|
||
function showAddHealthRecordModal() {
|
||
showModal('addHealthRecordModal');
|
||
}
|
||
|
||
// 显示添加体检记录模态框
|
||
function showAddCheckupModal() {
|
||
showModal('addCheckupModal');
|
||
}
|
||
|
||
// 显示添加健康数据模态框
|
||
function showAddHealthDataModal() {
|
||
showModal('addHealthDataModal');
|
||
}
|
||
|
||
// 切换系统设置标签页
|
||
function switchSettingsTab(tabId) {
|
||
// 隐藏所有标签内容
|
||
document.querySelectorAll('.settings-tab-content').forEach(content => {
|
||
content.classList.remove('active');
|
||
});
|
||
|
||
// 取消所有标签的活动状态
|
||
document.querySelectorAll('#settings .tab').forEach(tab => {
|
||
tab.classList.remove('active');
|
||
});
|
||
|
||
// 显示选中的标签内容
|
||
document.getElementById('settings-' + tabId).classList.add('active');
|
||
|
||
// 设置选中标签的活动状态
|
||
event.currentTarget.classList.add('active');
|
||
}
|
||
|
||
// 切换侧边栏显示状态
|
||
function toggleSidebar() {
|
||
const sidebar = document.getElementById('sidebar');
|
||
sidebar.classList.toggle('expanded');
|
||
|
||
const mainContent = document.getElementById('main-content');
|
||
if (sidebar.classList.contains('expanded')) {
|
||
mainContent.style.marginLeft = '220px';
|
||
} else {
|
||
mainContent.style.marginLeft = '60px';
|
||
}
|
||
}
|
||
|
||
// 退出登录
|
||
function logout() {
|
||
if (confirm('确定要退出系统吗?')) {
|
||
window.location.href = 'login.html';
|
||
}
|
||
}
|
||
</script>
|
||
</body>
|
||
</html> |