limeng 2 năm trước cách đây
mục cha
commit
00fd2f80d0
1 tập tin đã thay đổi với 48 bổ sung75 xóa
  1. 48 75
      src/main/resources/templates/cms/content_input.html

+ 48 - 75
src/main/resources/templates/cms/content_input.html

@@ -29,15 +29,12 @@
             $('#j_custom_span_pic').html('<img src="'+ json.filename +'"  style="margin: 10px 0 0 0" WIDTH="200" HEIGHT="120"/>')
         }
     }
-    /*保存发布*/
     function content_save_post(){
-        $('#categoryId').removeAttr("disabled");
+
         $("#status").val("1");
     }
-    /*暂存草稿*/
     function content_save(){
-        $('#categoryId').removeAttr("disabled");
-        $("#j_model_form").attr("action","${ctxPath}/system/cms/content/draft");
+
         $("#status").val("0");
     }
     function CKEditorup(){
@@ -46,6 +43,21 @@
         //FormatText(htm);
         formatText(editor,2,'SimSun','16');
     }
+
+
+    $('#tags').on('aftercreated.bjui.tags', function(e, data) {
+        // let value = data.value;// 当前创建的标签值
+        // let item  = data.item;// 当具前选定项的值(object,体值由选定项的值(object,体值由返回JSON决定)
+        let tags  =// 所有已生成标签的值,以英文逗号(,)分隔
+            $("tag").val(data.tags);
+
+    })
+
+
+
+
+
+
 </script>
 @if(isWindow=="NO"){
 <div class="bjui-pageHeader">
@@ -71,59 +83,41 @@
         <input type="hidden" name="tableName" value="${model.tableName!}" >
         <input TYPE="hidden" id="status" name="status" >
         <input type="hidden" id="content_top" value="${content.TOP!0}" >
-        <input type="hidden" id="content_recommend" value="${content.RECOMMEND!0}" >
-        <script>
-            var id = '${category.categoryId!}';
-            if(id=='220'){
-
-                $(".tc").attr("style","display:none;");
-
-            }
-        </script>
-
-        <div  class="form-group tc">
+        <div class="form-group">
             <label for="j_title" class="control-label x85">标题:</label>
-            <input type="text" name="title" id="j_title" class="input-nm measure-input" value="${content.TITLE!,xss}"   placeholder="请填写标题" size="50"    >
-
+            <input type="text" name="title" id="j_title" class="input-nm measure-input" value="${content.TITLE!,xss}"   placeholder="请填写标题" size="50" data-rule="required;length(1~128)" >
         </div>
-        <hr class="tc" style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
-        <div class="form-group tc">
+        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
+        <div class="form-group">
             <label for="j_keyword" class="control-label x85">关键字:</label>
-            <input type="text" name="keywords" id="j_keyword"  class="input-nm"  value="${content.KEYWORDS!,xss}"   placeholder="关键字请用逗号,隔开" size="50"  >
+            <input type="text" name="keywords" id="j_keyword"  class="input-nm"  value="${content.KEYWORDS!,xss}"   placeholder="关键字请用逗号,隔开" size="50">
         </div>
-
-        <hr class="tc" style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
+        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
         <div class="form-group tc">
             <label for="j_inputdate" class="control-label x85">日期:</label>
             <input style="width:225px;margin-left:0px" name="inputdate"  id="j_inputdate" data-rule="required;" value="${content.INPUTDATE!,xss}" class="laydate-icon timeUstyle stateUTime"
                    onclick="laydate({istime: true,format:'YYYY-MM-DD hh:mm:ss'})"/>
         </div>
-
-        <hr class="tc" style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
-        <div class="form-group tc">
+        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
+        <div class="form-group">
             <label for="j_des" class="control-label x85">描述:</label>
-            <textarea id="j_des" name="description"  placeholder="请填写文章描述"  cols="50">${content.DESCRIPTION!,xss}</textarea>
+            <textarea id="j_des" name="description" placeholder="请填写文章描述"  cols="50">${content.DESCRIPTION!,xss}</textarea>
         </div>
-
-
-
-
-        <hr class="tc" style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
-        <div class="form-group tc">
+        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
+        <div class="form-group">
             <label for="categoryId" class="control-label x85">栏目:</label>
-            <select id="categoryId"  data-toggle="selectpicker"  class="input-nm"  disabled   name="categoryId">
+            <select id="categoryId"  data-toggle="selectpicker"  class="input-nm"  readonly="readonly"   name="categoryId">
                 ${ContentSelectCategoryFunction(session.SysUser.siteId!0,category.categoryId!0)}
             </select>
         </div>
-
-        <hr class="tc" style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
-        <div class="form-group tc">
+        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
+        <div class="form-group">
 
             <label class="control-label x85">封面图片:</label>
             <div style="display: inline-block; vertical-align: middle;">
                 <div id="j_content_thumb" data-toggle="upload" data-uploader="${ctxPath}/uploads"
                      data-file-size-limit="1024000000"
-                     data-file-type-exts="*.jpg;*.png;*.gif;*.mpg;*.JPEG"
+                     data-file-type-exts="*.jpg;*.png;*.gif;*.mpg"
                      data-multi="false"
                      data-on-upload-success="thumb_upload_success"
                      data-icon="cloud-upload"></div>
@@ -135,33 +129,28 @@
                 </span>
             </div>
         </div>
-        <hr class="tc" style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
+        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
         <div class="form-group tc">
             <label for="j_url" class="control-label x85">外部链接:</label>
             <input type="text" name="url" id="j_url"  value="${content.URL!,xss}"  class="input-nm"   placeholder="如果填写为外部链接,则文章链接以外部链接为准" size="50">
         </div>
-        <hr class="tc" style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
+        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
         <div  class="form-group tc">
             <label  class="control-label x85">推荐顶置:</label>
-            <input type="checkbox"  id="recommend" name="recommend"  data-toggle="icheck" data-label="推荐">
-            <input type="checkbox"  id="top" name="top" data-toggle="icheck" data-label="顶置">
+            <input type="checkbox"  id="recommend" name="recommend" data-toggle="icheck" data-label="推荐" ${(isNotEmpty(content.RECOMMEND)&&content.RECOMMEND==1)?'checked':''}>
+            <input type="checkbox"  id="top" name="top" data-toggle="icheck" data-label="顶置" ${(isNotEmpty(content.TOP)&&content.TOP==1)?'checked':''}>
         </div>
-        <hr class="tc" style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
-        <div class="form-group tc">
+        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
+        <div class="form-group">
             <label for="j_viewnum" class="control-label x85">浏览次数:</label>
             <input type="text" name="viewNum" id="j_viewnum"  class="input-nm"   placeholder="浏览量" value="${content.VIEWNUM!0}"  size="20" data-rule="required;integer(+0)" >
         </div>
-        <hr class="tc" style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
-        <div class="form-group tc">
-            <label for="j_author" class="control-label x85">作者:</label>
-            <input type="text" name="author" id="j_author"  class="input-nm"   placeholder="文章作者" value="${content.AUTHOR!session.SysUser.username}"  size="20" data-rule="required;" >
-        </div>
-        <hr class="tc" style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
+        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
         <div class="form-group">
-            <label for="j_sorts" class="control-label x85">排序:</label>
-            <input type="text" name="sorts"  id="j_sorts"  size="20"
-                   value="${content.SORTS!999}"  data-rule="integer;"  placeholder="排序">
+            <label for="j_author" class="control-label x85">作者:</label>
+            <input type="text" name="author" id="j_author"  class="input-nm"   placeholder="文章作者" value="${isEmpty(content.AUTHOR)?session.SysUser.username:content.AUTHOR!,xss}"  size="20" data-rule="required;" >
         </div>
+
         @for(filed in modelFiled){
         <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
         <div class="form-group">
@@ -182,9 +171,7 @@
             @t=t+"\"";
             @}
             <label for="${filed.filedName!}" class="control-label x85">${filed.alias}:</label>
-            <input type='text' name='${filed.filedName!}' id='${filed.filedName!}' class='input-nm'
-                   placeholder='${filed.alias!}'
-                   value='${(!has(content)?filed.filedValue!:content[filed.filedName]!),xss}' size='50' ${t!}>
+            <input type='text' name='${filed.filedName!}' id='${filed.filedName!}'  class='input-nm'   placeholder='${filed.alias!}' value='${(!has(content)?filed.filedValue!:content[filed.filedName]!),xss}'  size='50' ${t!}>
             @}
 
             @if(filed.filedClass=="image"){
@@ -194,7 +181,7 @@
             <input type="file" class="form-control" data-name="${filed.filedName!}"   data-toggle="webuploader" data-options="
                         {
                             pick: {label: '点击选择图片'},
-                            server: '${ctxPath}/uploads',
+                            server: '${ctxPath}/upload',
                             fileNumLimit: 20,
                             formData: {dir:'${filed.filedName!}'},
                             required: true,
@@ -202,8 +189,8 @@
                             basePath: '',
                             accept: {
                                 title: '图片',
-                                extensions: 'jpg,JPG,jpeg,JPEG,png,gif,pdf,doc,txt,xls,xlsx,docx',
-                                mimeTypes: '.jpg,.JPG,.jpeg,.JPEG,.png,gif,.pdf,.doc,.txt,.xls,.xlsx,.docx'
+                                extensions: 'jpg,JPG,jpeg,JPEG,png,gif',
+                                mimeTypes: '.jpg,.JPG,.jpeg,.png,gif'
                             }
                         }"
             >
@@ -234,7 +221,7 @@
                 @}
                 <div id="${filed.filedName!}" data-toggle="upload" data-uploader="${ctxPath}/uploads"
                      data-file-size-limit="1024000000"
