From c368833d1060a1da27c3d6b0c3c3d859210f8e3d Mon Sep 17 00:00:00 2001 From: zyronon Date: Mon, 4 Dec 2023 18:57:50 +0800 Subject: [PATCH] debug --- src/pages/dict/components/ArticleDictDetail.vue | 1 + src/pages/practice/Panel.vue | 2 +- src/stores/base.ts | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/dict/components/ArticleDictDetail.vue b/src/pages/dict/components/ArticleDictDetail.vue index 9b329554..7541749d 100644 --- a/src/pages/dict/components/ArticleDictDetail.vue +++ b/src/pages/dict/components/ArticleDictDetail.vue @@ -80,6 +80,7 @@ async function getDictDetail(val: { runtimeStore.editDict.length = runtimeStore.editDict.articles.length } } + loading = false } diff --git a/src/pages/practice/Panel.vue b/src/pages/practice/Panel.vue index 270628a0..f6726947 100644 --- a/src/pages/practice/Panel.vue +++ b/src/pages/practice/Panel.vue @@ -38,7 +38,7 @@ watch(() => settingStore.showPanel, n => { let practiceType = $ref(DictType.word) function changeIndex(dict: Dict) { - store.changeDict(dict, dict.chapterIndex, dict.wordIndex, practiceType) + store.changeDict(dict, practiceType) } onMounted(() => { diff --git a/src/stores/base.ts b/src/stores/base.ts index 385be53b..74470d0d 100644 --- a/src/stores/base.ts +++ b/src/stores/base.ts @@ -260,11 +260,13 @@ export const useBaseStore = defineStore('base', { this.currentDict.statistics.push(statistics) } }, - async changeDict(dict: Dict, chapterIndex: number = dict.chapterIndex, wordIndex: number = dict.wordIndex, practiceType: DictType) { + async changeDict(dict: Dict, practiceType?: DictType, chapterIndex?: number, wordIndex?: number) { //TODO 保存统计 // this.saveStatistics() console.log('changeDict', cloneDeep(dict), chapterIndex, wordIndex) - this.current.practiceType = practiceType + if (chapterIndex === undefined) chapterIndex = dict.chapterIndex + if (wordIndex === undefined) wordIndex = dict.wordIndex + if (practiceType === undefined) this.current.practiceType = practiceType if ([DictType.collect, DictType.simple, DictType.wrong].includes(dict.type)) {