李志伟 před 3 roky
rodič
revize
d26976e5b3
1 změnil soubory, kde provedl 26 přidání a 5 odebrání
  1. 26
    5
      src/views/gameManage/index.vue

+ 26
- 5
src/views/gameManage/index.vue Zobrazit soubor

@@ -52,9 +52,9 @@
52 52
       style="float:right; margin:20px 0"
53 53
       :total="gameTotal"
54 54
       :current-page="currentPage"
55
-      :page-sizes="[10, 50, 100]"
56 55
       :page-size="pageSize"
57
-      layout="total, sizes, prev, pager, next, jumper"
56
+      layout="total, prev, pager, next, sizes"
57
+      @size-change="handleSizeChange"
58 58
       @current-change="handleCurrentChange"
59 59
     />
60 60
   </div>
@@ -81,9 +81,30 @@ export default {
81 81
     this.onSearch()
82 82
   },
83 83
   methods: {
84
+    handleSizeChange(val) {
85
+      this.pageSize = val
86
+      getGameList({
87
+        title: this.title,
88
+        startDate: this.startDate,
89
+        endDate: this.endDate,
90
+        pageNum: this.currentPage,
91
+        pageSize: this.pageSize
92
+      }).then((res) => {
93
+        this.tableData = res.data.records
94
+        this.pageSize = res.data.size
95
+      })
96
+    },
84 97
     handleCurrentChange(val) {
85 98
       this.currentPage = val
86
-      this.onSearch()
99
+      getGameList({
100
+        title: this.title,
101
+        startDate: this.startDate,
102
+        endDate: this.endDate,
103
+        pageNum: this.currentPage,
104
+        pageSize: this.pageSize
105
+      }).then((res) => {
106
+        this.tableData = res.data.records
107
+      })
87 108
     },
88 109
     //
89 110
     handleAdd() {
@@ -105,12 +126,11 @@ export default {
105 126
         title: this.title,
106 127
         startDate: this.startDate,
107 128
         endDate: this.endDate,
108
-        pageNum: this.currentPage
129
+        pageSize: this.pageSize
109 130
       }).then((res) => {
110 131
         this.tableData = res.data.records
111 132
         this.gameTotal = res.data.total
112 133
         this.pageSize = res.data.size
113
-        this.currentPage = res.data.current
114 134
       })
115 135
     },
116 136
     onReset() {
@@ -118,6 +138,7 @@ export default {
118 138
       this.daterange = undefined
119 139
       this.startDate = undefined
120 140
       this.endDate = undefined
141
+      this.currentPage = 1
121 142
       this.onSearch()
122 143
     },
123 144
     dateChange(val) {