Fix Bug #544: AI修复
This commit is contained in:
@@ -65,10 +65,41 @@ const total = ref(0)
|
|||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
dateRange: [],
|
status: '',
|
||||||
status: ''
|
dateRange: []
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const initDefaultDate = () => {
|
||||||
|
const today = new Date().toISOString().split('T')[0]
|
||||||
|
queryParams.dateRange = [today, today]
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleQuery = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
pageNum: queryParams.pageNum,
|
||||||
|
pageSize: queryParams.pageSize,
|
||||||
|
status: queryParams.status || null,
|
||||||
|
startDate: queryParams.dateRange?.[0] || null,
|
||||||
|
endDate: queryParams.dateRange?.[1] || null
|
||||||
|
}
|
||||||
|
const res = await getQueueList(params)
|
||||||
|
queueList.value = res.data.list || []
|
||||||
|
total.value = res.data.total || 0
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryParams.pageNum = 1
|
||||||
|
queryParams.pageSize = 20
|
||||||
|
queryParams.status = ''
|
||||||
|
initDefaultDate()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
const getStatusLabel = (status) => {
|
const getStatusLabel = (status) => {
|
||||||
const map = { WAITING: '候诊', IN_PROGRESS: '就诊中', COMPLETED: '完诊', CANCELLED: '退号' }
|
const map = { WAITING: '候诊', IN_PROGRESS: '就诊中', COMPLETED: '完诊', CANCELLED: '退号' }
|
||||||
return map[status] || status
|
return map[status] || status
|
||||||
@@ -79,39 +110,8 @@ const getStatusType = (status) => {
|
|||||||
return map[status] || 'info'
|
return map[status] || 'info'
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleQuery = () => {
|
|
||||||
loading.value = true
|
|
||||||
const params = {
|
|
||||||
pageNum: queryParams.pageNum,
|
|
||||||
pageSize: queryParams.pageSize,
|
|
||||||
status: queryParams.status || undefined,
|
|
||||||
startDate: queryParams.dateRange?.[0],
|
|
||||||
endDate: queryParams.dateRange?.[1]
|
|
||||||
}
|
|
||||||
getQueueList(params).then(res => {
|
|
||||||
queueList.value = res.rows
|
|
||||||
total.value = res.total
|
|
||||||
}).finally(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryParams.status = ''
|
|
||||||
queryParams.dateRange = []
|
|
||||||
queryParams.pageNum = 1
|
|
||||||
handleQuery()
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const today = new Date().toISOString().split('T')[0]
|
initDefaultDate()
|
||||||
queryParams.dateRange = [today, today]
|
|
||||||
handleQuery()
|
handleQuery()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.triage-queue-container { padding: 16px; }
|
|
||||||
.card-header { display: flex; justify-content: space-between; align-items: center; }
|
|
||||||
.search-form { margin-bottom: 16px; }
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ describe('Bug #544 Regression: 智能分诊队列状态过滤与历史查询', (
|
|||||||
it('should include COMPLETED status in filter and default date to today', async () => {
|
it('should include COMPLETED status in filter and default date to today', async () => {
|
||||||
const wrapper = mount(QueueManagement, {
|
const wrapper = mount(QueueManagement, {
|
||||||
global: {
|
global: {
|
||||||
stubs: ['el-table', 'el-pagination', 'el-card']
|
stubs: ['el-table', 'el-pagination', 'el-card', 'el-form', 'el-form-item', 'el-date-picker', 'el-select', 'el-option', 'el-button']
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user