Selaa lähdekoodia

菜单选择设置默认值

RuoYi 6 vuotta sitten
vanhempi
commit
6bf77f610e

+ 1 - 1
src/main/java/com/ruoyi/project/system/menu/controller/MenuController.java

@@ -178,7 +178,7 @@ public class MenuController extends BaseController
     @GetMapping("/selectMenuTree/{menuId}")
     public String selectMenuTree(@PathVariable("menuId") Long menuId, ModelMap mmap)
     {
-        mmap.put("treeName", menuService.selectMenuById(menuId).getMenuName());
+        mmap.put("menu", menuService.selectMenuById(menuId));
         return prefix + "/tree";
     }
 }

+ 2 - 2
src/main/resources/templates/system/menu/tree.html

@@ -8,8 +8,8 @@ body{height:auto;font-family: "Microsoft YaHei";}
 button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
 </style>
 <body class="hold-transition box box-main">
-	<input id="treeId"   name="treeId"    type="hidden"/>
-	<input id="treeName" name="treeName"  type="hidden" th:value="${treeName}"/>
+	<input id="treeId"   name="treeId"    type="hidden" th:value="${menu.menuId}"/>
+	<input id="treeName" name="treeName"  type="hidden" th:value="${menu.menuName}"/>
 	<div class="wrapper"><div class="treeShowHideButton" onclick="search();">
 		<label id="btnShow" title="显示搜索" style="display:none;">︾</label>
 		<label id="btnHide" title="隐藏搜索">︽</label>