From 218853b175b791be9dfa5ed1cc67cc66b7332006 Mon Sep 17 00:00:00 2001 From: zyronon Date: Mon, 11 Aug 2025 02:34:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B7=BB=E5=8A=A0=E5=86=B2=E7=AA=81?= =?UTF-8?q?=E6=8F=90=E9=86=92=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 1 + src/components/HostNotice.vue | 140 ------------------ src/hooks/dict.ts | 4 +- src/pages/pc/article/BookDetail.vue | 5 +- src/pages/pc/article/StudyArticle.vue | 3 +- src/pages/pc/components/CollectNotice.vue | 2 +- src/pages/pc/components/ConflictNotice.vue | 50 +++++++ src/pages/pc/components/dialog/Dialog.vue | 2 +- .../pc/components/dialog/WordListDialog.vue | 60 -------- src/pages/pc/word/StudyWord.vue | 2 + src/pages/pc/word/WordHomePage.vue | 1 + src/stores/setting.ts | 4 +- src/utils/const.ts | 2 +- 13 files changed, 66 insertions(+), 210 deletions(-) delete mode 100644 src/components/HostNotice.vue create mode 100644 src/pages/pc/components/ConflictNotice.vue delete mode 100644 src/pages/pc/components/dialog/WordListDialog.vue diff --git a/src/App.vue b/src/App.vue index 8c2af1fd..9865e1b1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,6 +11,7 @@ import {isMobile, shakeCommonDict} from "@/utils"; import router, {routes} from "@/router.ts"; import {useRoute} from "vue-router"; +import ConflictNotice from "@/pages/pc/components/ConflictNotice.vue"; const store = useBaseStore() const runtimeStore = useRuntimeStore() diff --git a/src/components/HostNotice.vue b/src/components/HostNotice.vue deleted file mode 100644 index 45986010..00000000 --- a/src/components/HostNotice.vue +++ /dev/null @@ -1,140 +0,0 @@ - - - - - diff --git a/src/hooks/dict.ts b/src/hooks/dict.ts index 6476ef04..626204ce 100644 --- a/src/hooks/dict.ts +++ b/src/hooks/dict.ts @@ -1,7 +1,5 @@ import {Article, Word} from "@/types/types.ts"; import {useBaseStore} from "@/stores/base.ts"; -import {nanoid} from "nanoid"; -import {getDefaultArticle} from "@/types/func.ts"; export function useWordOptions() { const store = useBaseStore() @@ -64,7 +62,7 @@ export function useArticleOptions() { const store = useBaseStore() function isArticleCollect(val: Article) { - return !!store.collectArticle.articles.find(v => v.id === val.id) + return !!store.collectArticle?.articles?.find(v => v.id === val.id) } //todo 这里先收藏,再修改。收藏里面的未同步。单词也是一样的 diff --git a/src/pages/pc/article/BookDetail.vue b/src/pages/pc/article/BookDetail.vue index 5216b2d3..37f2020e 100644 --- a/src/pages/pc/article/BookDetail.vue +++ b/src/pages/pc/article/BookDetail.vue @@ -54,8 +54,8 @@ async function init() { if (!runtimeStore.editDict.id) { await router.push("/article") } else { - if (!runtimeStore.editDict.articles.length - && !runtimeStore.editDict.custom + if (!runtimeStore.editDict?.articles?.length + && !runtimeStore.editDict?.custom && ![DictId.articleCollect].includes(runtimeStore.editDict.id) ) { loading = true @@ -66,6 +66,7 @@ async function init() { if (runtimeStore.editDict.articles.length) { selectArticle = runtimeStore.editDict.articles[0] } + console.log(runtimeStore.editDict) } } } diff --git a/src/pages/pc/article/StudyArticle.vue b/src/pages/pc/article/StudyArticle.vue index f7dbb90d..6ad5b7b8 100644 --- a/src/pages/pc/article/StudyArticle.vue +++ b/src/pages/pc/article/StudyArticle.vue @@ -4,7 +4,6 @@ import {onMounted, onUnmounted} from "vue"; import {useBaseStore} from "@/stores/base.ts"; import {emitter, EventKey, useEvents} from "@/utils/eventBus.ts"; import {useSettingStore} from "@/stores/setting.ts"; -import {useRuntimeStore} from "@/stores/runtime.ts"; import {Article, ArticleItem, ArticleWord, ShortcutKey, Word} from "@/types/types.ts"; import {useOnKeyboardEventListener, useStartKeyboardEventListener} from "@/hooks/event.ts"; import useTheme from "@/hooks/theme.ts"; @@ -22,6 +21,7 @@ import ArticleList from "@/pages/pc/components/list/ArticleList.vue"; import EditSingleArticleModal from "@/pages/pc/article/components/EditSingleArticleModal.vue"; import Tooltip from "@/pages/pc/components/Tooltip.vue"; import {Icon} from "@iconify/vue"; +import ConflictNotice from "@/pages/pc/components/ConflictNotice.vue"; const store = useBaseStore() const settingStore = useSettingStore() @@ -352,6 +352,7 @@ const {playSentenceAudio} = usePlaySentenceAudio() + diff --git a/src/pages/pc/word/StudyWord.vue b/src/pages/pc/word/StudyWord.vue index 151af1c8..dc2ab7a1 100644 --- a/src/pages/pc/word/StudyWord.vue +++ b/src/pages/pc/word/StudyWord.vue @@ -25,6 +25,7 @@ import {usePracticeStore} from "@/stores/practice.ts"; import {dictionaryResources} from "@/assets/dictionary.ts"; import {ElMessage} from "element-plus"; import {getDefaultWord} from "@/types/func.ts"; +import ConflictNotice from "@/pages/pc/components/ConflictNotice.vue"; interface IProps { new: Word[], @@ -439,6 +440,7 @@ useEvents([ +