Pārlūkot izejas kodu

fix: bug[4457]: 评卷页面发送消息,选择用户后显示为undefiinded

chenhao 2 gadi atpakaļ
vecāks
revīzija
b419898a33
1 mainītis faili ar 6 papildinājumiem un 4 dzēšanām
  1. 6 4
      src/components/shared/message/MessageSend.vue

+ 6 - 4
src/components/shared/message/MessageSend.vue

@@ -142,10 +142,12 @@ const markerTree = computed<TreeNode[]>(() => {
   }
   const { chiffGroup, deputyGroup, markerGroup } = userGroup.value
   return [
-    { label: '大组长', markingGroupNumber: -1, markers: chiffGroup },
-    { label: '小组长', markingGroupNumber: -1, markers: deputyGroup },
-    { label: '评卷小组', markers: markerGroup.map((d) => ({ ...d, label: `第${d.markingGroupNumber}组` })) },
-  ] as TreeNode[]
+    chiffGroup?.length ? { label: '大组长', markingGroupNumber: -1, markers: chiffGroup } : null,
+    deputyGroup?.length ? { label: '小组长', markingGroupNumber: -1, markers: deputyGroup } : null,
+    markerGroup?.length
+      ? { label: '评卷小组', markers: markerGroup.map((d) => ({ ...d, label: `第${d.markingGroupNumber}组` })) }
+      : null,
+  ].filter(Boolean) as TreeNode[]
 })
 
 watch(