Parcourir la source

fix(训练评估): 修复运行日志ID传递和监听问题

zhanghaijun il y a 11 mois
Parent
commit
b1c4cadca0

+ 6 - 1
src/views/train/evaluation/index.vue

@@ -28,7 +28,7 @@
         <div>{{ seconds }}</div>
       </div>
     </div>
-    <ListEvaluation :runLogID="runLogID" :courseID="runRecord?.runCourseID ?? 0" @refresh="findRunRecord" />
+    <ListEvaluation :runLogID="runId" :courseID="runRecord?.runCourseID ?? 0" @refresh="findRunRecord" />
   </div>
 </template>
 
@@ -48,6 +48,11 @@
     return Array.isArray(val) ? 0 : Number(val ?? 0)
   })
 
+  const runId = computed<number>(() => {
+    if (runRecord.value) return runRecord.value?.runLogID ?? runLogID.value
+    return runLogID.value
+  })
+
   // 运行记录
   const runRecord = ref<RunRecord>()
   // 课程详情

+ 9 - 1
src/views/train/evaluation/list-log.vue

@@ -24,7 +24,8 @@
   const {
     data: operationData,
     columns: operationColumns,
-    loading: operationLoading
+    loading: operationLoading,
+    refreshData: refreshRefereeData
   } = useTable({
     core: {
       apiFn: () => getOperLogList(props.runLogID),
@@ -45,4 +46,11 @@
       ]
     }
   })
+
+  watch(
+    () => props.runLogID,
+    (newVal) => {
+      if (newVal) refreshRefereeData()
+    }
+  )
 </script>