feat:save
This commit is contained in:
@@ -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[],
|
||||
|
||||
@@ -139,8 +139,6 @@ export function getDefaultArticle(val: Partial<Article> = {}): 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: [],
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ export const EventKey = {
|
||||
changeDict: 'changeDict',
|
||||
openStatModal: 'openStatModal',
|
||||
openWordListModal: 'openWordListModal',
|
||||
//todo feiqi
|
||||
openDictModal: 'openDictModal',
|
||||
openArticleListModal: 'openArticleListModal',
|
||||
closeOther: 'closeOther',
|
||||
keydown: 'keydown',
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user