Explorar el Código

feat: 去掉查询的默认条件

caoliqin hace 4 días
padre
commit
e585fd5f79

+ 9 - 9
src/views/course/courseWatchLog/qw/statistics.vue

@@ -125,11 +125,11 @@ export default {
     };
   },
   created() {
-    // 设置默认时间范围为最近7天
-    this.createTime = getDateRange(7);
-    // 设置查询参数的时间
-    this.queryParams.sTime = this.createTime[0];
-    this.queryParams.eTime = this.createTime[1];
+    // // 设置默认时间范围为最近7天
+    // this.createTime = getDateRange(7);
+    // // 设置查询参数的时间
+    // this.queryParams.sTime = this.createTime[0];
+    // this.queryParams.eTime = this.createTime[1];
 
     courseList().then(response => {
       this.courseLists = response.list;
@@ -170,10 +170,6 @@ export default {
     },
     /** 查询短链课程看课记录列表 */
     getList() {
-      if (!this.queryParams.sTime || !this.queryParams.eTime) {
-        this.$message.warning("请选择创建时间");
-        return;
-      }
       this.loading = true;
       statisticsList(this.queryParams).then(response => {
         this.courseWatchLogList = response.rows;
@@ -206,6 +202,10 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+      if (!this.queryParams.sTime || !this.queryParams.eTime) {
+        this.$message.warning("请选择创建时间");
+        return;
+      }
       this.queryParams.pageNum = 1;
       this.getList();
     },

+ 9 - 9
src/views/course/courseWatchLog/statistics.vue

@@ -127,11 +127,11 @@ export default {
     };
   },
   created() {
-    // 设置默认时间范围为最近7天
-    this.createTime = getDateRange(7);
-    // 设置查询参数的时间
-    this.queryParams.sTime = this.createTime[0];
-    this.queryParams.eTime = this.createTime[1];
+    // // 设置默认时间范围为最近7天
+    // this.createTime = getDateRange(7);
+    // // 设置查询参数的时间
+    // this.queryParams.sTime = this.createTime[0];
+    // this.queryParams.eTime = this.createTime[1];
 
     courseList().then(response => {
       this.courseLists = response.list;
@@ -172,10 +172,6 @@ export default {
     },
     /** 查询短链课程看课记录列表 */
     getList() {
-      if (!this.queryParams.sTime || !this.queryParams.eTime) {
-        this.$message.warning("请选择创建时间");
-        return;
-      }
       this.loading = true;
       statisticsList(this.queryParams).then(response => {
         this.courseWatchLogList = response.rows;
@@ -208,6 +204,10 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+      if (!this.queryParams.sTime || !this.queryParams.eTime) {
+        this.$message.warning("请选择创建时间");
+        return;
+      }
       this.queryParams.pageNum = 1;
       this.getList();
     },

+ 9 - 10
src/views/course/courseWatchLog/watchLogStatistics.vue

@@ -123,11 +123,11 @@ export default {
     };
   },
   created() {
-    // 设置默认时间范围为最近7天
-    this.createTime = getDateRange(7);
-    // 设置查询参数的时间
-    this.queryParams.sTime = this.createTime[0];
-    this.queryParams.eTime = this.createTime[1];
+    // // 设置默认时间范围为最近7天
+    // this.createTime = getDateRange(7);
+    // // 设置查询参数的时间
+    // this.queryParams.sTime = this.createTime[0];
+    // this.queryParams.eTime = this.createTime[1];
 
     courseList().then(response => {
       this.courseLists = response.list;
@@ -178,11 +178,6 @@ export default {
     },
     /** 查询短链课程看课记录列表 */
     getList() {
-      if (!this.queryParams.sTime || !this.queryParams.eTime) {
-        this.$message.warning("请选择创建时间");
-        return;
-      }
-
       this.loading = true;
       if(this.queryParams.logType == "10"){
         this.queryParams.logType = null;
@@ -223,6 +218,10 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+      if (!this.queryParams.sTime || !this.queryParams.eTime) {
+        this.$message.warning("请选择创建时间");
+        return;
+      }
       this.queryParams.pageNum = 1;
       this.getList();
     },