From 0934737d366f6c958db71df27ade06b3bc2381b8 Mon Sep 17 00:00:00 2001 From: WangHao <43278047@qq.com> Date: Mon, 31 Aug 2020 22:02:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=A6=E7=AD=BE=E7=BC=96=E8=BE=91=E5=92=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/bookmark/content/index.vue | 177 +++++++++++++++--- .../com/ruoyi/bookmark/domain/SqBookmark.java | 4 +- .../mapper/bookmark/SqMenuMapper.xml | 1 - 3 files changed, 154 insertions(+), 28 deletions(-) diff --git a/ruoyi-ui/src/views/bookmark/content/index.vue b/ruoyi-ui/src/views/bookmark/content/index.vue index 294e96f58..a98b92e72 100644 --- a/ruoyi-ui/src/views/bookmark/content/index.vue +++ b/ruoyi-ui/src/views/bookmark/content/index.vue @@ -69,6 +69,17 @@
+
+
+
修改
+
删除
+
分享
+ +
+ + +
+

{{bm.title}}

@@ -85,21 +96,48 @@
{{bm.urls}} · 
{{bm.createTime|changeTime}}
+ +
- - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -119,6 +157,12 @@ data: function () { return { + // 遮罩层 + loading: true, + // 弹出层标题 + title: "", + // 是否显示弹出层 + open: false, showbookmark:true, showimg:false, loading:false, @@ -139,6 +183,11 @@ }, bookmarkList:[], urltext:'?from=yunshuqian.com',//网址域名起推广作用 + // 表单参数 + form: {}, + // 表单校验 + rules: { + } } }, filters: { @@ -176,6 +225,78 @@ }, methods: { + /** 修改按钮操作 */ + handleUpdate(bookmarkId) { + this.reset(); + const ibookmarkId = bookmarkId || this.ids + getBookmark(ibookmarkId).then(response => { + this.form = response.data; + this.open = true; + this.title = "书签编辑管理"; + }); + }, + /** 提交按钮 修改和新增 */ + submitForm: function() { + this.$refs["form"].validate(valid => { + if (valid) { + if (this.form.bookmarkId != undefined) { + updateBookmark(this.form).then(response => { + if (response.code === 200) { + this.msgSuccess("修改成功"); + this.open = false; + this.getList(); + } + }); + } else { + addBookmark(this.form).then(response => { + if (response.code === 200) { + this.msgSuccess("新增成功"); + this.open = false; + this.getList(); + } + }); + } + } + }); + }, + /** 删除按钮操作 */ + handleDelete(bookmarkId) { + const bookmarkIds = bookmarkId || this.ids; + this.$confirm('是否确认删除此条书签数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(function() { + return delBookmark(bookmarkIds); + }).then(() => { + this.getList(); + this.msgSuccess("删除成功"); + }).catch(function() {}); + }, + // 取消按钮 + cancel() { + this.open = false; + this.reset(); + }, + // 表单重置 + reset() { + this.form = { + bookmarkId: undefined, + userid: undefined, + title: undefined, + url: undefined, + urls: undefined, + description: undefined, + image: undefined, + label: undefined, + menuId: undefined, + zcount: undefined, + idelete: undefined, + start: undefined, + createTime: undefined + }; + this.resetForm("form"); + }, /** 回收站**/ getrecycleList() { this.loading = true; @@ -225,25 +346,9 @@ window.open(url); - //如果是回收站打开的 就修改状态 - // if (this.$route.params.menuId=6666){ - // this.$axios.get(`/api/bookmark/updateBookmarkStart?bookmarkId=${bookmarkId}`).then(response => { - // - // if (response.status == 200 && response.data.status == 'success') { - // this.momentlList() - // this.$message({type: 'success', message: '此书签被打开,移除稍后再看,并且公开显示!'}) - // - // }else { - // this.$message({type: 'error', message: '移除失败!'}) - // } - // - // }); - // } }, - - - }, + }, } @@ -299,5 +404,27 @@ color: #D4D4D4!important; } + .editBookamrk{ + width: 200px; + height: 70px; + position: absolute; + background-color: #acd7ff; + right: 0; + } + .editlist{ + display: flex; + width: 200px; + height: 70px; + flex-flow: wrap; + align-items: center; + } + .editlist div{ + margin-left:10px; + width: 50px; + height: 35px; + align-content: center; + + } + diff --git a/ruoyi-yunbookmark/src/main/java/com/ruoyi/bookmark/domain/SqBookmark.java b/ruoyi-yunbookmark/src/main/java/com/ruoyi/bookmark/domain/SqBookmark.java index 440f76543..a70950178 100644 --- a/ruoyi-yunbookmark/src/main/java/com/ruoyi/bookmark/domain/SqBookmark.java +++ b/ruoyi-yunbookmark/src/main/java/com/ruoyi/bookmark/domain/SqBookmark.java @@ -42,7 +42,7 @@ public class SqBookmark private String url; /** $column.columnComment */ - @Excel(name = "书签地址") + @Excel(name = "官网地址") @Column(name = "urls") private String urls; @@ -52,7 +52,7 @@ public class SqBookmark private String description; /** $column.columnComment */ - @Excel(name = "书签描述") + @Excel(name = "图片") @Column(name = "image") private String image; diff --git a/ruoyi-yunbookmark/src/main/resources/mapper/bookmark/SqMenuMapper.xml b/ruoyi-yunbookmark/src/main/resources/mapper/bookmark/SqMenuMapper.xml index c0670cdb7..a9ebd6bab 100644 --- a/ruoyi-yunbookmark/src/main/resources/mapper/bookmark/SqMenuMapper.xml +++ b/ruoyi-yunbookmark/src/main/resources/mapper/bookmark/SqMenuMapper.xml @@ -75,7 +75,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" menu_order = #{menuOrder}, bookmark_count = #{bookmarkCount}, create_time = #{createTime}, - update_time = now() where menu_id = #{menuId}