diff --git a/src/components/dialog/DictDiglog.vue b/src/components/dialog/DictDiglog.vue index 13bce67e..e36c436a 100644 --- a/src/components/dialog/DictDiglog.vue +++ b/src/components/dialog/DictDiglog.vue @@ -50,6 +50,7 @@ async function selectDict(val: { dict: DictResource | Dict, index: number }) { detailListTabIndex = 0 wordFormMode = FormMode.None loading = true + wordList = [] let find: Dict = store.myDictList.find((v: Dict) => v.id === item.id) if (find) { runtimeStore.editDict = cloneDeep(find) @@ -100,7 +101,6 @@ function changeDict() { close() } - function groupByDictTags(dictList: DictResource[]) { return dictList.reduce>((result, dict) => { dict.tags.forEach((tag) => { @@ -152,6 +152,10 @@ const dictIsArticle = $computed(() => { return isArticle(runtimeStore.editDict.type) }) +const chapterList = $computed(() => { + return dictIsArticle ? runtimeStore.editDict.articles : runtimeStore.editDict.chapterWords +}) + function showAllWordModal() { emitter.emit(EventKey.openWordListModal, { title: runtimeStore.editDict.name, @@ -420,6 +424,14 @@ function addWord() { wordForm = cloneDeep(DefaultFormWord) } +function add() { + if (dictIsArticle) { + + } else { + addWord() + } +} + /**/ /* 单词修改相关*/ /**/ @@ -691,6 +703,7 @@ onMounted(() => { {{ dictIsArticle ? '文章' : '章节' }}列表
单词列表 @@ -700,12 +713,12 @@ onMounted(() => { v-if="detailListTabIndex === 0" > - +
diff --git a/src/stores/base.ts b/src/stores/base.ts index 271961f2..daa1a3a6 100644 --- a/src/stores/base.ts +++ b/src/stores/base.ts @@ -88,18 +88,18 @@ export const useBaseStore = defineStore('base', { type: DictType.wrong, category: '自带字典' }, - // { - // ...cloneDeep(DefaultDict), - // id: 'article_nce2', - // name: "新概念英语2-课文", - // description: '新概念英语2-课文', - // category: '英语学习', - // tags: ['新概念英语'], - // url: 'NCE_2.json', - // translateLanguage: 'common', - // language: 'en', - // type: DictType.article - // }, + { + ...cloneDeep(DefaultDict), + id: 'article_nce2', + name: "新概念英语2-课文", + description: '新概念英语2-课文', + category: '英语学习', + tags: ['新概念英语'], + url: 'NCE_2.json', + translateLanguage: 'common', + language: 'en', + type: DictType.article + }, { ...cloneDeep(DefaultDict), id: 'nce-new-2',