Refactor patient reminders view to use a new stats filter bar layout. Updated styling for improved responsiveness and user experience. Removed old statistics card and filter tabs, replacing them with a more compact design. Added export button functionality within the new layout.

This commit is contained in:
Ethanfly 2026-01-12 13:29:13 +08:00
parent 232b777f6c
commit ecb79253f0
3 changed files with 459 additions and 66 deletions

View File

@ -37,12 +37,16 @@
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}
* {
*, *::before, *::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
width: 100%;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: var(--color-bg);
@ -54,6 +58,8 @@
.app-container {
display: flex;
min-height: 100vh;
width: 100%;
max-width: 100vw;
}
/* 侧边栏 */
@ -235,6 +241,9 @@
margin-left: 280px;
padding: 36px 48px;
min-height: 100vh;
min-width: 0;
max-width: calc(100vw - 280px);
box-sizing: border-box;
}
.page-header {
@ -262,6 +271,9 @@
padding: 28px;
margin-bottom: 24px;
box-shadow: var(--shadow-sm);
max-width: 100%;
width: 100%;
box-sizing: border-box;
}
.card-header {
@ -574,11 +586,111 @@
}
/* 筛选标签 */
/* 统计筛选栏 - 合并版 */
.stats-filter-bar {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 24px;
background: var(--color-bg-card);
border: 1px solid var(--color-border);
border-radius: var(--radius);
padding: 12px 16px;
}
.stats-filter-grid {
display: flex;
gap: 6px;
flex: 1;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.stats-filter-item {
display: flex;
align-items: center;
gap: 6px;
padding: 8px 14px;
border-radius: 20px;
background: var(--color-bg-secondary);
border: 1px solid transparent;
text-decoration: none;
transition: all 0.2s;
white-space: nowrap;
flex-shrink: 0;
}
.stats-filter-item:hover {
background: var(--color-bg-hover);
}
.stats-filter-item.active {
background: var(--color-primary-light);
border-color: var(--color-primary);
}
.sf-value {
font-weight: 700;
font-size: 16px;
color: var(--color-text);
}
.sf-label {
font-size: 13px;
color: var(--color-text-secondary);
}
.stats-filter-item.danger .sf-value { color: var(--color-danger); }
.stats-filter-item.warning .sf-value { color: var(--color-warning); }
.stats-filter-item.success .sf-value { color: var(--color-success); }
.stats-filter-item.info .sf-value { color: var(--color-primary); }
.stats-filter-item.active .sf-label {
color: var(--color-primary);
}
.export-icon-btn {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
border-radius: 10px;
background: var(--color-bg-secondary);
border: 1px solid var(--color-border);
color: var(--color-text-secondary);
transition: all 0.2s;
flex-shrink: 0;
}
.export-icon-btn:hover {
background: var(--color-primary-light);
border-color: var(--color-primary);
color: var(--color-primary);
}
.filter-action-bar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-bottom: 24px;
}
.filter-tabs {
display: flex;
gap: 10px;
margin-bottom: 28px;
flex-wrap: wrap;
flex: 1;
}
.export-btn {
flex-shrink: 0;
}
.btn-sm {
padding: 8px 14px;
font-size: 13px;
}
.filter-tab {
@ -699,7 +811,7 @@
border-top: 1px solid var(--color-border-light);
}
/* 响应式 */
/* 响应式 - 中等屏幕 */
@media (max-width: 1024px) {
.sidebar {
width: 80px;
@ -720,9 +832,32 @@
padding: 14px;
}
.nav-item svg {
margin-right: 0;
}
.user-section {
padding: 16px 8px;
}
.user-info {
display: none;
}
.logout-btn {
width: 100%;
justify-content: center;
padding: 10px;
}
.logout-btn span {
display: none;
}
.main-content {
margin-left: 80px;
padding: 28px 24px;
max-width: calc(100vw - 80px);
}
}
@ -1055,6 +1190,8 @@
align-items: center;
justify-content: space-between;
box-shadow: var(--shadow-sm);
box-sizing: border-box;
max-width: 100vw;
}
.mobile-logo {
@ -1171,6 +1308,9 @@
.main-content {
margin-left: 0;
padding: 76px 16px 24px;
max-width: 100vw;
box-sizing: border-box;
width: 100%;
}
.page-header {
@ -1187,37 +1327,107 @@
/* 卡片适配 */
.card {
padding: 20px;
padding: 16px;
border-radius: 12px;
}
/* 统计卡片 */
/* 移动端统计筛选栏 */
.stats-filter-bar {
padding: 10px 12px;
gap: 10px;
margin-bottom: 16px;
}
.stats-filter-grid {
gap: 4px;
}
.stats-filter-item {
padding: 6px 10px;
gap: 4px;
}
.sf-value {
font-size: 14px;
}
.sf-label {
font-size: 11px;
}
.export-icon-btn {
width: 36px;
height: 36px;
}
/* 移动端统计卡片 - 紧凑模式 (备用) */
.stats-grid {
grid-template-columns: repeat(2, 1fr);
gap: 12px;
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 20px;
}
.stat-card {
padding: 16px;
flex: 1 1 calc(50% - 4px);
min-width: calc(50% - 4px);
padding: 12px 14px;
display: flex;
align-items: center;
gap: 10px;
border-radius: 10px;
}
.stat-number {
.stat-card:nth-child(5) {
flex: 1 1 100%;
justify-content: center;
}
.stat-value {
font-size: 24px;
margin-bottom: 0;
line-height: 1;
}
.stat-label {
font-size: 12px;
white-space: nowrap;
}
.stat-card:hover {
transform: none;
}
/* 筛选按钮 */
.filter-action-bar {
flex-direction: column;
align-items: stretch;
gap: 12px;
margin-bottom: 16px;
}
.filter-tabs {
flex-wrap: wrap;
gap: 8px;
display: flex;
flex-wrap: nowrap;
gap: 6px;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
padding-bottom: 4px;
}
.filter-tab {
padding: 8px 14px;
font-size: 13px;
flex-shrink: 0;
}
.export-btn {
align-self: flex-start;
}
.export-text {
display: inline;
}
/* 患者卡片 */
@ -1372,22 +1582,31 @@
flex-direction: column;
align-items: stretch;
gap: 12px;
width: 100%;
box-sizing: border-box;
}
.card-header .btn,
.card-header .btn-outline {
width: 100%;
justify-content: center;
box-sizing: border-box;
}
/* 搜索框适配 */
.search-box {
max-width: 100%;
width: 100%;
box-sizing: border-box;
}
.search-box input {
width: 100%;
box-sizing: border-box;
}
.search-box form {
width: 100%;
}
/* 操作按钮组适配 */
@ -1446,8 +1665,52 @@
/* 超小屏幕适配 */
@media (max-width: 380px) {
/* 小屏幕统计筛选栏 */
.stats-filter-bar {
padding: 8px 10px;
gap: 8px;
}
.stats-filter-item {
padding: 5px 8px;
}
.sf-value {
font-size: 13px;
}
.sf-label {
font-size: 10px;
}
.export-icon-btn {
width: 32px;
height: 32px;
}
.export-icon-btn svg {
width: 16px;
height: 16px;
}
/* 小屏幕统计卡片 - 更紧凑 (备用) */
.stats-grid {
grid-template-columns: 1fr;
gap: 6px;
}
.stat-card {
flex: 1 1 calc(50% - 3px);
min-width: calc(50% - 3px);
padding: 10px 12px;
gap: 8px;
}
.stat-value {
font-size: 20px;
}
.stat-label {
font-size: 11px;
}
.mobile-header {
@ -1470,6 +1733,14 @@
padding: 6px 12px;
font-size: 12px;
}
.export-btn .export-text {
display: none;
}
.export-btn {
padding: 8px;
}
}
</style>
</head>
@ -1555,7 +1826,7 @@
<polyline points="16 17 21 12 16 7"/>
<line x1="21" y1="12" x2="9" y2="12"/>
</svg>
退出登录
<span>退出登录</span>
</button>
</form>
</div>

View File

@ -4,15 +4,98 @@
@section('content')
<style>
/* 防止横向滚动 */
.card {
overflow-x: hidden;
/* 患者列表页面卡片 - 表格内部滚动 */
.patient-list-card {
padding: 0 !important;
width: 100%;
max-width: 100%;
box-sizing: border-box;
}
.patient-list-card .card-header {
padding: 20px 28px;
border-bottom: 1px solid var(--color-border-light);
}
.patient-list-card .table-wrapper {
width: 100%;
max-width: 100%;
overflow: hidden;
}
.patient-list-card .table-scroll-container {
display: block;
width: 100%;
max-width: 100%;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
scrollbar-width: thin;
scrollbar-color: #bbb #f0f0f0;
padding-bottom: 8px;
}
.patient-list-card .table-scroll-container::-webkit-scrollbar {
height: 12px;
}
.patient-list-card .table-scroll-container::-webkit-scrollbar-track {
background: #f0f0f0;
}
.patient-list-card .table-scroll-container::-webkit-scrollbar-thumb {
background: #bbb;
border-radius: 6px;
border: 2px solid #f0f0f0;
}
.patient-list-card .table-scroll-container::-webkit-scrollbar-thumb:hover {
background: #999;
}
.patient-list-card .empty-state {
padding: 60px 28px;
}
.patient-list-card .custom-pagination {
padding: 20px 28px;
border-top: 1px solid var(--color-border-light);
}
.patient-list-card .mobile-patient-list {
padding: 20px;
}
/* 防止移动端溢出 */
@media (max-width: 900px) {
.patient-list-card {
overflow: hidden !important;
}
.page-header {
max-width: 100%;
width: 100%;
box-sizing: border-box;
}
.mobile-patient-list {
width: 100%;
max-width: 100%;
}
.mobile-patient-card {
width: 100%;
max-width: 100%;
overflow: hidden;
}
}
/* ==================== PC端表格优化 ==================== */
.patient-table {
width: 100%;
min-width: 1100px;
border-collapse: collapse;
table-layout: auto;
}
.patient-table thead {
@ -20,7 +103,7 @@
}
.patient-table th {
padding: 14px 12px;
padding: 14px 16px;
text-align: left;
font-weight: 600;
font-size: 13px;
@ -30,9 +113,14 @@
}
.patient-table td {
padding: 16px 12px;
padding: 14px 16px;
border-bottom: 1px solid var(--color-border-light);
vertical-align: middle;
white-space: nowrap;
}
.patient-table tbody tr {
transition: background 0.15s ease;
}
.patient-table tbody tr:hover {
@ -43,6 +131,13 @@
border-bottom: none;
}
/* 固定操作列 - 可选 */
.patient-table th:last-child,
.patient-table td:last-child {
text-align: right;
min-width: 120px;
}
/* 患者信息单元格 */
.patient-cell {
display: flex;
@ -145,7 +240,8 @@
/* 备注 */
.remark-cell {
max-width: 120px;
display: inline-block;
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@ -221,23 +317,28 @@
align-items: flex-start;
justify-content: space-between;
margin-bottom: 16px;
gap: 10px;
width: 100%;
}
.mobile-patient-info {
display: flex;
align-items: center;
gap: 14px;
gap: 12px;
flex: 1;
min-width: 0;
overflow: hidden;
}
.mobile-patient-avatar {
width: 50px;
height: 50px;
width: 46px;
height: 46px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
font-size: 18px;
font-size: 16px;
color: white;
flex-shrink: 0;
}
@ -252,14 +353,26 @@
.mobile-patient-name {
font-weight: 600;
font-size: 17px;
font-size: 16px;
color: var(--color-text);
margin-bottom: 4px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.mobile-patient-meta {
font-size: 14px;
font-size: 13px;
color: var(--color-text-secondary);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.mobile-patient-info > div:last-child {
flex: 1;
min-width: 0;
overflow: hidden;
}
.mobile-patient-body {
@ -300,6 +413,8 @@
.mobile-patient-progress {
margin-bottom: 16px;
width: 100%;
box-sizing: border-box;
}
.mobile-progress-header {
@ -325,6 +440,7 @@
background: var(--color-border);
border-radius: 4px;
overflow: hidden;
width: 100%;
}
.mobile-progress-fill {
@ -351,16 +467,21 @@
.mobile-patient-actions {
display: flex;
gap: 8px;
width: 100%;
box-sizing: border-box;
}
.mobile-patient-actions .btn {
flex: 1;
justify-content: center;
padding: 10px 12px;
padding: 10px 8px;
font-size: 13px;
border-radius: 10px;
min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
box-sizing: border-box;
}
.mobile-patient-actions form {
@ -376,6 +497,8 @@
.mobile-action-delete {
flex: 0 0 44px !important;
width: 44px !important;
min-width: 44px !important;
max-width: 44px !important;
height: 44px;
padding: 0 !important;
display: flex;
@ -384,15 +507,23 @@
border: 1px solid var(--color-danger) !important;
color: var(--color-danger) !important;
background: transparent !important;
box-sizing: border-box;
}
.mobile-action-delete form {
flex: 0 0 auto !important;
}
/* 中等屏幕 - 表格宽度自适应 */
@media (min-width: 901px) and (max-width: 1200px) {
.patient-table {
min-width: 950px;
}
}
/* 移动端显示控制 */
@media (max-width: 900px) {
.table-container {
.table-wrapper {
display: none !important;
}
@ -421,7 +552,7 @@
<p class="page-subtitle">管理所有患者信息,查看随访状态</p>
</div>
<div class="card">
<div class="card patient-list-card">
<div class="card-header">
<div class="search-box">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
@ -460,7 +591,8 @@
</div>
@else
<!-- PC端表格 -->
<div class="table-container">
<div class="table-wrapper">
<div class="table-scroll-container">
<table class="patient-table">
<thead>
<tr>
@ -566,6 +698,7 @@
</tbody>
</table>
</div>
</div>
<!-- 移动端卡片列表 -->
<div class="mobile-patient-list">

View File

@ -8,47 +8,36 @@
<p class="page-subtitle">查看需要随访的患者,及时完成回访工作</p>
</div>
<!-- 统计卡片 -->
<div class="stats-grid">
<a href="{{ route('patients.reminders', ['filter' => 'all']) }}" class="stat-card {{ $filter === 'all' ? 'active' : '' }}">
<div class="stat-value">{{ $stats['total'] }}</div>
<div class="stat-label">总患者数</div>
<!-- 统计筛选栏 -->
<div class="stats-filter-bar">
<div class="stats-filter-grid">
<a href="{{ route('patients.reminders', ['filter' => 'all']) }}" class="stats-filter-item {{ $filter === 'all' ? 'active' : '' }}">
<span class="sf-value">{{ $stats['total'] }}</span>
<span class="sf-label">全部</span>
</a>
<a href="{{ route('patients.reminders', ['filter' => 'overdue']) }}" class="stat-card danger {{ $filter === 'overdue' ? 'active' : '' }}">
<div class="stat-value">{{ $stats['overdue'] }}</div>
<div class="stat-label">已过期</div>
<a href="{{ route('patients.reminders', ['filter' => 'overdue']) }}" class="stats-filter-item danger {{ $filter === 'overdue' ? 'active' : '' }}">
<span class="sf-value">{{ $stats['overdue'] }}</span>
<span class="sf-label">过期</span>
</a>
<a href="{{ route('patients.reminders', ['filter' => 'today']) }}" class="stat-card warning {{ $filter === 'today' ? 'active' : '' }}">
<div class="stat-value">{{ $stats['today'] }}</div>
<div class="stat-label">今日到期</div>
<a href="{{ route('patients.reminders', ['filter' => 'today']) }}" class="stats-filter-item warning {{ $filter === 'today' ? 'active' : '' }}">
<span class="sf-value">{{ $stats['today'] }}</span>
<span class="sf-label">今日</span>
</a>
<a href="{{ route('patients.reminders', ['filter' => 'upcoming']) }}" class="stat-card info {{ $filter === 'upcoming' ? 'active' : '' }}">
<div class="stat-value">{{ $stats['upcoming'] }}</div>
<div class="stat-label">7天内到期</div>
<a href="{{ route('patients.reminders', ['filter' => 'upcoming']) }}" class="stats-filter-item info {{ $filter === 'upcoming' ? 'active' : '' }}">
<span class="sf-value">{{ $stats['upcoming'] }}</span>
<span class="sf-label">7天内</span>
</a>
<a href="#" class="stat-card success">
<div class="stat-value">{{ $stats['completed'] }}</div>
<div class="stat-label">已完成全部随访</div>
<a href="{{ route('patients.reminders', ['filter' => 'completed']) }}" class="stats-filter-item success {{ $filter === 'completed' ? 'active' : '' }}">
<span class="sf-value">{{ $stats['completed'] }}</span>
<span class="sf-label">完成</span>
</a>
</div>
<!-- 筛选标签 -->
<div class="filter-tabs">
<a href="{{ route('patients.reminders', ['filter' => 'all']) }}" class="filter-tab {{ $filter === 'all' ? 'active' : '' }}">全部</a>
<a href="{{ route('patients.reminders', ['filter' => 'overdue']) }}" class="filter-tab {{ $filter === 'overdue' ? 'active' : '' }}">已过期</a>
<a href="{{ route('patients.reminders', ['filter' => 'today']) }}" class="filter-tab {{ $filter === 'today' ? 'active' : '' }}">今日到期</a>
<a href="{{ route('patients.reminders', ['filter' => 'upcoming']) }}" class="filter-tab {{ $filter === 'upcoming' ? 'active' : '' }}">即将到期</a>
</div>
<!-- 导出按钮 -->
<div style="margin-bottom: 24px;">
<a href="{{ route('patients.export', ['filter' => $filter]) }}" class="btn btn-outline">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
</div>
<a href="{{ route('patients.export', ['filter' => $filter]) }}" class="export-icon-btn" title="导出">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
<polyline points="7 10 12 15 17 10"/>
<line x1="12" y1="15" x2="12" y2="3"/>
</svg>
导出当前列表
</a>
</div>