修复叫号显示屏跳转异常问题
This commit is contained in:
@@ -31,13 +31,14 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="(group, doctorName) in groupedPatients" :key="doctorName">
|
||||
<template v-for="doctorName in paginatedDoctors" :key="doctorName">
|
||||
<template v-if="groupedPatients[doctorName]">
|
||||
<!-- 医生分组标题 -->
|
||||
<tr class="doctor-header">
|
||||
<td colspan="4">{{ doctorName }} 医生 (诊室: {{ getDoctorRoom(doctorName) }})</td>
|
||||
</tr>
|
||||
<!-- 患者列表 -->
|
||||
<tr v-for="(patient, index) in group" :key="patient.id">
|
||||
<tr v-for="(patient, index) in groupedPatients[doctorName]" :key="patient.id">
|
||||
<td>{{ index + 1 }}</td>
|
||||
<td>{{ formatPatientName(patient.name) }}</td>
|
||||
<td>{{ getDoctorRoom(doctorName) }}</td>
|
||||
@@ -46,6 +47,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</template>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -126,9 +128,29 @@ const waitingCount = computed(() => {
|
||||
return count
|
||||
})
|
||||
|
||||
// 获取排序后的医生列表
|
||||
const sortedDoctors = computed(() => {
|
||||
return Object.keys(groupedPatients.value).sort()
|
||||
})
|
||||
|
||||
// 按医生分组的分页逻辑
|
||||
const paginatedDoctors = computed(() => {
|
||||
const startIndex = (currentPage.value - 1) * 1 // 每页显示1个医生组
|
||||
const endIndex = startIndex + 1
|
||||
return sortedDoctors.value.slice(startIndex, endIndex)
|
||||
})
|
||||
|
||||
// 获取当前页的患者
|
||||
const currentPatients = computed(() => {
|
||||
const result = {}
|
||||
paginatedDoctors.value.forEach(doctor => {
|
||||
result[doctor] = groupedPatients.value[doctor]
|
||||
})
|
||||
return result
|
||||
})
|
||||
|
||||
const totalPages = computed(() => {
|
||||
const totalPatients = patients.value.length
|
||||
return Math.ceil(totalPatients / patientsPerPage) || 1
|
||||
return Math.ceil(sortedDoctors.value.length) || 1
|
||||
})
|
||||
|
||||
// 方法
|
||||
|
||||
Reference in New Issue
Block a user