diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/surgery.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/surgery.vue index 49b6cc68f..23eec9b48 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/surgery.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/surgery.vue @@ -86,6 +86,9 @@ import {getApplicationList, saveSurgery} from './api'; import {ElMessage} from 'element-plus'; const { proxy } = getCurrentInstance(); +// 模块级缓存:避免每次打开弹窗都重新请求手术项目列表 +let surgeryRecordsCache = null; // 原始 API 记录 +let surgeryMappedCache = null; // 映射后的 el-transfer 数据 // 递归查找树形科室节点 const findTreeItem = (list, id) => { if (!list || list.length === 0) return null; @@ -110,6 +113,12 @@ const getList = () => { applicationList.value = []; return; } + // 命中缓存时直接使用,避免重复请求导致加载缓慢 + if (surgeryMappedCache && surgeryMappedCache.length > 0) { + applicationList.value = surgeryMappedCache; + applicationListAll.value = surgeryRecordsCache; + return; + } loading.value = true; getApplicationList({ pageSize: 500, @@ -132,6 +141,9 @@ const getList = () => { key: item.adviceDefinitionId, }; }); + // 写入模块缓存,后续打开弹窗直接复用 + surgeryRecordsCache = res.data.records; + surgeryMappedCache = applicationList.value; } else { console.warn('获取手术项目列表失败:', res.message); applicationList.value = [];