From 044d6079d4aefa7fb51c02866001ddfafee0083c Mon Sep 17 00:00:00 2001
From: zhanglipeng <chinazhanglipeng@qq.com>
Date: Sun, 26 Sep 2021 11:07:43 +0800
Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ruoyi-ui/src/router/index.js                      |  2 +-
 .../src/views/benyi_train/video_study/detail.vue  |  2 +-
 .../src/views/benyi_train/video_study/index.vue   | 15 ++++++++-------
 .../benyi/controller/ByTrainVideoController.java  |  8 ++++++--
 4 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js
index 88298ae74..546012855 100644
--- a/ruoyi-ui/src/router/index.js
+++ b/ruoyi-ui/src/router/index.js
@@ -257,7 +257,7 @@ export const constantRoutes = [
       {
         path: "study/detail/:id(\\d+)",
         component: () => import("@/views/benyi_train/video_study/detail"),
-        name: "Detail",
+        name: "VideoDetail",
         meta: {
           title: "培训视频详情",
           icon: ""
diff --git a/ruoyi-ui/src/views/benyi_train/video_study/detail.vue b/ruoyi-ui/src/views/benyi_train/video_study/detail.vue
index 725f7cbf9..cab326d20 100644
--- a/ruoyi-ui/src/views/benyi_train/video_study/detail.vue
+++ b/ruoyi-ui/src/views/benyi_train/video_study/detail.vue
@@ -68,7 +68,7 @@ import { getScoreByVideo, addScore } from "@/api/benyi_train/score";
 import { addFeedback } from "@/api/benyi_train/feedback";
 
 export default {
-  name: "detail",
+  name: "VideoDetail",
   data() {
     return {
       title: "",
diff --git a/ruoyi-ui/src/views/benyi_train/video_study/index.vue b/ruoyi-ui/src/views/benyi_train/video_study/index.vue
index 97b69c29f..3244269fa 100644
--- a/ruoyi-ui/src/views/benyi_train/video_study/index.vue
+++ b/ruoyi-ui/src/views/benyi_train/video_study/index.vue
@@ -133,7 +133,7 @@ import { listMoedata } from "@/api/system/moedata";
 import { downLoadVideoUrl } from "@/utils/zipdownload";
 
 export default {
-  name: "VideoStudy",
+  name: "Video_study",
   data() {
     return {
       // 遮罩层
@@ -176,16 +176,16 @@ export default {
   },
   created() {
     // this.getList();
-    listAllLecturer().then((response) => {
-      //console.log(response.lecturer);
-      this.lecturerOptions = response.lecturer;
-    });
+    // listAllLecturer().then((response) => {
+    //   //console.log(response.lecturer);
+    //   this.lecturerOptions = response.lecturer;
+    // });
     listMoedata(this.queryParams).then((response) => {
       //第一步转换数组
       this.optionTypes = this.handleTree(response.data, "id", "pid");
       //第二步移除children为0的数组,也就是将children为0 设置为undefined
       this.optionTypes = this.getTreeData(this.optionTypes);
-      console.log(this.optionTypes)
+      //console.log(this.optionTypes)
     });
   },
   mounted() {
@@ -193,6 +193,7 @@ export default {
   },
   methods: {
     changeType(btn) {
+      console.log(btn);
       this.type = btn.id;
       this.ancestors = '';
       this.handleQuery(btn);
@@ -263,7 +264,7 @@ export default {
       //   this.queryParams.type = ancestors;
       // }
       this.queryParams.type = [this.type, this.ancestors].join(',');
-      //console.log(this.queryParams.type);
+      console.log(this.queryParams.type);
       this.queryParams.pageNum = 1;
       this.getList();
     },
diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByTrainVideoController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByTrainVideoController.java
index 6449b641a..eaeac085f 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByTrainVideoController.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByTrainVideoController.java
@@ -55,7 +55,11 @@ public class ByTrainVideoController extends BaseController {
     public TableDataInfo list(ByTrainVideo byTrainVideo) {
         //判断type是否为空
         if (!schoolCommon.isStringEmpty(byTrainVideo.getType())) {
-            byTrainVideo.setType(byTrainVideo.getType() + ",");
+            if (byTrainVideo.getType().endsWith(",")) {
+                System.out.println("最后一位是,");
+            } else {
+                byTrainVideo.setType(byTrainVideo.getType() + ",");
+            }
         }
         startPage();
         List<ByTrainVideo> list = byTrainVideoService.selectByTrainVideoList(byTrainVideo);
@@ -77,7 +81,7 @@ public class ByTrainVideoController extends BaseController {
     @GetMapping("/listscoreandfree/{id}")
     public TableDataInfo listscoreandfree(@PathVariable("id") Long id) {
         startPage();
-        ByTrainVideoScore byTrainVideoScore=new ByTrainVideoScore();
+        ByTrainVideoScore byTrainVideoScore = new ByTrainVideoScore();
         byTrainVideoScore.setVideoid(id);
         List<ByTrainVideoScore> list = byTrainVideoScoreService.selectByTrainVideoScoreList(byTrainVideoScore);
         return getDataTable(list);