This commit is contained in:
zyronon
2023-12-04 18:57:50 +08:00
parent 479489bda0
commit c368833d10
3 changed files with 6 additions and 3 deletions

View File

@@ -80,6 +80,7 @@ async function getDictDetail(val: {
runtimeStore.editDict.length = runtimeStore.editDict.articles.length
}
}
loading = false
}

View File

@@ -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(() => {

View File

@@ -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)) {