| <!DOCTYPE HTML> | 
| <html xmlns:th="http://www.thymeleaf.org"> | 
| <head> | 
| <meta charset="utf-8"> | 
| <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> | 
| <meta name="renderer" content="webkit|ie-comp|ie-stand"> | 
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 
| <meta name="viewport" | 
|     content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> | 
| <meta http-equiv="Cache-Control" content="no-siteapp" /> | 
| <!-- 本框架基本脚本和样式 --> | 
| <script type="text/javascript" | 
|     th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> | 
| <script type="text/javascript" | 
|     th:src="@{/js/systools/MBase.js}"></script> | 
| </head> | 
| <body> | 
| <div class="ibox-content"> | 
|         <form class="form-horizontal" id="dataform" onsubmit="javascript:return false;"> | 
|             <input type="hidden" name="id" th:value="${obj.id}"> | 
|             <div class="form-group"> | 
|                 <label class="col-sm-2 control-label">数据类型 | 
|                     <span class="text-danger">*</span> | 
|                 </label> | 
|                 <div class="col-sm-4"> | 
|                     <select class="form-control  select2" size="1" name="parentId" | 
|                             id="parentId"> | 
|                     </select> | 
|                 </div> | 
|   | 
|             </div> | 
|             <div class="form-group"> | 
|                 <label class="col-sm-2 control-label">字典值 | 
|                     <span class="text-danger">*</span> | 
|                 </label> | 
|                 <div class="col-sm-4"> | 
|                     <input type="text" class="form-control" name="value" | 
|                            dataType="*"  nullmsg="字典值不能为空" | 
|                            th:value="${obj.value}"> | 
|                 </div> | 
|   | 
|             </div> | 
|             <div class="form-group"> | 
|                 <label class="col-sm-2 control-label">字典CODE</label> | 
|                 <div class="col-sm-4"> | 
|                     <input autocomplete="off" id="typeCode"  type="text" name="typeCode" class="form-control " | 
|                     > | 
|                 </div> | 
|   | 
|             </div> | 
|             <div class="form-group"> | 
|   | 
|                 <label class="col-sm-2 control-label">排序 | 
|                 </label> | 
|                 <div class="col-sm-4"> | 
|                     <input type="number" class="form-control" name="sort" | 
|                            th:value="${obj.sort}"> | 
|                 </div> | 
|             </div> | 
|         <div class="form-group "> | 
|             <div class="col-sm-12 text-center"> | 
|                 <a href="javascript:;" onclick="myForm.submit()" | 
|                     class="btn btn-success radius"><i class="fa fa-check"></i>  保存</a>        <a | 
|                     class="btn btn-danger radius" href="javascript:;" onclick="MTools.closeForm()" ><i class="fa fa-close"></i> 关闭</a> | 
|             </div> | 
|         </div> | 
|     </form> | 
|     </div> | 
| </body> | 
| <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> | 
| <script th:inline="javascript"> | 
|     MTools.autoFullSelect(); | 
|     $(".select2").select2(); | 
|      | 
|     /*<![CDATA[*/ | 
|     var obj=/*[[${obj}]]*/      | 
|     /*]]>*/ | 
|     $(function(){ | 
|         initSeclect("#parentId",[[${obj.parentId}]]); | 
|     }); | 
|     var invokeUrl=basePath+"/admin/customerDictionary/addDataDictionary"; | 
|     if(obj.id!=null){ | 
|        invokeUrl = basePath+"/admin/customerDictionary/modifyDataDictionary"; | 
|     } | 
|     var myForm=MForm.initForm({ | 
|         invokeUrl:invokeUrl, | 
|         afterSubmit:function(){ | 
|             parent.updateDictionaryTree(); | 
|         }, | 
|     }); | 
|   | 
|     function initSeclect(seler,def){ | 
|         $.AjaxProxy().invoke(basePath+"/admin/customerDictionary/all", | 
|                 function(loj) { | 
|                     $(seler).createSelectTree( | 
|                             loj.attr("result").rows, | 
|                             {    id : "id", | 
|                                 parent : "parentId", | 
|                                 value : "value", | 
|                                 append : false, | 
|                                 defaultValue : def, | 
|                                 defaultHtml : '<option value="0" selected="selected">一级字典</option>' | 
|                             }); | 
|                 }); | 
|     } | 
| </script> | 
| </body> | 
| </html> |