diff --git a/src/components/Book.vue b/src/components/Book.vue index 193e6681..40c6155d 100644 --- a/src/components/Book.vue +++ b/src/components/Book.vue @@ -10,10 +10,12 @@ interface IProps { showCheckbox?: boolean checked?: boolean showProgress?: boolean + isUser?: boolean } const props = withDefaults(defineProps(), { - showProgress: true + showProgress: true, + isUser: false }) defineEmits<{ @@ -49,6 +51,7 @@ const studyProgress = $computed(() => { class="absolute left-3 bottom-3 z-2"/>
自定义
更新中
+
未同步
{{ item?.name }}
@@ -69,4 +72,12 @@ const studyProgress = $computed(() => { font-size: 11px; transform: rotate(45deg); } + +.sync { + @extend .custom; + bottom: 4px; + left: -22px; + top: unset; + right: unset; +} diff --git a/src/pages/article/ArticlesPage.vue b/src/pages/article/ArticlesPage.vue index ac350cf7..04224c58 100644 --- a/src/pages/article/ArticlesPage.vue +++ b/src/pages/article/ArticlesPage.vue @@ -307,6 +307,7 @@ let isNewHost = $ref(window.location.host === Host)
({ load: false, word: { bookList: [ - getDefaultDict({id: DictId.wordCollect, name: '收藏'}), - getDefaultDict({id: DictId.wordWrong, name: '错词'}), - getDefaultDict({id: DictId.wordKnown, name: '已掌握', description: '已掌握后的单词不会出现在练习中'}), + getDefaultDict({ id: DictId.wordCollect, name: '收藏' }), + getDefaultDict({ id: DictId.wordWrong, name: '错词' }), + getDefaultDict({ id: DictId.wordKnown, name: '已掌握', description: '已掌握后的单词不会出现在练习中' }), ], studyIndex: -1, }, article: { bookList: [ - getDefaultDict({id: DictId.articleCollect, name: '收藏'}) + getDefaultDict({ id: DictId.articleCollect, en_name: DictId.articleCollect, name: '收藏' }) ], studyIndex: -1, }, @@ -121,7 +121,7 @@ export const useBaseStore = defineStore('base', { data.dictListVersion = r.data } } - console.log('data',data) + console.log('data', data) if (AppEnv.CAN_REQUEST) { let res = await myDictList() if (res.success) { @@ -129,7 +129,7 @@ export const useBaseStore = defineStore('base', { } } this.setState(data) - set(SAVE_DICT_KEY.key, JSON.stringify({val: shakeCommonDict(this.$state), version: SAVE_DICT_KEY.version})) + set(SAVE_DICT_KEY.key, JSON.stringify({ val: shakeCommonDict(this.$state), version: SAVE_DICT_KEY.version })) } catch (e) { console.error('读取本地dict数据失败', e) } diff --git a/src/types/func.ts b/src/types/func.ts index 8aaf4e56..245de980 100644 --- a/src/types/func.ts +++ b/src/types/func.ts @@ -46,7 +46,7 @@ export function getDefaultArticle(val: Partial
= {}): Article { audioFileId: '', lrcPosition: [], questions: [], - nameList:[], + nameList: [], ...cloneDeep(val) } } @@ -74,6 +74,7 @@ export function getDefaultDict(val: Partial = {}): Dict { is_default: false, update: false, cover: '', + sync: false, ...val, words: shallowReactive(val.words ?? []), diff --git a/src/types/types.ts b/src/types/types.ts index d5c141fa..e59da1bc 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -180,6 +180,7 @@ export interface Dict extends DictResource { is_default?: boolean update?: boolean cover?: string + sync?: boolean } export interface ArticleItem {