Эх сурвалжийг харах

feat: 小组监控bug修复

chenhao 2 жил өмнө
parent
commit
2938c9fcf2

+ 9 - 3
src/modules/analysis/personnel-statistics/components/StatisticsGroup.vue

@@ -45,7 +45,7 @@ const columns: EpTableColumn<ExtractArrayValue<ExtractApiResponse<'getStatistics
     prop: 'markingGroupNumber',
     width: usePX(52),
     formatter(row) {
-      return row.markingGroupNumber === 0 ? '全' : `${row.markingGroupNumber}`
+      return row.markingGroupNumber === 0 ? '全' : `${row.markingGroupNumber}`
     },
   },
   {
@@ -54,7 +54,7 @@ const columns: EpTableColumn<ExtractArrayValue<ExtractApiResponse<'getStatistics
     minWidth: usePX(84),
     slotName: 'marker',
     formatter(row) {
-      return row.markingGroupNumber === 0 ? '全体' : `第${row.markingGroupNumber}组`
+      return row.markingGroupNumber === 0 ? '题组' : `第${row.markingGroupNumber}组`
     },
   },
   { align: 'center', label: '评卷份数', prop: 'markingPaperCount', width: usePX(72) },
@@ -78,7 +78,13 @@ const columns: EpTableColumn<ExtractArrayValue<ExtractApiResponse<'getStatistics
 ]
 
 const data = computed(() => {
-  return props.data || []
+  const arr = props.data?.map((v) => ({ ...v })) || []
+  const totalIndex = arr.findIndex((v) => !v.markingGroupNumber)
+  if (totalIndex >= 0) {
+    const [total] = arr.splice(totalIndex, 1)
+    total && arr.push(total)
+  }
+  return arr
 })
 
 const { tableRef, tableData, current, onCurrentChange } = useTableCheck(data)

+ 9 - 5
src/modules/analysis/personnel-statistics/components/StatisticsPersonnel.vue

@@ -106,34 +106,34 @@ const columns: EpTableColumn<ExtractArrayValue<ExtractApiResponse<'getStatistics
   { align: 'center', label: '综合系数', prop: 'integration', width: usePX(64) },
 ]
 
-const popovers = reactive<Record<string, PopoverInstance>>({})
+const popovers = ref<Record<string, PopoverInstance>>({})
 
 const setWorkloadVisible = ref<boolean>(false)
 
 const setWorkloadData = ref<ExtractArrayValue<ExtractApiResponse<'getStatisticsByGroup'>>>()
 
 function setPopoverRefs(id: number, popover: PopoverInstance) {
-  popovers[`popovers-${id}`] = popover
+  popovers.value[`popovers-${id}`] = popover
 }
 
 /** on popover show */
 function onPopoverShow(id: number) {
   Object.keys(popovers).forEach((k) => {
     if (k !== `popovers-${id}`) {
-      popovers[k]?.hide()
+      popovers.value[k]?.hide()
     }
   })
 }
 
 /** 设置工作量 */
 function onSetWorkload(data: ExtractArrayValue<ExtractApiResponse<'getStatisticsByGroup'>>) {
-  popovers[`popovers-${data.markerId}`]?.hide()
+  popovers.value[`popovers-${data.markerId}`]?.hide()
   setWorkloadData.value = data
   setWorkloadVisible.value = true
 }
 /** 发送消息 */
 function onSendMessage(data: ExtractArrayValue<ExtractApiResponse<'getStatisticsByGroup'>>) {
-  popovers[`popovers-${data.markerId}`]?.hide()
+  popovers.value[`popovers-${data.markerId}`]?.hide()
   setReplyUserId?.(data.markerId)
   setMessageVisible?.(true)
 }
@@ -144,6 +144,10 @@ const data = computed(() => {
 
 const { tableRef, tableData, current, onCurrentChange } = useTableCheck(data)
 
+watch(tableData, () => {
+  popovers.value = {}
+})
+
 const { fetch: getStatisticObjectiveByMarker, result: objectiveByMarker } = useFetch('getStatisticObjectiveByMarker')
 const { fetch: getStatisticSubjectiveByMarker, result: subjectiveByMarker } = useFetch('getStatisticSubjectiveByMarker')