Przeglądaj źródła

活动回顾视频编辑bug修复

wangjiang988 5 lat temu
rodzic
commit
66a675c802

+ 0 - 1
src/main/java/platform/modules/government/web/ActivityReviewController.java

@@ -131,7 +131,6 @@ public class ActivityReviewController extends BaseController{
     @PostMapping("/update")
     @ResponseBody
     public Object updateReview(ActivityReview review){
-        review.setHas_video(review.getVideoDown() != null );
         // ###**************
         // ### 保存视频 wangjiang
         Boolean hasVideo = review.getHas_video();

+ 8 - 3
src/main/resources/templates/admin/government/activity_review/edit.html

@@ -18,7 +18,7 @@
 <body layout:fragment="content">
 
 <article class="page-container">
-    <form class="form form-horizontal" id="form-review-add">
+    <form class="form form-horizontal" id="form-review-add" enctype="multipart/form-data">
         <div class="row cl">
             <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>关联活动:</label>
             <div class="formControls col-xs-8 col-sm-7">
@@ -83,8 +83,9 @@
         <div class="row cl">
             <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>内容:</label>
             <div class="formControls col-xs-8 col-sm-9">
-                <textarea id="content" name="content" th:value="${review.content}"></textarea>
+                <textarea id="content" name="content" th:name="content"  th:utext="*{review.content}"></textarea>
             </div>
+            <!--[[${review?.content}]]-->
         </div>
         <input type="hidden" id="isPush">
         <div class="row cl">
@@ -122,7 +123,8 @@
             width: "750px",
             height: "350px",
             items: array,
-            syncType: "auto",
+            syncType: "form",
+            // syncType: "auto",
             afterBlur: function () {
                 this.sync();
             }
@@ -246,6 +248,7 @@
     }
 
     function submit(status) {
+        debugger
         var activity_title = $("#activity_title").val();
         console.log(activity_title);
         if (activity_title == ''){
@@ -260,10 +263,12 @@
         }
         var content = $("#content").val();
         console.log(content);
+        content = editor.html();
         if (content.replace(/\s+/g,"") == ''){
             errorMessage("内容不能为空");
             return;
         }
+        $("#content").val(content);
         $("#form-review-add").ajaxSubmit({
             type: 'post',
             url: pagePath + "/activity/review/update",