From bbcf39bfc6cef6c2f38a24cfba4a3b2d4756e41d Mon Sep 17 00:00:00 2001 From: WangHao <43278047@qq.com> Date: Sat, 17 Oct 2020 18:57:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B9=A6=E7=AD=BE=E4=BE=BF?= =?UTF-8?q?=E7=AD=BE=E4=B9=8B=E9=97=B4=E5=88=87=E6=8D=A2,=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=98=BE=E7=A4=BA=E7=8A=B6=E6=80=81=E7=AD=89=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 15 ++ .../note/service/impl/NmNoteServiceImpl.java | 2 + .../src/components/BookmarkList/index.vue | 40 ++++-- ruoyi-ui/src/store/getters.js | 30 ++-- .../src/views/bookmark/bookmark/index.vue | 136 ++++++++++++------ ruoyi-ui/src/views/bookmark/index/index.vue | 5 + 6 files changed, 158 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index 88611e2dd..bc5e6684b 100644 --- a/README.md +++ b/README.md @@ -38,3 +38,18 @@ https://www.jianshu.com/p/c1ee7e4247bf @Synchronized : 同步方法安全的转化 @Getter(lazy=true) : @Log : 支持各种logger对象,使用时用对应的注解,如:@Log4j + + + + +beforCreate(创建之前) +Created(创建之后) +beforMount(载入之前) +Mounted(载入之后) +beforUpdate(更新之前) +Updated(更新之后) +beforDestroy(销毁之前) +Destroyed(销毁之后) +activate(keep-alive组件激活时调用) +deactivated(keep-alive组件停用时调用) +errorCaptured(这个组件的作用是接受子孙组件报错是调用,三个参数 错误对象、错误的组件、错误信息) diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteServiceImpl.java b/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteServiceImpl.java index 6b91fd198..3ab8ce85b 100644 --- a/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteServiceImpl.java +++ b/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteServiceImpl.java @@ -83,6 +83,8 @@ public class NmNoteServiceImpl implements INmNoteService { nmNote.setCreateTime(DateUtils.getNowDate()); nmNote.setTitle(DateUtil.now()); nmNote.setTiymceUeditor(defaultUidGenerator.getUID()); + //创建文章>>mongodb + redisCache.setCacheObject(Constants.NM_NOTE_CONTENT+nmNote.getTiymceUeditor(),"请开始你的创作!"); return nmNoteMapper.insertSelective(nmNote); } diff --git a/ruoyi-ui/src/components/BookmarkList/index.vue b/ruoyi-ui/src/components/BookmarkList/index.vue index 2c14e8ca1..c0eb8797c 100644 --- a/ruoyi-ui/src/components/BookmarkList/index.vue +++ b/ruoyi-ui/src/components/BookmarkList/index.vue @@ -42,6 +42,7 @@ components: {format}, props: { bookmarkList: Array, + property: null, }, data: function () { return { @@ -49,25 +50,19 @@ noteTime:true, isBookmarkIcon:false, Ueditor:undefined, - } }, + mounted(){ + this.showView(this.property); + }, + updated(){ + this.showView(this.property); + }, created() { var that=this; //便签ID that.Ueditor = that.$route.query.Ueditor; - var a=2; - if(a==2){ - //便签模式 只能这么显示 - this.isdescription=false; - this.noteTime=true; - this.isBookmarkIcon=false; - }else { - this.isdescription=true; - this.noteTime=false; - this.isBookmarkIcon=true; - } }, filters: { //timeago.js插件 @@ -83,6 +78,27 @@ this.$emit('on-windowurl', noteId, tiymceueditor,bookmarkId,url); } + , + showView(e) { + var that=this; + switch (e) { + case 0: + //网页模式 + that.isdescription = true; + that.noteTime = false; + that.isBookmarkIcon = true; + break; + case 1: + //便签模式 + that.isdescription = true; + that.noteTime = true; + that.isBookmarkIcon = false; + break; + default: + + } + + } } } diff --git a/ruoyi-ui/src/store/getters.js b/ruoyi-ui/src/store/getters.js index b98552150..d13d863ac 100644 --- a/ruoyi-ui/src/store/getters.js +++ b/ruoyi-ui/src/store/getters.js @@ -1,15 +1,15 @@ -const getters = { - sidebar: state => state.app.sidebar, - size: state => state.app.size, - device: state => state.app.device, - visitedViews: state => state.tagsView.visitedViews, - cachedViews: state => state.tagsView.cachedViews, - token: state => state.user.token, - avatar: state => state.user.avatar, - name: state => state.user.name, - introduction: state => state.user.introduction, - roles: state => state.user.roles, - permissions: state => state.user.permissions, - permission_routes: state => state.permission.routes -} -export default getters +const getters = { + sidebar: state => state.app.sidebar, + size: state => state.app.size, + device: state => state.app.device, + visitedViews: state => state.tagsView.visitedViews, + cachedViews: state => state.tagsView.cachedViews, + token: state => state.user.token, + avatar: state => state.user.avatar, + name: state => state.user.name, + introduction: state => state.user.introduction, + roles: state => state.user.roles, + permissions: state => state.user.permissions, + permission_routes: state => state.permission.routes, +} +export default getters diff --git a/ruoyi-ui/src/views/bookmark/bookmark/index.vue b/ruoyi-ui/src/views/bookmark/bookmark/index.vue index 5d94cea4e..bfc78fe0f 100644 --- a/ruoyi-ui/src/views/bookmark/bookmark/index.vue +++ b/ruoyi-ui/src/views/bookmark/bookmark/index.vue @@ -2,7 +2,7 @@
- +
@@ -199,7 +199,7 @@
- +

加载中...

没有更多了

@@ -279,11 +279,11 @@ - +
- - + +
@@ -307,6 +307,7 @@