modify:split article

This commit is contained in:
Zyronon
2025-10-02 02:11:35 +08:00
parent 051bf367c9
commit 9128bbec54
8 changed files with 160 additions and 257 deletions

View File

@@ -1,12 +1,12 @@
import {Article, ArticleWord, Dict, DictType, Word} from "@/types/types.ts";
import {shallowReactive} from "vue";
import {cloneDeep} from "@/utils";
import {nanoid} from "nanoid";
import { Article, ArticleWord, Dict, DictType, PracticeArticleWordType, Word } from "@/types/types.ts";
import { shallowReactive } from "vue";
import { cloneDeep } from "@/utils";
import { nanoid } from "nanoid";
export function getDefaultWord(val: Partial<Word> = {}): Word {
return {
custom: false,
id : nanoid(6),
id: nanoid(6),
"word": "",
"phonetic0": "",
"phonetic1": "",
@@ -26,9 +26,9 @@ export function getDefaultWord(val: Partial<Word> = {}): Word {
export function getDefaultArticleWord(val: Partial<ArticleWord> = {}): ArticleWord {
return getDefaultWord({
nextSpace: true,
isSymbol: false,
symbolPosition: '',
input: '',
type: PracticeArticleWordType.Word,
...val
}) as ArticleWord
}

View File

@@ -53,9 +53,9 @@ export enum DictType {
export interface ArticleWord extends Word {
nextSpace: boolean,
isSymbol: boolean,
symbolPosition: 'start' | 'end' | '',
input: string
type: PracticeArticleWordType
}
export interface Sentence {
@@ -193,4 +193,10 @@ export class DictId {
static wordWrong = 'wordWrong'
static wordKnown = 'wordKnown'
static articleCollect = 'articleCollect'
}
export enum PracticeArticleWordType {
Symbol,
Number,
Word
}