|
@@ -59,8 +59,10 @@ import bus from '@/utils/bus'
|
|
|
import { useRoute } from 'vue-router'
|
|
|
import type { ExtractApiResponse } from '@/api/api'
|
|
|
import useMarkStore from '@/store/mark'
|
|
|
+import useSpentTime from '@/hooks/useSpentTime'
|
|
|
|
|
|
const route = useRoute()
|
|
|
+const { getSpentTime, resume } = useSpentTime()
|
|
|
|
|
|
interface MarkDelayItem {
|
|
|
startScore: number
|
|
@@ -179,8 +181,9 @@ const onSubmit = (data: ExtractApiResponse<'getQuestionStruct'>) => {
|
|
|
return 0
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- markStore.startCountdown(getMarkLevelSpeedLimit(totalScore.value))
|
|
|
+ const markLevelSpeedLimit = getMarkLevelSpeedLimit(totalScore.value)
|
|
|
+ const waitTime = markLevelSpeedLimit - Math.round(getSpentTime() / 1000)
|
|
|
+ markStore.startCountdown(Math.max(waitTime, 0))
|
|
|
}, 10)
|
|
|
})
|
|
|
}
|
|
@@ -208,6 +211,11 @@ const onViewPapers = () => {
|
|
|
previewModalVisible.value = true
|
|
|
}
|
|
|
|
|
|
+watch(props.id, (newVal, oldVal) => {
|
|
|
+ if (newVal === oldVal) return
|
|
|
+ resume()
|
|
|
+})
|
|
|
+
|
|
|
onUnmounted(() => {
|
|
|
if (!props.showLimitTime) return
|
|
|
markStore.clearCountdown()
|