Explorar el Código

学习时长不超过设定时间

wangggziwen hace 9 meses
padre
commit
4a94f11220
Se han modificado 1 ficheros con 9 adiciones y 5 borrados
  1. 9 5
      ruoyi-ui/src/views/branch/xxyd/mystudy/index.vue

+ 9 - 5
ruoyi-ui/src/views/branch/xxyd/mystudy/index.vue

@@ -221,11 +221,15 @@ export default {
       let _this = this;
 
       timer = window.setInterval(function() {
-        updateLearningTimeStudied(row).then(response => {
-          _this.learning.learningTimeStudied = response.data.learningTimeStudied;
-          _this.learning.learningProgress = response.data.learningProgress;
-          _this.$forceUpdate();
-        });
+        // 累计学习时长<规定学习时长
+        if (row.learningTimeStudied < row.learningTimeRequired) {
+          // 累计时间
+          updateLearningTimeStudied(row).then(response => {
+            _this.learning.learningTimeStudied = response.data.learningTimeStudied;
+            _this.learning.learningProgress = response.data.learningProgress;
+            _this.$forceUpdate();
+          });
+        }
       }, 60000);
     },
     // 状态字典翻译