获取当前用户的今日日程
This commit is contained in:
@@ -8,6 +8,14 @@ export function getTodayDoctorScheduleList() {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取当前登录医生今日排班列表
|
||||
export function getTodayMySchedule() {
|
||||
return request({
|
||||
url: '/doctor-schedule/today-my-schedule',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取医生排班列表
|
||||
export function getDoctorScheduleList() {
|
||||
return request({
|
||||
|
||||
@@ -122,6 +122,9 @@
|
||||
</div>
|
||||
<el-tag :type="item.type" size="small">{{ item.tag }}</el-tag>
|
||||
</div>
|
||||
<div v-if="scheduleList.length === 0" class="empty-schedule">
|
||||
<el-empty description="暂无今日日程" :image-size="60" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -136,7 +139,7 @@ import { getHomeStatistics, getPendingEmrCount } from '@/api/home'
|
||||
import { listTodo } from '@/api/workflow/task.js'
|
||||
import { getCurrentUserConfig } from '@/api/system/userConfig'
|
||||
import { listMenu, getMenuFullPath } from '@/api/system/menu'
|
||||
import { getTodayDoctorScheduleList } from '@/api/appointmentmanage/doctorSchedule'
|
||||
import { getTodayMySchedule } from '@/api/appointmentmanage/doctorSchedule'
|
||||
import { ElDivider } from 'element-plus'
|
||||
import {
|
||||
User,
|
||||
@@ -902,27 +905,27 @@ const getTaskIcon = (category) => {
|
||||
const fetchScheduleList = async () => {
|
||||
try {
|
||||
console.log('Fetching schedule list...')
|
||||
const response = await getTodayDoctorScheduleList()
|
||||
const response = await getTodayMySchedule()
|
||||
if (response.code === 200) {
|
||||
// 将API返回的数据转换为前端所需的格式
|
||||
const scheduleData = response.data.map((schedule, index) => {
|
||||
// 根据排班类型设置标签类型
|
||||
let tagType = 'info'
|
||||
if (schedule.weekday) {
|
||||
tagType = schedule.weekday.toLowerCase()
|
||||
if (schedule.shift) {
|
||||
tagType = schedule.shift.toLowerCase()
|
||||
} else if (schedule.timePeriod) {
|
||||
tagType = schedule.timePeriod.toLowerCase()
|
||||
}
|
||||
|
||||
// 确定标题
|
||||
const title = schedule.doctor ? `${schedule.doctor}医生排班` : '医生排班'
|
||||
const title = schedule.doctorName ? `${schedule.doctorName}医生排班` : '医生排班'
|
||||
|
||||
// 确定位置
|
||||
const location = schedule.clinic || schedule.deptId || '未知科室'
|
||||
const location = schedule.clinicRoom || schedule.deptId || '未知科室'
|
||||
|
||||
return {
|
||||
id: schedule.id || index,
|
||||
time: schedule.startTime || '未知时间',
|
||||
time: schedule.startTime ? `${schedule.startTime}-${schedule.endTime}` : '未知时间',
|
||||
title: title,
|
||||
location: location,
|
||||
type: tagType,
|
||||
@@ -1373,6 +1376,14 @@ onUnmounted(() => {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
.empty-schedule {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 40px 20px;
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.schedule-content {
|
||||
flex: 1;
|
||||
margin: 0 16px;
|
||||
|
||||
Reference in New Issue
Block a user