新增全部书签和回收站

This commit is contained in:
WangHao 2020-08-29 23:38:07 +08:00
parent 0af7ede907
commit fd957351e5
8 changed files with 172 additions and 12 deletions

View File

@ -59,6 +59,31 @@ public class SqBookmarkController extends BaseController
List<SqBookmark> list = sqBookmarkService.selectBymenuIdUserID(menuId,sysUser.getUserId()); List<SqBookmark> list = sqBookmarkService.selectBymenuIdUserID(menuId,sysUser.getUserId());
return getDataTable(list); return getDataTable(list);
} }
/**
* 回收站
* @return
*/
@GetMapping("/selectBydelete")
@PreAuthorize("@ss.hasPermi('bookmark:bookmark:list')")
public TableDataInfo selectBydelete() {
SysUser sysUser=getAuthUser();
startPage();
List<SqBookmark> list = sqBookmarkService.selectBydelete(sysUser.getUserId());
return getDataTable(list);
}
/**
* 用户全部书签
* @return
*/
@GetMapping("/selectByUseridList")
@PreAuthorize("@ss.hasPermi('bookmark:bookmark:list')")
public TableDataInfo selectByUseridList() {
SysUser sysUser=getAuthUser();
startPage();
List<SqBookmark> list = sqBookmarkService.selectByUseridList(sysUser.getUserId());
return getDataTable(list);
}
/** /**

View File

@ -8,6 +8,23 @@ export function selectBymenuIdUserID(query) {
params: query params: query
}) })
} }
//回收站
export function selectBydelete(query) {
return request({
url: '/bookmark/bookmark/selectBydelete',
method: 'get',
params: query
})
}
//用户全部书签
export function selectByUseridList(query) {
return request({
url: '/bookmark/bookmark/selectByUseridList',
method: 'get',
params: query
})
}

View File

@ -109,7 +109,7 @@
<script> <script>
import { selectBymenuIdUserID, getBookmark, delBookmark, addBookmark, updateBookmark, exportBookmark } from "@/api/bookmark/bookmark"; import { selectBymenuIdUserID,selectBydelete,selectByUseridList, getBookmark, delBookmark, addBookmark, updateBookmark, exportBookmark } from "@/api/bookmark/bookmark";
import { format } from 'timeago.js'; import { format } from 'timeago.js';
export default { export default {
@ -151,17 +151,61 @@
}, },
created() { created() {
var that=this; var that=this;
if (that.$route.query.menuId==undefined){ var routedata=that.$route.query.menuId;
if (routedata==undefined){
that.queryParams.menuId=1; that.queryParams.menuId=1;
}else { }else {
that.queryParams.menuId=that.$route.query.menuId; that.queryParams.menuId=routedata;
} }
if (routedata=='BOOKMARK'){
//
this.getBookmarkList();
}else if(routedata=='RECYCLE'){
//
this.getrecycleList();
}else{
//menuId
this.getList(); this.getList();
}
}, },
mounted(){ mounted(){
}, },
methods: { methods: {
/** 回收站**/
getrecycleList() {
this.loading = true;
selectBydelete(this.queryParams).then(response => {
if (response.total!=0&&response.code==200){
this.bookmarkList = response.rows;
this.total = response.total;
this.loading = false;
}else {
this.showbookmark = false;
this.showimg = true;
}
});
},
/** 全部书签**/
getBookmarkList() {
this.loading = true;
selectByUseridList(this.queryParams).then(response => {
if (response.total!=0&&response.code==200){
this.bookmarkList = response.rows;
this.total = response.total;
this.loading = false;
}else {
this.showbookmark = false;
this.showimg = true;
}
});
},
/** 查询书签管理列表 */ /** 查询书签管理列表 */
getList() { getList() {
this.loading = true; this.loading = true;

View File

@ -13,7 +13,7 @@
<div class="aside-title"><i class="el-icon-s-tools"></i><span>全部书签</span></div> <div class="aside-title" @click="goBookmarkList"><i class="el-icon-s-tools"></i><span>全部书签</span></div>
<div class="aside-title"><i class="el-icon-help"></i><span>发现</span></div> <div class="aside-title"><i class="el-icon-help"></i><span>发现</span></div>
<div class="aside-title"><i class="el-icon-s-platform"></i><span>任意门</span></div> <div class="aside-title"><i class="el-icon-s-platform"></i><span>任意门</span></div>
<div class="aside-title"><i class="el-icon-message-solid"></i><span>收件箱</span></div> <div class="aside-title"><i class="el-icon-message-solid"></i><span>收件箱</span></div>
@ -23,13 +23,12 @@
</div> </div>
<div class="reminder">工具箱</div> <div class="reminder">工具箱</div>
<div class="aside-title"><i class="el-icon-s-tools"></i><span>收藏同步</span></div> <div class="aside-title"><i class="el-icon-s-tools"></i><span>收藏同步</span></div>
<div class="aside-title"><i class="el-icon-help"></i><span>发现书签</span></div> <div class="aside-title" @click="gorecycle"><i class="el-icon-help"></i><span>回收站</span></div>
<router-link :to="{ name: 'importHtml' }"> <div class="aside-title" @click="importHtml">
<div class="aside-title">
<i class="el-icon-s-platform"></i><span>导入书签</span> <i class="el-icon-s-platform"></i><span>导入书签</span>
</div> </div>
</router-link> <div class="aside-title"><i class="el-icon-message-solid"></i><span>意见反馈</span></div>
<div class="aside-title"><i class="el-icon-message-solid"></i><span>收件箱</span></div> <div class="aside-title"><i class="el-icon-message-solid"></i><span>其他设置</span></div>
<!-- <el-footer class="aside-navigation">--> <!-- <el-footer class="aside-navigation">-->
<!-- </el-footer>--> <!-- </el-footer>-->
@ -423,6 +422,7 @@
// } // }
//return true; //return true;
}, },
/** 点击跳转**/
// //
OnClickzTree:function(event,treeId, treeNode){ OnClickzTree:function(event,treeId, treeNode){
var that=this; var that=this;
@ -449,6 +449,13 @@
that.isShowZtree = !that.isShowZtree; that.isShowZtree = !that.isShowZtree;
}, },
/**跳转导入页面**/
importHtml:function(){
this.$router.push({
path: "/importHtml",
})
},
@ -501,7 +508,30 @@
}); });
},
//
goBookmarkList(){
var that=this;
that.$router.push({
path: "/content",
query: {
menuId: 'BOOKMARK'
} }
})
},
//
gorecycle(){
var that=this;
that.$router.push({
path: "/content",
query: {
menuId: 'RECYCLE'
}
})
},
}, },
mounted(){ mounted(){
window['editBookmark'] = (e) => { window['editBookmark'] = (e) => {

View File

@ -23,6 +23,13 @@ public interface SqBookmarkMapper extends MyMapper<SqBookmark>
* @return 书签管理 * @return 书签管理
*/ */
public List<SqBookmark> selectBymenuIdUserID(@Param("menuID") Long menuID, @Param("userID") Long userID); public List<SqBookmark> selectBymenuIdUserID(@Param("menuID") Long menuID, @Param("userID") Long userID);
/**
* @auther: Wang
* @date: 2020/08/29 23:03
* 功能描述: 回收站
*/
public List<SqBookmark> selectBydelete(@Param("userID") Long userID);
/** /**
* 查询书签管理 * 查询书签管理
* *

View File

@ -81,4 +81,15 @@ public interface ISqBookmarkService
* @return 结果 * @return 结果
*/ */
public void updateSqBookmarkBymenuId(Long menuId); public void updateSqBookmarkBymenuId(Long menuId);
/**
* 回收站
* @return
*/
public List<SqBookmark> selectBydelete(Long userId);
/**
* 用户全部书签
* @return
*/
List<SqBookmark> selectByUseridList(Long userId);
} }

View File

@ -2,6 +2,7 @@ package com.ruoyi.bookmark.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.sun.org.apache.bcel.internal.generic.NEW;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -122,5 +123,24 @@ public class SqBookmarkServiceImpl implements ISqBookmarkService
@Override @Override
public void updateSqBookmarkBymenuId(Long menuId) { public void updateSqBookmarkBymenuId(Long menuId) {
sqBookmarkMapper.updateSqBookmarkBymenuId(menuId); sqBookmarkMapper.updateSqBookmarkBymenuId(menuId);
}
/**
* 回收站
* @return
*/
@Override
public List<SqBookmark> selectBydelete(Long userId) {
return sqBookmarkMapper.selectBydelete(userId);
}
/**
* 用户全部书签
* @return
*/
@Override
public List<SqBookmark> selectByUseridList(Long userId) {
SqBookmark sqBookmark= new SqBookmark();
sqBookmark.setUserid(userId);
return sqBookmarkMapper.select(sqBookmark);
} }
} }

View File

@ -114,6 +114,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBymenuIdUserID" parameterType="SqBookmark" resultMap="SqBookmarkResult"> <select id="selectBymenuIdUserID" parameterType="SqBookmark" resultMap="SqBookmarkResult">
<include refid="selectSqBookmarkVo"/> <include refid="selectSqBookmarkVo"/>
where menu_id = #{menuID} and userid=#{userID} where menu_id = #{menuID} and userid=#{userID} and IDelete=0
</select> </select>
<select id="selectBydelete" parameterType="SqBookmark" resultMap="SqBookmarkResult">
<include refid="selectSqBookmarkVo"/>
where userid=#{userID} and IDelete=1
</select>
</mapper> </mapper>