From 8f0b96efe4f6f86fc72c54630f03c9b8e760f8d3 Mon Sep 17 00:00:00 2001 From: zyronon Date: Fri, 3 Nov 2023 11:13:48 +0800 Subject: [PATCH 1/3] Optimize UI interface --- components.d.ts | 3 +++ src/assets/css/style.scss | 10 ++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/components.d.ts b/components.d.ts index c6b2e978..68992d6f 100644 --- a/components.d.ts +++ b/components.d.ts @@ -23,6 +23,9 @@ declare module 'vue' { EditArticle: typeof import('./src/components/Article/EditArticle.vue')['default'] EditBatchArticleModal: typeof import('./src/components/Article/EditBatchArticleModal.vue')['default'] EditSingleArticleModal: typeof import('./src/components/Article/EditSingleArticleModal.vue')['default'] + ElButton: typeof import('element-plus/es')['ElButton'] + ElForm: typeof import('element-plus/es')['ElForm'] + ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElInput: typeof import('element-plus/es')['ElInput'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElOption: typeof import('element-plus/es')['ElOption'] diff --git a/src/assets/css/style.scss b/src/assets/css/style.scss index a002b501..248a8a71 100644 --- a/src/assets/css/style.scss +++ b/src/assets/css/style.scss @@ -40,14 +40,12 @@ html.dark { --color-main-bg: rgba(14, 18, 23, 1); //--color-main-bg: rgba(30,31,34, 1); --color-second-bg: rgb(43,45,48); + --color-second-bg: rgb(30,31,34); - --color-item-bg: rgb(51, 51, 51); - --color-item-hover: #5e5e5e; + --color-item-bg: rgb(43,45,48); --color-item-hover: rgb(67,69,74); - //--color-item-active: rgb(75, 110, 175); - //--color-item-active: rgb(103, 103, 103); - --color-item-active: rgb(67,69,74); - --color-item-border: rgb(73, 73, 73); + --color-item-active: rgb(84,84,84); + --color-item-border: rgb(41, 41, 41); --color-header-bg: rgb(51, 51, 51); --color-tooltip-bg: #252525; From 1c05974736d6a1b0a002f96a0110828d5b15db5d Mon Sep 17 00:00:00 2001 From: zyronon Date: Fri, 3 Nov 2023 15:15:36 +0800 Subject: [PATCH 2/3] View dictionary word list Add progress bar --- components.d.ts | 4 ++ src/components/ChapterList.vue | 16 ++--- src/components/Toolbar/DictModal.vue | 13 +++- src/components/Toolbar/Toolbar.vue | 2 +- src/components/WordListModal.vue | 68 +++++++++++++++++- src/components/WordListModal2.vue | 104 +++++++++++++++++++++++++++ 6 files changed, 191 insertions(+), 16 deletions(-) create mode 100644 src/components/WordListModal2.vue 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 + }) +} +