Fix Bug #544: fallback修复
This commit is contained in:
24
openhis-ui-vue3/src/api/triage.ts
Normal file
24
openhis-ui-vue3/src/api/triage.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import request from '@/utils/request';
|
||||
import { PageResult } from '@/types';
|
||||
|
||||
/**
|
||||
* 获取当前排队列表(包含已完诊)。
|
||||
*/
|
||||
export const getCurrentQueue = (params: { pageNum: number; pageSize: number }) => {
|
||||
return request<PageResult<any>>({
|
||||
url: '/api/orders/queue',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取历史排队(仅已完诊)列表。
|
||||
*/
|
||||
export const getHistoryQueue = (params: { pageNum: number; pageSize: number }) => {
|
||||
return request<PageResult<any>>({
|
||||
url: '/api/orders/queue/history',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
};
|
||||
59
openhis-ui-vue3/src/views/triage/QueueList.vue
Normal file
59
openhis-ui-vue3/src/views/triage/QueueList.vue
Normal file
@@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<div class="queue-list">
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="当前排队" name="current">
|
||||
<el-table :data="currentQueue" style="width: 100%" data-cy="current-queue-table">
|
||||
<el-table-column prop="patientName" label="患者" />
|
||||
<el-table-column prop="status" label="状态" />
|
||||
<el-table-column prop="queueNo" label="排号" />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="历史排队" name="history">
|
||||
<el-table :data="historyQueue" style="width: 100%" data-cy="history-queue-table">
|
||||
<el-table-column prop="patientName" label="患者" />
|
||||
<el-table-column prop="status" label="状态" />
|
||||
<el-table-column prop="queueNo" label="排号" />
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@current-change="loadHistory"
|
||||
:current-page="historyPage"
|
||||
:page-size="pageSize"
|
||||
layout="prev, pager, next"
|
||||
:total="historyTotal"
|
||||
data-cy="history-pagination"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { getCurrentQueue, getHistoryQueue } from '@/api/triage';
|
||||
|
||||
const activeTab = ref('current');
|
||||
const pageSize = 20;
|
||||
|
||||
const currentQueue = ref([]);
|
||||
const historyQueue = ref([]);
|
||||
const historyPage = ref(1);
|
||||
const historyTotal = ref(0);
|
||||
|
||||
const loadCurrent = async () => {
|
||||
const res = await getCurrentQueue({ pageNum: 1, pageSize });
|
||||
currentQueue.value = res.data;
|
||||
};
|
||||
|
||||
const loadHistory = async (page = 1) => {
|
||||
const res = await getHistoryQueue({ pageNum: page, pageSize });
|
||||
historyQueue.value = res.data.records;
|
||||
historyTotal.value = res.data.total;
|
||||
historyPage.value = page;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
loadCurrent();
|
||||
if (activeTab.value === 'history') {
|
||||
loadHistory();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user