Sfoglia il codice sorgente

fix(course): 为特定org添加定时拉取课程数据的功能

新增getCourse2方法用于调用新接口获取课程数据,并在org匹配指定值时每10秒自动调用该接口更新课程列表
lsc 2 ore fa
parent
commit
49f2747dbd
1 ha cambiato i file con 36 aggiunte e 0 eliminazioni
  1. 36 0
      src/components/pages/course.vue

+ 36 - 0
src/components/pages/course.vue

@@ -1271,6 +1271,37 @@ export default {
           console.error(err);
         });
     },
+    getCourse2() {
+      console.log("typea", this.typea);
+      // this.isLoading = true;
+      let params = {
+        type: this.groupA,
+        uid: this.userid,
+        oid: this.oid,
+        org: this.org,
+        typea: this.typea != undefined ? this.typea : "",
+        typeb: this.typeb != undefined ? this.typeb : "",
+        typec: "",
+        typed: this.typed != undefined ? this.typed : "",
+        typeE: this.typeE.join(","),
+        cu: "",
+        cn: this.courseName,
+        page: this.page,
+        pageSize: this.pageSize,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectCourseNew2", params)
+        .then((res) => {
+          // this.loading.close();
+          // this.loading = "";
+          // this.isLoading = false;
+          this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
+          this.course = res.data[0];
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
     getTypeName() {
       this.$forceUpdate();
       this.page = 1;
@@ -1607,6 +1638,11 @@ export default {
     window.setCourseUrl = function(){
       _this.courseUrl = ''
     }
+    if(this.org && this.org == '3d2d45b1-703b-11f1-9985-005056924926'){
+      setInterval(() => {
+        this.getCourse2()
+      }, 10000);
+    }
   }
 };
 </script>