Pārlūkot izejas kodu

Merge branch 'master' of http://124.70.43.205:3000/GYEE_R.D/exam

chenminghua 2 gadi atpakaļ
vecāks
revīzija
74fc8fe2ed

+ 32 - 1
exam-06173-api/src/main/java/com/gyee/exam/modules/course/dto/CourseDTO.java

@@ -12,6 +12,8 @@ import org.springframework.web.util.HtmlUtils;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
 * <p>
@@ -190,7 +192,36 @@ public class CourseDTO implements Serializable {
         if(StringUtils.isBlank(this.content)){
             return this.title;
         }
-        return HtmlUtils.htmlEscapeHex(this.content);
+//        return HtmlUtils.htmlEscapeHex(this.content);
+
+        return replaceHtml(this.content);
     }
 
+
+
+    /**
+     * 去除字符串中的html标签.
+     * <p>
+     * <pre>
+     * StringUtils.replaceHtml(null)  = ""
+     * StringUtils.replaceHtml("")    = ""
+     * StringUtils.replaceHtml("<td>content</td>") = "content"
+     * StringUtils.replaceHtml("<>content</td>") = ""
+     * </pre>
+     *
+     * @param html 要处理的字符串,可以为 null
+     * @return String
+     *
+     */
+    public static String replaceHtml(String html) {
+        if (StringUtils.isBlank(html)) {
+            return StringUtils.EMPTY;
+        }
+        String regEx = "<.+?>";
+        Pattern p = Pattern.compile(regEx);
+        Matcher m = p.matcher(html);
+        String s = m.replaceAll(StringUtils.EMPTY);
+        s = s.replaceAll("<[^>]*>", "");
+        return s;
+    }
 }

+ 8 - 1
exam-06173-api/src/main/java/com/gyee/exam/modules/exam/service/impl/ExamServiceImpl.java

@@ -34,6 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -72,10 +73,16 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements Ex
     @Autowired
     private StatCourseService statCourseService;
 
+    @Autowired
+    private HttpServletRequest request;
+
+
     @Override
     public void save(ExamSaveReqDTO reqDTO) {
 
-        if (!reqDTO.getCreateBy().equals(reqDTO.getUpdateBy())){
+        // 从token中获得用户ID
+        String userId = UserUtils.getUserId(false);
+        if (!reqDTO.getCreateBy().equals(userId)){
             throw new ServiceException("非创建人不允许修改");
         }
 

+ 1 - 1
exam-06173-api/src/main/resources/mapper/course/CourseMapper.xml

@@ -90,7 +90,7 @@
 
     <select id="userPaging" resultMap="UserCourseResultMap">
         SELECT
-        cs.id,cs.title,cs.cover,cs.cat_id,cs.periods,cs.is_must,cs.is_pay,cs.price,
+        cs.id,cs.title,cs.content,cs.cover,cs.cat_id,cs.periods,cs.is_must,cs.is_pay,cs.price,
                (SELECT COUNT(0) FROM el_course_live WHERE course_id=cs.id) AS liveCount,
                cl.update_time,cl.learn_file,cl.total_file,cl.state
         FROM el_course cs

+ 1 - 1
exam-06173-uni - reg/pages/course/detail.vue

@@ -82,7 +82,7 @@
 					</view>
 					
 					<view v-if="current === 1">
-						<rich-text :nodes="courseData.content | formatRichText"></rich-text>
+						<!-- <rich-text :nodes="courseData.content | formatRichText"></rich-text> -->
 						<u-parse :content="courseData.content | formatRichText" @preview="preview" @navigate="navigate" ></u-parse>
 					</view>
 				</view>

+ 1 - 1
exam-06173-uni/pages/course/detail.vue

@@ -82,7 +82,7 @@
 					</view>
 					
 					<view v-if="current === 1">
-						<rich-text :nodes="courseData.content | formatRichText"></rich-text>
+						<!-- <rich-text :nodes="courseData.content | formatRichText"></rich-text> -->
 						<u-parse :content="courseData.content | formatRichText" @preview="preview" @navigate="navigate" ></u-parse>
 					</view>
 				</view>

+ 3 - 0
exam-06173-vue/src/components/Tinymce/index.vue

@@ -151,6 +151,9 @@ export default {
     getContent() {
       window.tinymce.get(this.tinymceId).getContent()
     },
+    getTextContent() {
+      return window.tinymce.get(this.tinymceId).getContent( { format : 'text' } );
+    },
     imageSuccessCBK(arr) {
       const that = this
       arr.forEach(v => {

+ 23 - 3
exam-06173-vue/src/views/admin/stat/total/archives.vue

@@ -193,13 +193,15 @@ export default {
       zgTableData: [],
       selectDeptCode: "",
       selectDeptName: "",
-      tableHeight: 280,
+      myChart: null,
+      tableHeight: (window.innerHeight - 657) <= 280 ? 280 : window.innerHeight - 657
     };
   },
 
   mounted() {
     this.resetDate(this.radio);
     window.addEventListener('resize', () => {
+      this.myChart.resize()
       this.tableHeight = (window.innerHeight - 657) <= 280 ? 280 : window.innerHeight - 657
     })
   },
@@ -278,14 +280,22 @@ export default {
     // 初始化图表
     initChart(xAxisData, seriesData) {
       let myChart = echarts.init(document.getElementById("chartDom"));
+      this.myChart = myChart
       let option;
 
       option = {
+        title: {
+          showTitle: true,
+          subtext: "可滚轮缩放、左右拖动查看",
+          x: "center",
+          y: "20",
+        },
         xAxis: {
           type: "category",
           data: xAxisData,
         },
         yAxis: {
+          name: '单位 (%)',
           type: "value",
         },
         legend: {
@@ -315,10 +325,20 @@ export default {
         grid: {
           show: true,
           left: "35",
-          top: "23",
+          // top: "23",
           right: "30",
           bottom: "23",
         },
+        dataZoom: [
+          {
+            id: "dataZoomX",
+            type: "inside",
+            xAxisIndex: [0],
+            filterMode: "none",
+            start: 0,
+            end: 50,
+          },
+        ],
         series: [
           {
             name: "部门培训率",
@@ -382,7 +402,7 @@ export default {
         nowDate.setDate(0)
         const day = nowDate.getDate()
         this.date = [
-          nowDate.formatDate("yyyy")+ `-${(minMonth < 10 ? "0" + minMonth : maxMonth)}-01`,
+          nowDate.formatDate("yyyy")+ `-${(minMonth < 10 ? "0" + minMonth : minMonth)}-01`,
             nowDate.formatDate("yyyy") +
             `-${(maxMonth < 10 ? "0" + maxMonth : maxMonth)}-${day}`,
         ];

+ 3 - 1
exam-06173-vue/src/views/dashboard/index.vue

@@ -34,7 +34,7 @@
           <img src="@/assets/dash/stzs.png" />
         </div>
         <div class="r">
-          <span class="statisticsTitle">课总数</span>
+          <span class="statisticsTitle">课总数</span>
           <span class="statisticsNum">{{ coursenum }}</span>
         </div>
       </el-card>
@@ -405,6 +405,7 @@ export default {
           },
           yAxis: {
             type: "value",
+            name: tabActive === 'bm' ? '单位 (个)' : '单位 (分钟)',
             minInterval: 1,
           },
           tooltip: {
@@ -484,6 +485,7 @@ export default {
             },
           },
           yAxis: {
+            name: '单位 (%)',
             type: "value",
           },
           tooltip: {