diff --git a/components.d.ts b/components.d.ts index 68992d6f..0459c6fb 100644 --- a/components.d.ts +++ b/components.d.ts @@ -66,5 +66,9 @@ declare module 'vue' { VolumeSetting: typeof import('./src/components/Toolbar/VolumeSetting.vue')['default'] WordList: typeof import('./src/components/WordList.vue')['default'] WordListModal: typeof import('./src/components/WordListModal.vue')['default'] + WordListModal2: typeof import('./src/components/WordListModal2.vue')['default'] + } + export interface ComponentCustomProperties { + vLoading: typeof import('element-plus/es')['ElLoadingDirective'] } } diff --git a/src/components/ChapterList.vue b/src/components/ChapterList.vue index b1db983d..7f6c7d6a 100644 --- a/src/components/ChapterList.vue +++ b/src/components/ChapterList.vue @@ -24,17 +24,11 @@ const list: any[] = $computed(() => { function showWordListModal(index: number, item: Word[]) { - if (runtimeStore.editDict.translateLanguage === 'common') { - console.time() - item.map((w: Word) => { - if (!w.trans.length) { - let res = runtimeStore.translateWordList.find(a => a.name === w.name) - if (res) w = Object.assign(w, res) - } - }) - console.timeEnd() - } - emitter.emit(EventKey.openWordListModal, {title: `第${index + 1}章`, list: item}) + emitter.emit(EventKey.openWordListModal, { + title: `第${index + 1}章`, + translateLanguage: runtimeStore.editDict.translateLanguage, + list: item + }) } diff --git a/src/components/Toolbar/DictModal.vue b/src/components/Toolbar/DictModal.vue index 2f4cdfcf..6e9af2c7 100644 --- a/src/components/Toolbar/DictModal.vue +++ b/src/components/Toolbar/DictModal.vue @@ -17,6 +17,7 @@ import WordListModal from "@/components/WordListModal.vue"; import {isArticle} from "@/hooks/article.ts"; import {useRuntimeStore} from "@/stores/runtime.ts"; import {useSettingStore} from "@/stores/setting.ts"; +import {emitter, EventKey} from "@/utils/eventBus.ts"; interface IProps { modelValue?: boolean, @@ -148,6 +149,14 @@ const dictIsArticle = $computed(() => { return isArticle(runtimeStore.editDict.type) }) +function showWordListModal() { + emitter.emit(EventKey.openWordListModal, { + title: runtimeStore.editDict.name, + translateLanguage: runtimeStore.editDict.translateLanguage, + list: runtimeStore.editDict.words + }) +} +