Commit 4466ef77dfc1913d51aa5f31e0c5369aa6615b0c

Authored by wangyanxiong
1 parent 3551a654

修改字典管理获取不到父节点Id bug

src/main/java/com/huaheng/pc/system/dict/controller/DictDataController.java
... ... @@ -3,6 +3,8 @@ package com.huaheng.pc.system.dict.controller;
3 3 import java.util.List;
4 4  
5 5 import com.huaheng.framework.web.service.DictService;
  6 +import com.huaheng.pc.system.dict.domain.DictType;
  7 +import com.huaheng.pc.system.dict.service.IDictTypeService;
6 8 import org.apache.shiro.authz.annotation.RequiresPermissions;
7 9 import org.springframework.beans.factory.annotation.Autowired;
8 10 import org.springframework.stereotype.Controller;
... ... @@ -35,6 +37,9 @@ public class DictDataController extends BaseController
35 37 @Autowired
36 38 private IDictDataService dictDataService;
37 39  
  40 + @Autowired
  41 + private IDictTypeService dictTypeService;
  42 +
38 43 public static List<DictData> dictDataList = null;
39 44  
40 45 @RequiresPermissions("system:dict:view")
... ... @@ -75,9 +80,10 @@ public class DictDataController extends BaseController
75 80 /**
76 81 * 新增字典类型
77 82 */
78   - @GetMapping("/add/{dictType}")
79   - public String add(@PathVariable("dictType") String dictType, ModelMap mmap)
  83 + @GetMapping("/add/{id}")
  84 + public String add(@PathVariable("id") Integer id, ModelMap mmap)
80 85 {
  86 + DictType dictType= dictTypeService.selectDictTypeById(id);
81 87 mmap.put("dictType", dictType);
82 88 return prefix + "/add";
83 89 }
... ...
src/main/resources/templates/system/dict/data/add.html
... ... @@ -5,6 +5,7 @@
5 5 <body class="white-bg">
6 6 <div class="wrapper wrapper-content animated fadeInRight ibox-content">
7 7 <form class="form-horizontal m" id="form-dict-add">
  8 + <input class="form-control" type="text" name="headerId" id="headerId" th:value="${dictType.id}" />
8 9 <div class="form-group">
9 10 <label class="col-sm-3 control-label ">字典标签:</label>
10 11 <div class="col-sm-8">
... ... @@ -20,7 +21,7 @@
20 21 <div class="form-group">
21 22 <label class="col-sm-3 control-label">字典类型:</label>
22 23 <div class="col-sm-8">
23   - <input class="form-control" type="text" id="dictType" name="dictType" readonly="true" th:value="${dictType}">
  24 + <input class="form-control" type="text" id="dictType" name="dictType" readonly="true" th:value="${dictType.dictType}">
24 25 </div>
25 26 </div>
26 27 <div class="form-group">
... ...
src/main/resources/templates/system/dict/data/data.html
... ... @@ -54,7 +54,7 @@
54 54 <!--</div>-->
55 55  
56 56 <div class="btn-group hidden-xs" id="toolbar" role="group">
57   - <a class="btn btn-outline btn-success btn-rounded" th:value="${dict.dictType}" onclick="add()" id="add"
  57 + <a class="btn btn-outline btn-success btn-rounded" th:value="${dict.id}" onclick="add()" id="add"
58 58 shiro:hasPermission="system:dict:add">
59 59 <i class="fa fa-plus"></i> 新增
60 60 </a>
... ...