diff --git a/nuxt.config.js b/nuxt.config.js index 2591e9a..540f947 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -99,11 +99,13 @@ export default { "action": "操作", "app_name": "云笔记", "button": { + "add": "添加", "cancel": "取消", "catalog": "目录", "del": "删除", "edit": "编辑", - "ok": "確定", + "ok": "确定", + "rating": "提交评分", "submit": "提交" }, "center": { @@ -179,8 +181,18 @@ export default { "add": "添加笔记" }, "tip": { + "add_tip": "是否添加该笔记?", + "auto_save": "失去焦点自动保存", "click_note_list": "选中内容定位笔记", - "contextmenu_err": "请选中文本进行操作" + "contextmenu_err": "请选中文本进行操作", + "del_confirm": "确认删除此笔记?", + "form": { + "note_content": "笔记内容", + "note_title": "笔记标题" + }, + "rating_1": "本文对您的科研工作是否有帮助", + "rating_2": "本文的内容是否科学严谨", + "rating_3": "您对本文的推荐程度" } }, "reading_online": "在线阅读", @@ -222,11 +234,13 @@ export default { "action": "", "app_name": "cloudnote", "button": { + "add": "", "cancel": "", "catalog": "", "del": "", "edit": "", "ok": "", + "rating": "", "submit": "" }, "center": { @@ -302,8 +316,18 @@ export default { "add": "" }, "tip": { + "add_tip": "", + "auto_save": "", "click_note_list": "", - "contextmenu_err": "" + "contextmenu_err": "", + "del_confirm": "", + "form": { + "note_content": "", + "note_title": "" + }, + "rating_1": "", + "rating_2": "", + "rating_3": "" } }, "reading_online": "", diff --git a/pages/index/read.vue b/pages/index/read.vue index 3e31a1c..4b7ce10 100644 --- a/pages/index/read.vue +++ b/pages/index/read.vue @@ -1,33 +1,92 @@ diff --git a/static/star.svg b/static/star.svg new file mode 100644 index 0000000..de4897a --- /dev/null +++ b/static/star.svg @@ -0,0 +1,3 @@ + + diff --git a/store/read.js b/store/read.js index 44caaba..7b715c8 100644 --- a/store/read.js +++ b/store/read.js @@ -1,42 +1,33 @@ +import Vue from 'vue' + /** * 阅读论文标签数据 */ export const state=()=>({ //已打开论文列表 - read:[], + read: { }, //激活的论文标签 activeName:'' }) export const mutations = { //新建论文标签 open(state,item){ - let isNew=true - for(let i in state.read) { - if (state.read[i].title === item.title) { - isNew=false - mutations.choose(state,item.title) - } - } - if(isNew) { - state.read.push(item) - mutations.choose(state, state.read[state.read.length - 1].title) + if(item.title in state.read){ + mutations.choose(state,item.title) + }else{ + Vue.set(state.read,item.title, item) + mutations.choose(state) } }, //关闭论文标签 close(state,title){ - for(let i in state.read){ - if(state.read[i].title===title){ - state.read.splice(i,1) - if(state.read.length>0){ - if(state.activeName===title) { - mutations.choose(state, state.read[state.read.length - 1].title) - } - } - } + Vue.delete(state.read,title) + if(Object.keys(state.read).length>0&&state.activeName===title){ + mutations.choose(state) } }, //选择论文标签 - choose(state,title){ + choose(state,title=Object.keys(state.read)[Object.keys(state.read).length-1]){ state.activeName=title } }