瀏覽代碼

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

chenhao 2 年之前
父節點
當前提交
b419898a33
共有 1 個文件被更改,包括 6 次插入4 次删除
  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(