Browse Source

导师带徒 添加累计学习时长

jiangbiao 1 năm trước cách đây
mục cha
commit
7d04c93b21

+ 2 - 1
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsFlplanController.java

@@ -154,7 +154,8 @@ public class TTsFlplanController extends BaseController {
                     need.setPlanStatus(2L);
                 }
             }
-            return toAjax(tTsFlplanService.updateTTsFlplan(need));
+            tTsFlplanService.updateTTsFlplan(need);
+            return AjaxResult.success(need.getTimer());
         }
         return AjaxResult.error("当前登录用户非学习用户!");
     }

+ 2 - 1
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsFtplanController.java

@@ -153,7 +153,8 @@ public class TTsFtplanController extends BaseController {
                     need.setPlanStatus(2L);
                 }
             }
-            return toAjax(tTsFtplanService.updateTTsFtplan(need));
+            tTsFtplanService.updateTTsFtplan(need);
+            return AjaxResult.success(need.getTimer());
         }
         return AjaxResult.error("当前登录用户非学习用户!");
     }

+ 2 - 1
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsLjplanController.java

@@ -158,7 +158,8 @@ public class TTsLjplanController extends BaseController {
                     need.setPlanStatus(2L);
                 }
             }
-            return toAjax(tTsLjplanService.updateTTsLjplan(need));
+            tTsLjplanService.updateTTsLjplan(need);
+            return AjaxResult.success(need.getTimer());
         }
         return AjaxResult.error("当前登录用户非学习用户!");
     }

+ 2 - 1
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsYsplanController.java

@@ -154,7 +154,8 @@ public class TTsYsplanController extends BaseController {
                     need.setPlanStatus(2L);
                 }
             }
-            return toAjax(tTsYsplanService.updateTTsYsplan(need));
+            tTsYsplanService.updateTTsYsplan(need);
+            return AjaxResult.success(need.getTimer());
         }
         return AjaxResult.error("当前登录用户非学习用户!");
     }

+ 6 - 1
ui/src/views/training/bccnew/firstplan/index_student.vue

@@ -242,6 +242,9 @@
                v-dialogDrag :title="pdf.title"
                :visible.sync="pdf.open" width="1300px" height="800px" :center="true" append-to-body
                @close="handleClose">
+      <div style="margin-top: -60px;float: right;margin-right: 40px;">
+        <br/>累计学习时长:{{learnTime}} min
+      </div>
       <div style="margin-top: -30px">
         <iframe id="iFrame" class="iframe-html" :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"
                 v-if="ppt"></iframe>
@@ -349,6 +352,7 @@ export default {
   // components: { Editor },
   data() {
     return {
+      learnTime: null,
       // 报告附件参数
       doc: {
         file: "",
@@ -530,6 +534,7 @@ export default {
         this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
         this.loadingFlash = false
       }
+      this.learnTime = row.timer;
       let _this = this;
       timer = window.setInterval(function () {
         updateFirstLearnTime(row).then(res => {
@@ -552,7 +557,7 @@ export default {
         let item = this.firstplanList[i];
         console.log(item.id)
         if (item.id===row.id){
-          if (this.firstplanList[i-1].planStatus!==5){
+          if (this.firstplanList[i-1].planStatus!==5&&this.firstplanList[i-1].planStatus!==3){
             this.$alert('您必须完成上一项考试才可学习当前资料!', "注意", { dangerouslyUseHTMLString: true });
             return;
           }

+ 1 - 1
ui/src/views/training/bccnew/tsnew/index_s.vue

@@ -714,7 +714,7 @@ export default {
     },
     planList(row){
       const newId = row.newId
-      this.$router.push("/training/bccnew/trainingPlan/" + newId);
+      this.$router.push("/training/bccnew/trainingPlan_s/" + newId);
     },
     /** 新增按钮操作 */
     handleAdd() {

+ 14 - 1
ui/src/views/training/bccnew/tsnew/score_student.vue

@@ -116,6 +116,9 @@
                v-dialogDrag :title="pdf.title"
                :visible.sync="pdf.open" width="1300px" height="800px" :center="true" append-to-body
                @close="handleClose">
+      <div style="margin-top: -60px;float: right;margin-right: 40px;">
+        <br/>累计学习时长:{{learnTime}} min
+      </div>
       <div style="margin-top: -30px">
         <iframe id="iFrame" class="iframe-html" :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"
                 v-if="ppt"></iframe>
@@ -241,6 +244,7 @@ export default {
         data: {}
       },
       ppt: false,
+      learnTime: null,
       pdf: {
         title: '',
         pdfUrl: '',
@@ -411,25 +415,34 @@ export default {
         this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
 
       }
+      this.learnTime = row.timer;
       let _this = this;
       if (this.planType === 1) {
         timer = window.setInterval(function () {
           updateLjLearnTime(row).then(res => {
+            this.file.data.timer = res.data
+            this.learnTime+=res.data;
           })
         }, 60000);
       } else if (this.planType === 2) {
         timer = window.setInterval(function () {
           updateYsLearnTime(row).then(res => {
+            this.file.data.timer = res.data
+            this.learnTime+=res.data;
           })
         }, 60000);
       } else if (this.planType === 3) {
         timer = window.setInterval(function () {
           updateFlLearnTime(row).then(res => {
+            this.file.data.timer = res.data
+            this.learnTime+=res.data;
           })
         }, 60000);
       } else if (this.planType === 4) {
         timer = window.setInterval(function () {
           updateFtLearnTime(row).then(res => {
+            this.file.data.timer = res.data
+            this.learnTime+=res.data;
           })
         }, 60000);
       }
@@ -448,7 +461,7 @@ export default {
         let item = this.dsdtList[i];
         if (item.id === row.id) {
           if (row.id !== this.dsdtList[i - 1].id) {
-            if (this.dsdtList[i - 1].planStatus !== 5) {
+            if (this.dsdtList[i - 1].planStatus !== 5&&this.dsdtList[i - 1].planStatus !== 3) {
               this.$alert('您必须完成上一项考试才可学习当前资料!', "注意", {dangerouslyUseHTMLString: true});
               return;
             }