From 56a9d84ddce4db6c1e47c7ad18b0cbf00bb47857 Mon Sep 17 00:00:00 2001 From: zyronon Date: Sat, 2 Aug 2025 13:54:15 +0800 Subject: [PATCH] feat:save --- src/stores/base.ts | 7 +++---- src/types.ts | 4 +--- src/utils/eventBus.ts | 2 -- src/utils/index.ts | 1 - 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/stores/base.ts b/src/stores/base.ts index 131f3979..6fe976ed 100644 --- a/src/stores/base.ts +++ b/src/stores/base.ts @@ -1,11 +1,10 @@ import {defineStore} from 'pinia' -import {Article, Dict, DictId, DictType, getDefaultDict, Sort, Word} from "../types.ts" -import {cloneDeep, merge, reverse, shuffle} from "lodash-es"; -import {emitter, EventKey} from "@/utils/eventBus.ts" +import {Dict, DictId, getDefaultDict, Word} from "../types.ts" +import {cloneDeep, merge} from "lodash-es"; import * as localforage from "localforage"; import {nanoid} from "nanoid"; import {SAVE_DICT_KEY} from "@/utils/const.ts"; -import {_checkDictWords, _getDictDataByUrl, _getStudyProgress, checkAndUpgradeSaveDict, getDictFile} from "@/utils"; +import {_getStudyProgress, checkAndUpgradeSaveDict, getDictFile} from "@/utils"; export interface BaseState { simpleWords: string[], diff --git a/src/types.ts b/src/types.ts index 602b165e..b3415be5 100644 --- a/src/types.ts +++ b/src/types.ts @@ -139,8 +139,6 @@ export function getDefaultArticle(val: Partial
= {}): Article { export interface Statistics { startDate: number,//开始日期 spend: number,//花费时间 - //todo 这个写错了,上线记得删除掉 - speed?: number,//花费时间 total: number//单词数量 new: number//新学单词数量 review: number//复习单词数量 @@ -155,10 +153,10 @@ export interface DisplayStatistics extends Statistics { export const DefaultDisplayStatistics: DisplayStatistics = { startDate: Date.now(), spend: -1, - speed: -1, total: -1, new: 0, wrong: -1, + review: -1, inputWordNumber: -1, wrongWords: [], } diff --git a/src/utils/eventBus.ts b/src/utils/eventBus.ts index c0ab4a4f..9c0c3f23 100644 --- a/src/utils/eventBus.ts +++ b/src/utils/eventBus.ts @@ -7,8 +7,6 @@ export const EventKey = { changeDict: 'changeDict', openStatModal: 'openStatModal', openWordListModal: 'openWordListModal', - //todo feiqi - openDictModal: 'openDictModal', openArticleListModal: 'openArticleListModal', closeOther: 'closeOther', keydown: 'keydown', diff --git a/src/utils/index.ts b/src/utils/index.ts index 0412aa81..21fcad80 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -301,7 +301,6 @@ export function _fetch(url: string) { } export async function _checkDictWords(dict: Dict) { - console.log('_checkDictWords', dict) if ([DictType.collect, DictType.known, DictType.wrong].includes(dict.dictType)) {