From 1e7482db9cadf966be85d88fd31f6a1b69659f7f Mon Sep 17 00:00:00 2001 From: zyronon Date: Tue, 5 Sep 2023 18:44:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=96=87=E7=AB=A0=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Side.vue | 28 +++++++++---------- src/components/Toolbar/DictModal.vue | 2 +- src/components/Type.vue | 10 +++---- src/components/TypeArticle.vue | 38 ++++++++++++-------------- src/stores/base.ts | 41 +++++++++++++--------------- src/types.ts | 31 +++++++++++++++++---- 6 files changed, 82 insertions(+), 68 deletions(-) diff --git a/src/components/Side.vue b/src/components/Side.vue index d8cd71cc..d15d0202 100644 --- a/src/components/Side.vue +++ b/src/components/Side.vue @@ -26,14 +26,14 @@ onMounted(() => { store.sideIsOpen = !store.sideIsOpen if (store.sideIsOpen) { switch (store.current.dictType) { - case DictType.newWordDict: + case DictType.newDict: return tabIndex = 1; - case DictType.skipWordDict: + case DictType.skipDict: return tabIndex = 3; - case DictType.wrongWordDict: + case DictType.wrongDict: return tabIndex = 2; - case DictType.inner: - case DictType.custom: + case DictType.innerDict: + case DictType.customDict: return tabIndex = 0; } } @@ -42,7 +42,7 @@ onMounted(() => { const newWordDictActiveIndex = computed(() => { - if (store.current.dictType !== DictType.newWordDict) return -1 + if (store.current.dictType !== DictType.newDict) return -1 else { if (store.current.repeatNumber) { return store.chapter.findIndex(v => v.name === store.word.name) @@ -52,7 +52,7 @@ const newWordDictActiveIndex = computed(() => { }) const dictActiveIndex = computed(() => { - if (store.current.dictType !== DictType.inner) return -1 + if (store.current.dictType !== DictType.innerDict) return -1 else { if (store.current.repeatNumber) { return store.chapter.findIndex(v => v.name === store.word.name) @@ -63,7 +63,7 @@ const dictActiveIndex = computed(() => { const wrongWordDictActiveIndex = computed(() => { - if (store.current.dictType !== DictType.wrongWordDict) return -1 + if (store.current.dictType !== DictType.wrongDict) return -1 else { if (store.current.repeatNumber) { return store.chapter.findIndex(v => v.name === store.word.name) @@ -74,7 +74,7 @@ const wrongWordDictActiveIndex = computed(() => { const skipWordDictActiveIndex = computed(() => { - if (store.current.dictType !== DictType.skipWordDict) return -1 + if (store.current.dictType !== DictType.skipDict) return -1 else { if (store.current.repeatNumber) { return store.chapter.findIndex(v => v.name === store.word.name) @@ -106,9 +106,9 @@ const skipWordDictActiveIndex = computed(() => { class="word-list" @change="(e:number) => store.changeDict(store.dict,store.dict.chapterIndex,e)" :isActive="store.sideIsOpen && tabIndex === 0" - :list="store.dict.chapters[store.dict.chapterIndex]??[]" + :list="store.dict.chapterWords[store.dict.chapterIndex]??[]" :activeIndex="dictActiveIndex"/> -