PGXApp.vue
8.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<template>
<div class="pgx-app">
<!-- 顶部 Header -->
<header class="pgx-header">
<div class="header-left">
<div class="brand">
<el-icon class="brand-icon" :size="22"><Opportunity /></el-icon>
<span class="brand-name">嘉宝仁和</span>
<span class="brand-sub">样本流转系统 vendorPGX</span>
</div>
</div>
<div class="header-center">
<el-tag v-if="pgxStore.currentRole === 'sampler'" type="success" size="large" effect="light">
<el-icon style="margin-right:4px"><OfficeBuilding /></el-icon>医院送检方
</el-tag>
<el-tag v-else type="warning" size="large" effect="light">
<el-icon style="margin-right:4px"><Cpu /></el-icon>实验室检测人员
</el-tag>
</div>
<div class="header-right">
<span class="role-switch-label">角色切换:</span>
<el-button-group>
<el-button
:type="pgxStore.currentRole === 'sampler' ? 'primary' : 'default'"
size="small"
@click="pgxStore.switchRole('sampler')"
><el-icon><OfficeBuilding /></el-icon> 送检方</el-button>
<el-button
:type="pgxStore.currentRole === 'checkPointer' ? 'primary' : 'default'"
size="small"
@click="pgxStore.switchRole('checkPointer')"
><el-icon><Cpu /></el-icon> 实验室</el-button>
</el-button-group>
<el-divider direction="vertical" />
<el-button size="small" plain @click="$router.push('/pgx/settings')">
<el-icon><Setting /></el-icon> 设置
</el-button>
<el-button size="small" type="danger" plain @click="handleLogout">
<el-icon><SwitchButton /></el-icon> 退出
</el-button>
</div>
</header>
<div class="pgx-body">
<!-- 左侧导航 -->
<aside class="pgx-sidebar">
<div class="sidebar-section">
<div class="section-title">概览</div>
<div
class="nav-item"
:class="{ active: isActive('/pgx/dashboard') }"
@click="$router.push('/pgx/dashboard')"
><el-icon class="ni"><House /></el-icon><span>工作台</span></div>
</div>
<div class="sidebar-section">
<div class="section-title">送检流程</div>
<div
v-if="pgxStore.currentRole === 'sampler'"
class="nav-item"
:class="{ active: isActive('/pgx/register') }"
@click="$router.push('/pgx/register')"
><el-icon class="ni"><EditPen /></el-icon><span>信息登记</span></div>
<div
class="nav-item"
:class="{ active: isActive('/pgx/orders') }"
@click="$router.push('/pgx/orders')"
><el-icon class="ni"><Document /></el-icon><span>申请单管理</span></div>
<div
class="nav-item"
:class="{ active: isActive('/pgx/tracking') }"
@click="$router.push('/pgx/tracking')"
><el-icon class="ni"><Compass /></el-icon><span>状态追踪</span></div>
<div
class="nav-item"
:class="{ active: isActive('/pgx/post') }"
@click="$router.push('/pgx/post')"
><el-icon class="ni"><Van /></el-icon><span>邮寄查询</span></div>
</div>
<template v-if="pgxStore.currentRole === 'checkPointer'">
<div class="sidebar-section">
<div class="section-title">实验室操作</div>
<div
class="nav-item"
:class="{ active: isActive('/pgx/lims') }"
@click="$router.push('/pgx/lims')"
><el-icon class="ni"><Finished /></el-icon><span>样本核对接收</span></div>
<div
class="nav-item"
:class="{ active: isActive('/pgx/samples') }"
@click="$router.push('/pgx/samples')"
><el-icon class="ni"><DataLine /></el-icon><span>样本检测状态</span></div>
<div
class="nav-item"
:class="{ active: isActive('/pgx/batch') }"
@click="$router.push('/pgx/batch')"
><el-icon class="ni"><Files /></el-icon><span>批量订单</span></div>
</div>
<div class="sidebar-section">
<div class="section-title">分析与报告</div>
<div
class="nav-item"
:class="{ active: isActive('/pgx/bio') }"
@click="$router.push('/pgx/bio')"
><el-icon class="ni"><TrendCharts /></el-icon><span>生信分析平台</span></div>
<div
class="nav-item"
:class="{ active: isActive('/pgx/report-gen') }"
@click="$router.push('/pgx/report-gen')"
><el-icon class="ni"><Memo /></el-icon><span>报告生成审核</span></div>
</div>
</template>
<div class="sidebar-bottom">
<div
class="nav-item nav-item-bottom"
:class="{ active: isActive('/pgx/settings') }"
@click="$router.push('/pgx/settings')"
><el-icon class="ni"><UserFilled /></el-icon><span>账号设置</span></div>
<div class="version-tag">vendorPGX v1.0.0</div>
</div>
</aside>
<!-- 主内容区 -->
<main class="pgx-main">
<router-view v-slot="{ Component }">
<transition name="fade" mode="out-in">
<component :is="Component" />
</transition>
</router-view>
</main>
</div>
</div>
</template>
<script setup lang="ts">
import { usePGXStore } from '@/stores/pgx'
import { useAuthStore } from '@/stores/auth'
import { ElMessageBox } from 'element-plus'
import {
House, EditPen, Document, Compass, Van,
Finished, DataLine, Files, TrendCharts, Memo,
Setting, SwitchButton, OfficeBuilding, Cpu, UserFilled, Opportunity
} from '@element-plus/icons-vue'
const pgxStore = usePGXStore()
const authStore = useAuthStore()
const route = useRoute()
const router = useRouter()
function isActive(path: string) {
return route.path === path || route.path.startsWith(path + '/')
}
async function handleLogout() {
await ElMessageBox.confirm('确定退出登录吗?', '退出确认', { type: 'warning', confirmButtonText: '退出', cancelButtonText: '取消' })
authStore.logout?.()
router.push('/auth')
}
</script>
<style scoped>
.pgx-app {
position: fixed;
inset: 0;
display: flex;
flex-direction: column;
background: #f4fafb;
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
z-index: 9999;
}
/* ── Header ── */
.pgx-header {
display: flex;
align-items: center;
justify-content: space-between;
height: 56px;
background: #fff;
padding: 0 20px;
flex-shrink: 0;
border-bottom: 2px solid #00B5C8;
box-shadow: 0 2px 8px rgba(0,181,200,0.1);
z-index: 100;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 24px; }
.brand-name { color: #00B5C8; font-size: 17px; font-weight: 700; letter-spacing: 0.5px; }
.brand-sub {
color: #00B5C8;
font-size: 12px;
background: rgba(0,181,200,0.08);
border: 1px solid rgba(0,181,200,0.3);
padding: 2px 8px;
border-radius: 4px;
}
.header-right { display: flex; align-items: center; gap: 8px; }
.role-switch-label { color: #888; font-size: 12px; white-space: nowrap; }
/* ── Body ── */
.pgx-body {
display: flex;
flex: 1;
overflow: hidden;
}
/* ── Sidebar ── */
.pgx-sidebar {
width: 220px;
background: #fff;
flex-shrink: 0;
display: flex;
flex-direction: column;
overflow-y: auto;
overflow-x: hidden;
border-right: 1px solid #e0f5f8;
}
.sidebar-section {
padding: 12px 0 4px;
}
.section-title {
color: #9db8bc;
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 1px;
padding: 0 14px 6px;
}
.nav-item {
display: flex;
align-items: center;
gap: 10px;
padding: 9px 14px;
margin: 1px 8px;
border-radius: 7px;
cursor: pointer;
color: #5a7a80;
font-size: 13.5px;
transition: all 0.15s;
white-space: nowrap;
}
.nav-item:hover { background: #edfafc; color: #00B5C8; }
.nav-item.active {
background: rgba(0,181,200,0.1);
color: #00B5C8;
font-weight: 600;
border-left: 3px solid #00B5C8;
padding-left: 11px;
}
.ni { font-size: 16px; width: 18px; flex-shrink: 0; }
.brand-icon { color: #00B5C8; }
.sidebar-bottom {
margin-top: auto;
padding: 8px 0 12px;
border-top: 1px solid #e0f5f8;
}
.nav-item-bottom { margin-top: 2px; }
.version-tag {
text-align: center;
color: #b0cdd1;
font-size: 11px;
padding: 6px 0 0;
}
/* ── Main ── */
.pgx-main {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
background: #f4fafb;
}
/* ── Transitions ── */
.fade-enter-active, .fade-leave-active { transition: opacity 0.12s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }
</style>