Xiao_Mo преди 4 години
родител
ревизия
b3317d5384
променени са 1 файла, в които са добавени 24 реда и са изтрити 1 реда
  1. 24 1
      src/views/teamDetail/teamCourseList.vue

+ 24 - 1
src/views/teamDetail/teamCourseList.vue

@@ -633,7 +633,7 @@ const initSearch = {
   organIdList: null,
   courseStatus: null,
   courseType: null,
-  timer: [nowTime, nowTime], // 时间
+  timer: [], // 时间
   class: null,
   teachType: null,
   mergeCourseType: null,
@@ -698,6 +698,29 @@ export default {
     },
   },
   mounted() {
+    const { query } = this.$route
+    if (query.start || query.end) {
+      this.searchForm.timer = [query.start, query.end]
+    } else {
+      let flag = false
+      for(let item in this.searchForm){
+        if(typeof this.searchForm[item] == 'object'){
+          // 对象或者数组
+          if(this.searchForm[item]?.length <=0){
+            flag = true
+          }
+        }else{
+          if (!this.searchForm[item]){
+            flag = true
+          }
+        }
+      }
+      if(flag)return
+      this.searchForm.timer = [nowTime, nowTime]
+    }
+    if (query.organId) {
+      this.searchForm.organIdList = Number(query.organId)
+    }
     this.$store.dispatch("setBranchs");
     this.$store.dispatch("setTeachers");
     this.$store.dispatch("setSchools");