admin/src/main.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
admin/src/store/index.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
server/system_service/src/main/java/com/doumee/biz/system/impl/SystemMenuBizImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
server/system_service/src/main/java/com/doumee/dao/system/vo/SystemMenuNodeVO.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Category.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
admin/src/main.js
@@ -45,10 +45,16 @@ return } await this.initRoutes() }, async topMenuCurrent () { if (this.topMenuCurrent == null) { return } await this.chagneRoutes() } }, methods: { ...mapMutations(['switchCollapseMenu', 'setHomePage', 'setTopMenuCurrent', 'setTopMenuCurrent']), ...mapMutations(['switchCollapseMenu', 'setHomePage', 'setTopMenuCurrent', 'setTopMenuCurrent','cleartagsview']), // 初始化本地配置 initLocalConfig () { // 菜单状态配置 @@ -79,9 +85,13 @@ }) storeTopMenus.push.apply(storeTopMenus, topList) var topCurrent = null var tlist =[] topList.forEach(item => { if (item.linkType === 0 && topCurrent == null) { topCurrent = item if (item.linkType === 0 ) { if (topCurrent == null) { topCurrent = item } tlist.push(...item.children) } }) this.setTopMenuCurrent(topCurrent) @@ -96,7 +106,7 @@ console.log('menus', this.menuData.list) storeMenus.push.apply(storeMenus, this.menuData.list) // 添加路由 this.__addRouters(storeMenus) this.__addRouters(tlist) // 404 router.addRoute({ path: '*', @@ -120,6 +130,16 @@ this.loading = false }) }, async chagneRoutes () { // 重置菜单 this.cleartagsview('/index') console.log('menus', this.menuData.list) // 添加路由 // this.__addRouters(this.menuData.list) if(this.topMenuCurrent.homeUrl){ await this.$router.push({path: this.topMenuCurrent.homeUrl, query: {}}) } }, // 新建路由 __addRouters (routes, parents = []) { if (routes == null || routes.length === 0) { admin/src/store/index.js
@@ -1,5 +1,6 @@ import Vue from 'vue' import Vuex from 'vuex' import router from '../router' Vue.use(Vuex) const state = { @@ -73,7 +74,7 @@ }, // 重置菜单 resetMenus: (state) => { state.topMenuId=null; state.topMenuId=null state.menuData.list = [] }, // tags server/system_service/src/main/java/com/doumee/biz/system/impl/SystemMenuBizImpl.java
@@ -139,6 +139,7 @@ nodeVO.setType(menu.getType()); nodeVO.setLinkType(menu.getLinkType()); nodeVO.setIcon(menu.getIcon()); // nodeVO.setHomeUrl("/index");//默认工作台 nodeVO.setChildren(new ArrayList<>()); rootNodes.add(nodeVO); } @@ -146,10 +147,29 @@ menus.removeIf(menu -> menu.getParentId() == null); for (SystemMenuNodeVO child : rootNodes) { this.fillChildren(child, menus); SystemMenuNodeVO homeMenus = getHomeUrlByChild(child); if(homeMenus!=null && homeMenus.getUrl() != null){ child.setHomeUrl(homeMenus.getUrl()); } } return rootNodes; } private SystemMenuNodeVO getHomeUrlByChild( SystemMenuNodeVO child) { if(child.getChildren()==null || child.getChildren().size() ==0){ return null; } for(SystemMenuNodeVO tt : child.getChildren()){ if(tt.getChildren()==null || tt.getChildren().size() ==0){ return tt; }else{ SystemMenuNodeVO ttt = getHomeUrlByChild(tt); return ttt; } } return null; } @Override public void deleteById(Integer id) { List<Integer> ids = systemMenuService.findChildren(id); server/system_service/src/main/java/com/doumee/dao/system/vo/SystemMenuNodeVO.java
@@ -33,6 +33,8 @@ @ApiModelProperty(value = "菜单地址") private String url; @ApiModelProperty(value = "第一个默认页地址") private String homeUrl; @ApiModelProperty(value = "子菜单") private List<SystemMenuNodeVO> children; server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Category.java
@@ -93,6 +93,7 @@ @ExcelColumn(name="组合名称",index = 3,width = 20) private String groupName; @ApiModelProperty(value = "完整图片地址 ") @TableField(exist = false) private String imgurlFull; @ApiModelProperty(value = "子集分类")