优化菜单树的请求减少
This commit is contained in:
		| @@ -479,6 +479,7 @@ | ||||
|       /** 新增书签Url操作 */ | ||||
|       addbookmarkurl:function(){ | ||||
|           this.reset(); | ||||
|           this.getTreeselect(); | ||||
|           this.addopen = true; | ||||
|  | ||||
|         // getMenu(e.getAttribute("data-menuId")).then(response => { | ||||
| @@ -548,6 +549,14 @@ | ||||
|       }, | ||||
|       /** 查询部门下拉树结构 */ | ||||
|       getTreeselect() { | ||||
|         if (this.zNodes!=null&&this.zNodes.length!=0){ | ||||
|           this.menuOptions = []; | ||||
|           const data = { menuId: 0, menuName: '顶级菜单', children: [] }; | ||||
|           data.children = this.handleTree(this.zNodes, "menuId", "parentId"); | ||||
|           this.menuOptions.push(data); | ||||
|           return; | ||||
|         } | ||||
|  | ||||
|         listMenuByUserId().then(response => { | ||||
|           this.menuOptions = []; | ||||
|           const data = { menuId: 0, menuName: '顶级菜单', children: [] }; | ||||
|   | ||||
| @@ -6,7 +6,9 @@ import java.util.*; | ||||
| import cn.hutool.core.date.DateUtil; | ||||
| import com.ruoyi.bookmark.domain.SqBookmarkTag; | ||||
|  | ||||
| import com.ruoyi.bookmark.domain.SqMenu; | ||||
| import com.ruoyi.bookmark.mapper.SqBookmarkTagMapper; | ||||
| import com.ruoyi.bookmark.mapper.SqMenuMapper; | ||||
| import com.ruoyi.bookmark.mapper.SqTagMapper; | ||||
|  | ||||
| import com.ruoyi.bookmark.service.ISqTagService; | ||||
| @@ -39,6 +41,9 @@ public class SqBookmarkServiceImpl implements ISqBookmarkService | ||||
|     @Autowired | ||||
|     private SqTagMapper sqTagMapper; | ||||
|  | ||||
|     @Autowired | ||||
|     private SqMenuMapper sqMenuMapper; | ||||
|  | ||||
|  | ||||
|     @Autowired | ||||
|     private ISqTagService iSqTagService; | ||||
| @@ -132,8 +137,10 @@ public class SqBookmarkServiceImpl implements ISqBookmarkService | ||||
|             sqBookmarkTagMapper.insertSqBookmarkTag(bookamrktag); | ||||
|         } | ||||
|  | ||||
|  | ||||
|  | ||||
|         //给对应目录 +1 | ||||
|         Long[] menuIds= new Long[1]; | ||||
|         menuIds[0]=sqBookmark.getMenuId(); | ||||
|         sqMenuMapper.updateCountAdd(menuIds,1); | ||||
|         return i; | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user