Ver Fonte

Seekresult

gcj há 3 anos atrás
pai
commit
b511d47dc6
1 ficheiros alterados com 29 adições e 16 exclusões
  1. 29 16
      src/views/learn-center/Seekresult.vue

+ 29 - 16
src/views/learn-center/Seekresult.vue

@@ -45,7 +45,7 @@
               background
               @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
-              :page-sizes="[10, 20, 30, 40, 50]"
+              :page-sizes="pageSizes"
               layout="prev, pager, next,total, sizes,jumper"
               :current-page="pageNum"
               :page-size="pageSize"
@@ -108,6 +108,9 @@ export default {
       classilfyIndex: 0,
       classilfyID: null,
       isData: false,
+      pageSizes: [8, 16, 32, 64],
+      pageSizes1: [8, 16, 32, 64],
+      pageSizes2: [10, 20, 30, 40],
     };
   },
   computed: {
@@ -127,16 +130,25 @@ export default {
       if (newval != oldval) {
         if (newval == 0) {
           this.pageNum = 1;
+          this.pageSizes = this.pageSizes1;
           this.getData("课程");
         } else if (newval == 1) {
           this.pageNum = 1;
+          this.pageSizes = this.pageSizes2;
           this.getData("教材");
         }
       }
     },
   },
   methods: {
-    handleSizeChange(val) {},
+    handleSizeChange(val) {
+      this.pageNum = 1;
+      if (this.classilfyIndex == 0) {
+        this.getData("课程");
+      } else if (this.classilfyIndex == 1) {
+        this.getData("教材");
+      }
+    },
     // 跳页
     handleCurrentChange(val) {
       this.pageNum = val;
@@ -190,21 +202,22 @@ export default {
           this.CourseList = res;
           this.loading = false;
         });
+      } else {
+        TextbookAPI("book-book_manager-PageQueryBookList", {
+          cur_page: this.pageNum,
+          page_capacity: this.pageSize,
+          name: this.keycode,
+          publish_status: 1,
+          is_control_publish_scope: "true",
+        }).then((res) => {
+          this.TextList = res;
+          if (val == "教材") {
+            this.dataList = null;
+            this.dataList = this.TextList;
+            this.loading = false;
+          }
+        });
       }
-      TextbookAPI("book-book_manager-PageQueryBookList", {
-        cur_page: this.pageNum,
-        page_capacity: this.pageSize,
-        name: this.keycode,
-        publish_status: 1,
-        is_control_publish_scope: "true",
-      }).then((res) => {
-        this.TextList = res;
-        if (val == "教材") {
-          this.dataList = null;
-          this.dataList = this.TextList;
-          this.loading = false;
-        }
-      });
     },
   },
   async created() {