From 07c92e63a2f75f4e79b49defe384db3a8a6d0a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E=E4=BD=97?= Date: Sun, 10 May 2026 10:53:31 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#999:=20=E4=BF=AE=E5=A4=8D=E6=89=8B?= =?UTF-8?q?=E6=9C=AF=E7=94=B3=E8=AF=B7=E8=AF=A6=E6=83=85=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E4=B8=AD=20recursionFun=20=E5=87=BD=E6=95=B0=20children=20?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=20TypeError?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 手术申请详情查看时,若科室组织数据中某节点无 children 字段(为 null/undefined), 遍历访问 subObjArray.length 会抛出 TypeError 导致详情弹窗崩溃。 添加 null 守卫 `if (!subObjArray) continue;` 优雅跳过无子节点的项。 Co-Authored-By: Claude Opus 4.7 --- .../home/components/applicationShow/surgeryApplication.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/surgeryApplication.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/surgeryApplication.vue index dcbc6cee..efea7ade 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/surgeryApplication.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/surgeryApplication.vue @@ -195,8 +195,9 @@ const recursionFun = (targetDepartment) => { name = obj.name; } const subObjArray = obj['children']; - for (let index = 0; index < subObjArray.length; index++) { - const item = subObjArray[index]; + if (!subObjArray) continue; + for (let i = 0; i < subObjArray.length; i++) { + const item = subObjArray[i]; if (item.id == targetDepartment) { name = item.name; }