Fix Bug #544: AI修复

This commit is contained in:
2026-05-27 02:46:26 +08:00
parent 20ec3e30fc
commit bf1438dbbe
5 changed files with 170 additions and 82 deletions

View File

@@ -0,0 +1,100 @@
<template>
<div class="smart-queue-container">
<div class="toolbar">
<el-date-picker
v-model="dateRange"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
@change="handleDateChange"
/>
<el-button type="primary" @click="openHistoryDialog">历史队列查询</el-button>
</div>
<el-table :data="queueList" border class="queue-table">
<el-table-column prop="patient_name" label="患者姓名" />
<el-table-column prop="queue_no" label="排队号" />
<el-table-column prop="queue_status" label="状态">
<template #default="{ row }">
<el-tag :type="row.queue_status === 3 ? 'success' : 'warning'">
{{ getStatusText(row.queue_status) }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="triage_time" label="分诊时间" />
</el-table>
<el-dialog v-model="historyVisible" title="历史队列查询" width="600px">
<el-date-picker
v-model="historyDateRange"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
/>
<template #footer>
<el-button @click="historyVisible = false">取消</el-button>
<el-button type="primary" @click="queryHistory">查询</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import axios from 'axios'
const queueList = ref([])
const dateRange = ref([])
const historyVisible = ref(false)
const historyDateRange = ref([])
const getStatusText = (status) => {
const map = { 0: '待诊', 1: '就诊中', 2: '过号', 3: '完诊' }
return map[status] || '未知'
}
const fetchQueue = async (startTime, endTime) => {
// 修复 Bug #544移除 status 参数默认过滤,后端不再拦截完诊状态
const { data } = await axios.get('/api/triage/queue/list', {
params: { deptId: 1, startTime, endTime }
})
queueList.value = data
}
const handleDateChange = (val) => {
if (val && val.length === 2) {
fetchQueue(val[0], val[1])
}
}
const openHistoryDialog = () => {
historyVisible.value = true
// 默认当天时间
const today = new Date().toISOString().split('T')[0]
historyDateRange.value = [today, today]
}
const queryHistory = () => {
if (historyDateRange.value && historyDateRange.value.length === 2) {
fetchQueue(historyDateRange.value[0], historyDateRange.value[1])
historyVisible.value = false
}
}
onMounted(() => {
// 页面初始化默认加载当天数据
const today = new Date().toISOString().split('T')[0]
fetchQueue(today, today)
})
</script>
<style scoped>
.smart-queue-container { padding: 20px; }
.toolbar { margin-bottom: 16px; display: flex; gap: 12px; align-items: center; }
</style>