diff --git a/components.d.ts b/components.d.ts index 5d9d6f95..7f65064e 100644 --- a/components.d.ts +++ b/components.d.ts @@ -16,6 +16,7 @@ declare module 'vue' { BaseIcon: typeof import('./src/components/BaseIcon.vue')['default'] ChapterDetail: typeof import('./src/components/ChapterDetail.vue')['default'] ChapterList: typeof import('./src/components/list/ChapterList.vue')['default'] + ChapterName: typeof import('./src/components/Toolbar/ChapterName.vue')['default'] Close: typeof import('./src/components/icon/Close.vue')['default'] CommonWordList: typeof import('./src/components/list/CommonWordList.vue')['default'] DictGroup: typeof import('./src/components/Toolbar/DictGroup.vue')['default'] diff --git a/src/assets/css/style.scss b/src/assets/css/style.scss index 717cdf41..58f191b2 100644 --- a/src/assets/css/style.scss +++ b/src/assets/css/style.scss @@ -32,7 +32,7 @@ --toolbar-width: 700rem; --toolbar-height: 60rem; --panel-width: 400rem; - --space: 24rem; + --space: 20rem; --panel-margin-left: calc(50% - var(--practice-wrapper-padding-right) / 2 + var(--toolbar-width) / 2 + 24rem); } @@ -268,7 +268,7 @@ footer { justify-content: space-between; transition: all .3s; padding: 10rem; - gap: 20rem; + gap: 10rem; border: 1px solid var(--color-item-border); .left { diff --git a/src/components/Modal/AddWordDialog.vue b/src/components/Modal/AddWordDialog.vue index 87149967..a06e65e5 100644 --- a/src/components/Modal/AddWordDialog.vue +++ b/src/components/Modal/AddWordDialog.vue @@ -19,7 +19,6 @@ import VirtualWordList from "@/components/list/VirtualWordList.vue"; import Modal from "@/components/Modal/Modal.vue"; import {emitter, EventKey} from "@/utils/eventBus.ts"; -// useDisableEventListener() const store = useBaseStore() const settingStore = useSettingStore() @@ -33,7 +32,7 @@ let step = $ref(1) let isAddDict = $ref(false) let wordList = $ref([]) -let dictList = $computed(() => { +let dictList: Dict[] = $computed(() => { return [ store.collect, store.simple, @@ -85,11 +84,11 @@ onMounted(() => { } }) - console.log('categoryList', categoryList) - console.log('tagList', tagList) + // console.log('categoryList', categoryList) + // console.log('tagList', tagList) }) -function selectDict(val: { dict: Dict, index: number }) { +function selectDict(val: { index: number }) { store.current.editIndex = val.index wordList = cloneDeep(store.editDict.originWords) isAddDict = false @@ -237,13 +236,20 @@ watch(() => step, v => { let show = $ref(false) +useDisableEventListener(() => show) + function close() { show = false } onMounted(() => { emitter.on(EventKey.editDict, (dict: Dict) => { - show = true + let rIndex = dictList.findIndex(v => v.id === dict.id) + if (rIndex > -1) { + selectDict({index: rIndex}) + addWord() + show = true + } }) }) @@ -429,14 +435,8 @@ onMounted(() => { @import "@/assets/css/variable"; #AddWordDialog { - position: fixed; - width: 600rem; + width: 650rem; height: 70vh; - left: 50%; - top: 50%; - transform: translate3D(-50%, -50%, 0); - z-index: 9999999; - background: var(--color-second-bg); transition: all .3s; &.add-word-mode { @@ -447,6 +447,10 @@ onMounted(() => { grid-template-columns: repeat(2, 1fr); display: none; } + + .dict{ + padding-right: var(--space); + } } $header-height: 60rem; @@ -492,7 +496,6 @@ onMounted(() => { background: var(--color-second-bg); color: var(--color-font-1); padding-left: var(--space); - padding-right: var(--space); padding-bottom: var(--space); box-sizing: border-box; overflow: auto; @@ -530,7 +533,7 @@ onMounted(() => { } .list-wrapper { - width: 350rem; + width: 400rem; display: flex; flex-direction: column; font-size: 14rem; diff --git a/src/components/Modal/DictModal.vue b/src/components/Modal/DictModal.vue index fd515727..8ff51f1d 100644 --- a/src/components/Modal/DictModal.vue +++ b/src/components/Modal/DictModal.vue @@ -1,7 +1,7 @@ + v-model="runtimeStore.showDictModal" + :show-close="false"> @@ -327,7 +309,7 @@ onUnmounted(() => { - + 文章列表:共{{ runtimeStore.editDict.articles.length }}章 diff --git a/src/components/Modal/Modal.vue b/src/components/Modal/Modal.vue index 8224bd05..99fb0b68 100644 --- a/src/components/Modal/Modal.vue +++ b/src/components/Modal/Modal.vue @@ -242,7 +242,7 @@ $header-height: 60rem; .window { //width: 75vw; //height: 70vh; - box-shadow: var(--color-main-bg) 0 0 10rem 1rem; + box-shadow: var(--color-main-bg) 0 0 6rem 0; border-radius: $radius; animation: bounce-in $time ease-out; diff --git a/src/components/Modal/WordListModal.vue b/src/components/Modal/WordListModal.vue index de5a19e5..b81f23da 100644 --- a/src/components/Modal/WordListModal.vue +++ b/src/components/Modal/WordListModal.vue @@ -1,21 +1,17 @@ + + + + + {{ store.chapterName }} + + + + + + 第{{ index + 1 }}章 {{ item.length }}词 + + + + + + + \ No newline at end of file diff --git a/src/components/Toolbar/Toolbar.vue b/src/components/Toolbar/Toolbar.vue index 6091ccb9..53b87881 100644 --- a/src/components/Toolbar/Toolbar.vue +++ b/src/components/Toolbar/Toolbar.vue @@ -16,6 +16,7 @@ import {usePracticeStore} from "@/stores/practice.ts"; import {useRuntimeStore} from "@/stores/runtime.ts"; import {$ref} from "vue/macros"; import {ShortcutKey} from "@/types.ts"; +import ChapterName from "@/components/Toolbar/ChapterName.vue"; const {toggleTheme} = useTheme() const store = useBaseStore() @@ -60,12 +61,18 @@ watch(() => store.load, n => { - - - {{ store.dictTitle }} {{ practiceStore.repeatNumber ? ' 复习错词' : '' }} + + + + {{ store.currentDict.name }} {{ practiceStore.repeatNumber ? ' 复习错词' : '' }} + + + + + 复习错词 - + @@ -147,6 +154,32 @@ watch(() => store.load, n => { +