| <!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> | 
|     <!-- 富文本编辑器 --> | 
|     <script type="text/javascript" charset="utf-8" | 
|             th:src="@{/plugin/beditor/ueditor.config.js}"></script> | 
|     <script type="text/javascript" charset="utf-8" | 
|             th:src="@{/plugin/beditor/ueditor.all.js}"> | 
|     </script> | 
|     <script type="text/javascript" charset="utf-8" | 
|             th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> | 
|   | 
|     <style type="text/css"> | 
|         #projBox { | 
|             max-height: 400px; | 
|             overflow: scroll; | 
|             overflow-x: hidden; | 
|         } | 
|   | 
|     </style> | 
| </head> | 
| <body> | 
| <div class="ibox-content"> | 
|     <form class="form-horizontal" id="dataform" | 
|           onsubmit="javascripr:return false;"> | 
|   | 
|             <input autocomplete="off"   th:if="${obj ne null }" 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-3"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="articleAuthor" | 
|                        th:value="${obj?.articleAuthor }" datatype="*" nullmsg="作者名称不能为空"> | 
|             </div> | 
|             <div class="Validform_checktip"></div> | 
|             <label class="col-sm-2 control-label">文章类型</label> | 
|             <div class="col-sm-3"> | 
|                 <select class="select2 form-control " size="1" name="typeId" id="parentId"> | 
|                     <option value="0" selected="selected">--请选择文章类型--</option> | 
|                 </select> | 
|             </div> | 
|             <div class="Validform_checktip"></div> | 
|         </div> | 
|         <div class="form-group"> | 
|             <label class="col-sm-2 control-label">标题<span class="text-danger">*</span></label> | 
|             <div class="col-sm-3"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="title" | 
|                        th:value="${obj?.title }" datatype="*" nullmsg="标题不能为空"> | 
|             </div> | 
|             <div class="Validform_checktip"></div> | 
|             <label class="col-sm-2 control-label">排序</label> | 
|             <div class="col-sm-3"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="sort" | 
|                        th:value="${obj?.sort }" datatype="n"      ignore="ignore" | 
|                        errormsg="序号只能为数字"> | 
|             </div> | 
|             <div class="Validform_checktip"></div> | 
|         </div> | 
|         <div class="form-group"> | 
|             <label class="col-sm-2 control-label">文章摘要</label> | 
|             <div class="col-sm-3"> | 
|                 <input autocomplete="off"   th:value="${obj?.articleAbstract}" datatype="*1-550" | 
|                        ignore="ignore" name="articleAbstract" class="form-control " | 
|                        type="text" id="zy-input" placeholder="自动抓取为文章前面100个字符"> | 
|             </div> | 
|             <div class="col-sm-3"> | 
|                 <input autocomplete="off"   class='btn radius btn-success' type="button" value="自动抓取" | 
|                        onclick="autoZy()"> <input autocomplete="off"   class='btn radius btn-success' | 
|                                                   type="button" value="清空摘要" onclick="cleanZy()"> | 
|             </div> | 
|             <div class="Validform_checktip"></div> | 
|         </div> | 
|   | 
|         <div class="form-group"> | 
|             <label class="col-sm-2 control-label">是否立即发布</label> | 
|             <div class="col-sm-3"> | 
|   | 
|                     <div th:if="${obj ne null }" class="checkbox checkbox-inline"> | 
|   | 
|                         <input autocomplete="off"   th:if="${obj.isPublish eq '是' }"  checked   name="isPublish" type="radio" id="inlineCheckbox1" value="是"    > | 
|                         <input autocomplete="off"   th:if="${obj.isPublish eq '否' }"     name="isPublish" type="radio" id="inlineCheckbox1" value="是"    > | 
|                         <label for="inlineCheckbox1">是 </label>    | 
|   | 
|                         <input autocomplete="off"    th:if="${obj.isPublish eq '是' }"  name="isPublish" type="radio" id="inlineCheckbox2" value="否"> | 
|                         <input autocomplete="off"    th:if="${obj.isPublish eq '否' }" checked name="isPublish" type="radio" id="inlineCheckbox2" value="否"> | 
|                         <label for="inlineCheckbox2">否 </label> | 
|   | 
|   | 
|                     </div> | 
|   | 
|                     <div  th:if="${obj eq null }" class="checkbox checkbox-inline"> | 
|                         <input autocomplete="off"    name="isPublish" type="radio" id="inlineCheckbox1" value="是" checked> | 
|                         <label for="inlineCheckbox1">是 </label>    | 
|                         <input autocomplete="off"    name="isPublish" type="radio" id="inlineCheckbox2" value="否" > | 
|                         <label for="inlineCheckbox2">否 </label> | 
|                     </div> | 
|             </div> | 
|         </div> | 
|   | 
|   | 
|         <div class="form-group"> | 
|             <label class="col-sm-2 control-label">文章内容</label> | 
|             <div class="col-sm-8"> | 
|                 <script style="width: 100%; height: 500px" id="artcontent" name="content" | 
|                         type="text/plain" th:utext="${obj?.content}" ></script> | 
|             </div> | 
|             <div class="Validform_checktip"></div> | 
|         </div> | 
|   | 
|         <div class="form-group "> | 
|             <div class="col-sm-12 text-center"> | 
|                 <a href="javascript:;" onclick="myForm.submit()" | 
|                    class="btn btn-success radius">保存</a>     | 
|                 <button type="button" class="btn btn-danger radius" onclick="MTools.closeForm()">取消</button> | 
|             </div> | 
|         </div> | 
|     </form> | 
| </div> | 
|   | 
| <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> | 
| <script th:inline="javascript"> | 
|     var obj=[[${obj}]]; | 
|   | 
|     //百度编辑器 | 
|     var ue = {}; | 
|   | 
|     var myForm=MForm.initForm({ | 
|         invokeUrl:basePath+"/admin/article/addOrModify", | 
|         beforeSubmit:function(){ | 
|   | 
|         }, | 
|         afterSubmit:function(){ | 
|             parent.myGrid.serchData(); | 
|         }, | 
|     }); | 
|   | 
|     $(function() { | 
|         $(".select2").select2({'width':'100%'}); | 
|   | 
|         //初始化编辑器 | 
|         ue = UE.getEditor('artcontent'); | 
|   | 
|         initFunctionList(); | 
|     }); | 
|   | 
|     /** | 
|      * 初始化产品列表 | 
|      */ | 
|     function initFunctionList() { | 
|         $.AjaxProxy({ | 
|             a : false, | 
|             c : false | 
|         }).invoke(basePath+"/admin/articleType/queryAll", function(loj) { | 
|             $("#parentId").createSelectTree(loj.attr("result").rows, { | 
|                     append : true, | 
|                     value:"articleTypeName", | 
|                      defaultValue:obj?obj.typeId:'' | 
|   | 
|         }); | 
|         }); | 
|   | 
|     } | 
|   | 
|   | 
|   | 
|     function autoZy() { | 
|         var text = ue.getContentTxt(); | 
|         $("#zy-input").val(text.substring(0, 100)); | 
|     } | 
|     function cleanZy() { | 
|         $("#zy-input").val(""); | 
|     } | 
| </script> | 
| </body> | 
| </html> |