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 3bd2622b8..13393bc84 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 @@ -9,31 +9,15 @@ class="transfer-wrapper" style="min-height: 300px;" > - -
- -
- -
- - - 手术项目加载中... -
@@ -169,10 +153,8 @@ const { proxy } = getCurrentInstance(); // 模块级缓存:避免每次打开弹窗都重新请求手术项目列表 let surgeryRecordsCache = null; // 原始 API 记录 let surgeryMappedCache = null; // 映射后的 el-transfer 数据 -let searchDebounceTimer = null; // 搜索防抖 const transferRef = ref(null); const dbTotal = ref(0); // 数据库中的手术项目总数 -const searchKey = ref(''); // 搜索关键字 const checkedCount = computed(() => transferValue.value.length); const leftPanelFormat = computed(() => ({ noChecked: ` 0/${dbTotal.value}`, @@ -259,21 +241,14 @@ const loadPage = (key) => { }; /** - * 搜索输入框变化处理(防抖300ms,≥3字触发后端搜索) + * el-transfer 内置过滤方法:支持任意字符即时过滤 + * 按项目名称/代码进行前端模糊匹配 */ -const onSearchInput = () => { - clearTimeout(searchDebounceTimer); - const val = searchKey.value.trim(); - if (!val) { - // 清空搜索框,恢复初始数据 - loadPage(''); - return; - } - if (val.length >= 3) { - searchDebounceTimer = setTimeout(() => { - loadPage(val); - }, 300); - } +const filterMethod = (query, item) => { + const q = query.toLowerCase(); + const label = (item.label || '').toLowerCase(); + const key = String(item.key || ''); + return label.includes(q) || key.includes(q); }; const transferValue = ref([]);