diff --git a/src/components/Modal/Statistics.vue b/src/components/Modal/Statistics.vue index 7ffae0cd..fc55268d 100644 --- a/src/components/Modal/Statistics.vue +++ b/src/components/Modal/Statistics.vue @@ -18,13 +18,7 @@ let currentStat = reactive(cloneDeep(DefaultStatistics)) onMounted(() => { emitter.on(EventKey.openStatModal, () => { statModalIsOpen = true - currentStat = cloneDeep(store.current.statistics) - currentStat.endDate = Date.now() - currentStat.spend = Date.now() - currentStat.startDate - currentStat.wrongWordNumber = store.current.originWrongWords.length - currentStat.correctRate = 100 - Math.trunc((currentStat.wrongWordNumber / currentStat.wordNumber) * 100) - console.log(cloneDeep(currentStat)) - store.currentDict.statistics.push(currentStat) + currentStat = store.saveStatistics() }) }) @@ -35,11 +29,13 @@ function write() { //TODO 需要判断是否已忽略 function repeat() { + console.log(store.chapter) store.setCurrentWord(store.chapter, true) statModalIsOpen = false emitter.emit(EventKey.resetWord) } +//TODO 能否下一章 function next() { store.currentDict.chapterIndex++ repeat() @@ -111,7 +107,7 @@ function next() {