| <!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" /> | 
|     <link th:href="@{/plugin/bootstrap-fileinput/css/fileinput.css}" | 
|           media="all" rel="stylesheet" type="text/css"/> | 
| <!-- 本框架基本脚本和样式 --> | 
| <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" | 
|             th:src="@{/js/function/public.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 th:src="@{/plugin/bootstrap-fileinput/js/fileinput.js}" | 
|             type="text/javascript"></script> | 
|     <script th:src="@{/plugin/bootstrap-fileinput/js/locales/zh.js}" | 
|             type="text/javascript"></script> | 
| </head> | 
| <body> | 
| <div class="ibox-content"> | 
|         <form class="form-horizontal" id="dataform" onsubmit="javascript:return false;"> | 
|             <input autocomplete="off"   type="hidden" name="tokenUrl" th:value="${tokenUrl}"> | 
|             <input autocomplete="off"   type="hidden" name="token" th:value="${token}"> | 
|             <input autocomplete="off"   type="hidden" name="artId" th:value="${obj.artId}"> | 
|         <div class="form-group"> | 
|             <label class="col-sm-2 control-label">文章标题 | 
|             <span class="text-danger">*</span> | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="artTitle" | 
|                         maxLength="100" dataType="s1-100" | 
|                     th:value="${obj.artTitle}"nullmsg="文章标题不能为空"> | 
|             </div> | 
|   | 
|             <label class="col-sm-2 control-label">是否立即发布 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <select th:field="${obj.artReleasestatus}" class="form-control select2 " size="1" name="artReleasestatus" | 
|                         id="parentId" style="width: 100%"> | 
|                     <option value="1" th:selected="${obj.artReleasestatus == '1'}">是</option> | 
|                     <option value="2" th:selected="${obj.artReleasestatus == '2'}">否</option> | 
|                     </option> | 
|   | 
|                 </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"> | 
|                     <select class="form-control select2 " size="1" name="artypeId" | 
|                             id="artypeId" style="width: 100%"> | 
|                     </select> | 
|                 </div> | 
|   | 
|             <label class="col-sm-2 control-label">作者名称 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="artAuthor" | 
|                         maxLength="100" dataType="s1-100" | 
|                     ignore="ignore" | 
|                     th:value="${obj.artAuthor}"nullmsg="作者名称不能为空"> | 
|             </div> | 
|         </div> | 
|         <div class="form-group"> | 
|             <label class="col-sm-2 control-label">访问量 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="artVisitstimes" | 
|                        dataType="/^\d*\.?\d+$/" | 
|                        errormsg="仅支持数字" | 
|                        ignore="ignore" | 
|                     th:value="${obj.artVisitstimes}"nullmsg="访问量不能为空"> | 
|             </div> | 
|             <label class="col-sm-2 control-label">标签 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="text" class="form-control" name="artLabel" | 
|                         maxLength="100" dataType="s1-100" | 
|                     ignore="ignore" | 
|                     th:value="${obj.artLabel}"nullmsg="标签不能为空"> | 
|             </div> | 
|         </div> | 
|         <div class="form-group"> | 
|             <label class="col-sm-2 control-label">排序 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="number" class="form-control" name="artSort" | 
|                        maxLength="30" | 
|                        th:value="${obj.artSort}" > | 
|             </div> | 
|   | 
|             <label class="col-sm-2 control-label">文章时间 | 
|             </label> | 
|             <div class="col-sm-4"> | 
|                 <input autocomplete="off"   type="text" class="form-control datetimepicker" name="artReleasedate" | 
|                         maxLength="50" | 
|                     ignore="ignore" | 
|                     th:value="${obj.artReleasedate}"nullmsg="文章时间不能为空"> | 
|             </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="container" | 
|                             name="artContent" type="text/plain" > | 
|   | 
|                     </script> | 
|                 </div> | 
|             </div> | 
|   | 
|                 <div class="form-group"> | 
|                     <label class="col-sm-2 control-label">文章预览图 | 
|                     </label> | 
|                     <div class="col-sm-10"> | 
|                     <input autocomplete="off"   value="" name="artImgurl" id="artImgurl" | 
|                         class="form-control  upload-input" type="text" /> <a style="width: 10%" | 
|                         class="btn btn-primary radius upload-a">选择图片 | 
|                     </a> | 
|                     </div> | 
|   | 
|                 </div> | 
|                         <div class="form-group" id="showImgUrl"> | 
|                         <label class="col-sm-2 control-label"> | 
|   | 
|                         </label> | 
|                         <div class="col-sm-10"> | 
|                         <img id="imgUrlDiv"  style="width: 50%"/> | 
|                         </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 type="text/javascript" th:src="@{/js/systools/MTools.js}"></script> | 
| <script th:inline="javascript"> | 
|     var invokeUrl = basePath + "/admin/multipleUploadFile/doUpload"; | 
|     MUI.initImgUpload(".upload-input"); | 
|     $('#file-zh').fileinput({ | 
|         language: 'zh', | 
|         uploadUrl: invokeUrl, | 
|         allowedFileExtensions: ['jpg', 'png', 'gif'], | 
|         maxFileCount: 1, | 
|         // minImageWidth: 50, //图片的最小宽度 | 
|         // minImageHeight: 50,//图片的最小高度 | 
|         // maxImageWidth: 100,//图片的最大宽度 | 
|         // maxImageHeight: 100,//图片的最大高度 | 
|     }).on("fileuploaded", function (event, data, previewId, index) { | 
|         $('input[name=artImgurl]').val(data.response.path) | 
|     }); | 
|   | 
|   | 
|     MTools.autoFullSelect(); | 
|   | 
|   | 
|     //下拉获取上级部门 | 
|     $(".select2").select2(); | 
|     var myForm = null; | 
|   | 
|     $(function() { | 
|         $("#container").html(obj.artContent); | 
|         MTools.ininDatetimepicker("#artReleasedate"); | 
|     }); | 
|   | 
|     /*<![CDATA[*/ | 
|     var obj=/*[[${obj}]]*/      | 
|     /*]]>*/ | 
|      | 
|     var invokeUrl=basePath+"/admin/shopArticle/addShopArticle"; | 
|     if(obj.artId!=null){ | 
|        invokeUrl = basePath+"/admin/shopArticle/modifyShopArticle"; | 
|         if (obj.artImgurl) { | 
|             /*var html = '<img src="' + obj.imgUrl + '"/>' | 
|             $('#imgUrlDiv').html(html)*/ | 
|             $('#imgUrlDiv').attr("src",obj.artImgurl); | 
|         } | 
|     } | 
|     var myForm=MForm.initForm({ | 
|         invokeUrl:invokeUrl, | 
|         afterSubmit:function(){ | 
|             parent.myGrid.serchData(); | 
|         }, | 
|     }); | 
|     if(obj.artypeId!=null){ | 
|         //console.log(obj.suDeptId); | 
|         initArticleTypeSelected(obj.artypeId); | 
|     }else{ | 
|         initArticleTypeSelected(); | 
|     } | 
|     /** | 
|      * 初始化文章类型列表 | 
|      */ | 
|     function initArticleTypeSelected(id) { | 
|         $.AjaxProxy().invoke(basePath+"/admin/shopArticleType/all", | 
|                 function(loj) { | 
|                     $("#artypeId").createSelectTree( | 
|                             loj.attr("result").rows, | 
|                             {    id : "artypeId",        // 选项的值 | 
|                                 parent : "artypeParentid",    // 父节点值 | 
|                                 value : "artypeName",    // 要显示的名称 | 
|                                 append : false, | 
|                                 defaultValue : id, | 
|                                 defaultHtml : '<option value="" >一级文章类别</option>' | 
|                             }); | 
|                 }); | 
|   | 
|     } | 
|   | 
|     var editor = null; | 
|     editor = UE.getEditor('container'); | 
| </script> | 
| </body> | 
| </html> |