Fix Bug #544: AI修复

This commit is contained in:
2026-05-27 05:56:12 +08:00
parent bf18086fb9
commit d0a56afe5e
2 changed files with 119 additions and 69 deletions

View File

@@ -62,31 +62,21 @@ const queueList = ref<any[]>([]);
const pageNum = ref(1);
const pageSize = ref(20);
const total = ref(0);
const dateRange = ref<[string, string]>([moment().format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')]);
const dateRange = ref<string[]>([]);
const queryStatus = ref('');
const getStatusType = (status: string) => {
const map: Record<string, string> = { WAITING: 'info', IN_PROGRESS: 'warning', COMPLETED: 'success' };
return map[status] || 'info';
// 默认当天时间
const initDateRange = () => {
const today = moment().format('YYYY-MM-DD');
dateRange.value = [today, today];
};
const fetchQueueData = async () => {
loading.value = true;
try {
const params: any = {
pageNum: pageNum.value,
pageSize: pageSize.value,
status: queryStatus.value || undefined,
startDate: dateRange.value?.[0],
endDate: dateRange.value?.[1]
};
const { data } = await request.get('/api/triage/queue/list', { params });
queueList.value = data.list || [];
total.value = data.total || 0;
} catch (err) {
ElMessage.error('获取队列数据失败');
} finally {
loading.value = false;
const getStatusType = (status: string) => {
switch (status) {
case 'WAITING': return 'info';
case 'IN_PROGRESS': return 'warning';
case 'COMPLETED': return 'success';
default: return '';
}
};
@@ -95,15 +85,58 @@ const handleDateChange = () => {
fetchQueueData();
};
const fetchQueueData = async () => {
loading.value = true;
try {
const params: any = {
pageNum: pageNum.value,
pageSize: pageSize.value,
status: queryStatus.value,
};
if (dateRange.value && dateRange.value.length === 2) {
params.startDate = dateRange.value[0];
params.endDate = dateRange.value[1];
}
// 调用分诊队列列表接口,后端需确保 SQL 查询不硬编码过滤 COMPLETED 状态
const res = await request.get('/triage/queue/list', { params });
if (res.code === 200) {
queueList.value = res.data.list || [];
total.value = res.data.total || 0;
} else {
ElMessage.error(res.msg || '获取队列数据失败');
}
} catch (error) {
ElMessage.error('网络请求异常');
} finally {
loading.value = false;
}
};
onMounted(() => {
initDateRange();
fetchQueueData();
});
</script>
<style scoped>
.triage-queue-container { padding: 16px; }
.header-row { display: flex; justify-content: space-between; align-items: center; }
.history-query-section { display: flex; gap: 12px; align-items: center; }
.date-range-picker { width: 240px; }
.status-select { width: 120px; }
.triage-queue-container {
padding: 16px;
}
.header-row {
display: flex;
justify-content: space-between;
align-items: center;
}
.history-query-section {
display: flex;
gap: 12px;
align-items: center;
}
.date-range-picker {
width: 240px;
}
.status-select {
width: 120px;
}
</style>