-
-
-
-
智能模式
-
自动规划学习、复习、听写、默写
-
-
-
自由模式
-
自由练习,系统不强制复习与默写
-
-
-
-
共{{ runtimeStore.editDict.length }}
.target-modal {
width: 35rem;
-
+
.mode-item {
@apply w-50% border border-blue border-solid p-2 rounded-lg cursor-pointer;
diff --git a/src/stores/base.ts b/src/stores/base.ts
index 0af872d1..36c19411 100644
--- a/src/stores/base.ts
+++ b/src/stores/base.ts
@@ -1,35 +1,71 @@
import { defineStore } from 'pinia'
-import { Dict, DictId, Word } from "../types/types.ts"
-import { _getStudyProgress, checkAndUpgradeSaveDict, shakeCommonDict } from "@/utils";
-import { shallowReactive } from "vue";
-import { getDefaultDict } from "@/types/func.ts";
+import { Dict, DictId, Word } from '../types/types.ts'
+import { _getStudyProgress, checkAndUpgradeSaveDict, shakeCommonDict } from '@/utils'
+import { shallowReactive } from 'vue'
+import { getDefaultDict } from '@/types/func.ts'
import { get, set } from 'idb-keyval'
-import { AppEnv, SAVE_DICT_KEY } from "@/config/env.ts";
-import { add2MyDict, dictListVersion, myDictList } from "@/apis";
-import Toast from "@/components/base/toast/Toast.ts";
+import { AppEnv, SAVE_DICT_KEY } from '@/config/env.ts'
+import { add2MyDict, dictListVersion, myDictList } from '@/apis'
+import Toast from '@/components/base/toast/Toast.ts'
export interface BaseState {
- simpleWords: string[],
+ simpleWords: string[]
load: boolean
word: {
- studyIndex: number,
- bookList: Dict[],
- },
+ studyIndex: number
+ bookList: Dict[]
+ }
article: {
- bookList: Dict[],
- studyIndex: number,
- },
+ bookList: Dict[]
+ studyIndex: number
+ }
dictListVersion: number
}
export const getDefaultBaseState = (): BaseState => ({
simpleWords: [
- 'a', 'an',
- 'i', 'my', 'me', 'you', 'your', 'he', 'his', 'she', 'her', 'it',
- 'what', 'who', 'where', 'how', 'when', 'which',
- 'be', 'am', 'is', 'was', 'are', 'were', 'do', 'did', 'can', 'could', 'will', 'would',
- 'the', 'that', 'this', 'and', 'not', 'no', 'yes',
- 'to', 'of', 'for', 'at', 'in'
+ 'a',
+ 'an',
+ 'i',
+ 'my',
+ 'me',
+ 'you',
+ 'your',
+ 'he',
+ 'his',
+ 'she',
+ 'her',
+ 'it',
+ 'what',
+ 'who',
+ 'where',
+ 'how',
+ 'when',
+ 'which',
+ 'be',
+ 'am',
+ 'is',
+ 'was',
+ 'are',
+ 'were',
+ 'do',
+ 'did',
+ 'can',
+ 'could',
+ 'will',
+ 'would',
+ 'the',
+ 'that',
+ 'this',
+ 'and',
+ 'not',
+ 'no',
+ 'yes',
+ 'to',
+ 'of',
+ 'for',
+ 'at',
+ 'in',
],
load: false,
word: {
@@ -40,18 +76,18 @@ export const getDefaultBaseState = (): BaseState => ({
id: DictId.wordKnown,
en_name: DictId.wordCollect,
name: '已掌握',
- description: '已掌握后的单词不会出现在练习中'
+ description: '已掌握后的单词不会出现在练习中',
}),
],
studyIndex: -1,
},
article: {
bookList: [
- getDefaultDict({ id: DictId.articleCollect, en_name: DictId.articleCollect, name: '收藏' })
+ getDefaultDict({ id: DictId.articleCollect, en_name: DictId.articleCollect, name: '收藏' }),
],
studyIndex: -1,
},
- dictListVersion: 1
+ dictListVersion: 1,
})
export const useBaseStore = defineStore('base', {
@@ -75,7 +111,9 @@ export const useBaseStore = defineStore('base', {
return this.known.words.map((v: Word) => v.word.toLowerCase())
},
allIgnoreWords() {
- return this.known.words.map((v: Word) => v.word.toLowerCase()).concat(this.simpleWords.map((v: string) => v.toLowerCase()))
+ return this.known.words
+ .map((v: Word) => v.word.toLowerCase())
+ .concat(this.simpleWords.map((v: string) => v.toLowerCase()))
},
sdict(): Dict {
if (this.word.studyIndex >= 0) {
@@ -83,6 +121,15 @@ export const useBaseStore = defineStore('base', {
}
return getDefaultDict()
},
+ groupLength(): number {
+ return Math.ceil(this.sdict.length / this.sdict.perDayStudyNumber)
+ },
+ currentGroup(): number {
+ //当能除尽时,应该加1
+ let s = this.sdict.lastLearnIndex % this.sdict.perDayStudyNumber
+ let d = this.sdict.lastLearnIndex / this.sdict.perDayStudyNumber
+ return Math.floor(s === 0 ?( d + 1) : d)
+ },
currentStudyProgress(): number {
if (!this.sdict.length) return 0
return _getStudyProgress(this.sdict.lastLearnIndex, this.sdict.length)
@@ -90,7 +137,9 @@ export const useBaseStore = defineStore('base', {
getDictCompleteDate(): number {
if (!this.sdict.length) return 0
if (!this.sdict.perDayStudyNumber) return 0
- return Math.ceil((this.sdict.length - this.sdict.lastLearnIndex) / this.sdict.perDayStudyNumber)
+ return Math.ceil(
+ (this.sdict.length - this.sdict.lastLearnIndex) / this.sdict.perDayStudyNumber
+ )
},
sbook(): Dict {
return this.article.bookList[this.article.studyIndex] ?? {}
diff --git a/src/types/types.ts b/src/types/types.ts
index 9e712a8f..4e107541 100644
--- a/src/types/types.ts
+++ b/src/types/types.ts
@@ -232,6 +232,7 @@ export enum WordPracticeMode {
ListenOnly = 4, // 独立听写模式
FollowWriteOnly = 5, // 独立跟写模式(内部会自动切换到 Spell)
Shuffle = 6, // 随机复习模式
+ Review = 7, // 复习模式
}
//练习类型
@@ -321,6 +322,15 @@ export const WordPracticeModeStageMap: Record = {
@@ -336,6 +346,6 @@ export const WordPracticeStageNameMap: Record = {
[WordPracticeStage.IdentifyReviewAll]: '自测之前学习',
[WordPracticeStage.ListenReviewAll]: '听写之前学习',
[WordPracticeStage.DictationReviewAll]: '默写之前学习',
- [WordPracticeStage.Complete]: '学习完成',
+ [WordPracticeStage.Complete]: '完成学习',
[WordPracticeStage.Shuffle]: '随机复习',
}
diff --git a/uno.config.ts b/uno.config.ts
index 2c9a07c6..092fbc60 100644
--- a/uno.config.ts
+++ b/uno.config.ts
@@ -22,4 +22,17 @@ export default defineConfig({
presets: [
presetWind3(),
],
+ // 自定义断点
+ theme: {
+ breakpoints: {
+ 'xs': '480px', // 自定义小断点
+ 'sm': '640px',
+ 'md': '768px',
+ 'lg': '1024px',
+ 'xl': '1280px',
+ '2xl': '1536px',
+ '3xl': '1920px',
+ '4k': '2560px',
+ }
+ },
})