-                     data-file-type-exts="${isNotEmpty(str)?strutil.subStringTo(str,0,strutil.length(str)-1):'*.jpg;*.png;*.gif;*.mpg;*.docx;*.doc;*.xls;*.mp4;*.JPEG;*.pdf'}"
+                     data-file-type-exts="${isNotEmpty(str)?strutil.subStringTo(str,0,strutil.length(str)-1):'*.jpg;*.png;*.gif;*.mpg;*.docx;*.doc;*.xls;*.xlsx'}"
                      data-multi="false"
                      data-on-upload-success="${filed.filedName!}_upload_success"
                      data-icon="cloud-upload"></div>
@@ -246,7 +233,7 @@
 
             @if(filed.filedClass=="editor"){
             <!--判断是否为文本编辑器-->
-            <textarea  data-toggle="CKEditor"  id="autoformat" data-upload="${ctxPath}/uploads/CKEditorUpload"   style="height:650px;max-height:750px;margin:10px 0 0 0" name="${filed.filedName!}"}>${(has(content)?content[filed.filedName]:filed.filedValue),xss="escape"}</textarea>
+            <textarea  data-toggle="CKEditor" id="autoformat" data-upload="${ctxPath}/upload/CKEditorUpload"   style="height:650px;max-height:750px;margin:10px 0 0 0" name="${filed.filedName!}"  ${filed.notNull?'data-rule=\"required;\"':''}>${(has(content)?content[filed.filedName]:filed.filedValue),xss="escape"}</textarea>
             <input type="button" value="一键排版" onclick="CKEditorup()"/>
             @}
 
@@ -322,20 +309,6 @@
 <div class="bjui-pageFooter">
     <ul>
         <li><button onclick="content_save()" type="submit" class="btn btn-blue" data-icon="pencil">暂存草稿</button></li>
-        @if(shiro.hasPermission("content:save")){
         <li><button onclick="content_save_post()" type="submit" class="btn btn-green" data-icon="send">保存发布</button></li>
-        @}
     </ul>
-    <script>
-        $(function(){
-            var top = $("#content_top").val();
-            var recommend = $("#content_recommend").val();
-            if(top == 1){
-                $("#top").attr("checked","true");
-            }
-            if(recommend == 1){
-                $("#recommend").attr("checked","true");
-            }
-        });
-    </script>
 </div>