李志伟 3 år sedan
förälder
incheckning
6ea327eb8b
1 ändrade filer med 24 tillägg och 2 borttagningar
  1. 24
    2
      src/views/gameManage/index.vue

+ 24
- 2
src/views/gameManage/index.vue Visa fil

@@ -48,6 +48,15 @@
48 48
         </template>
49 49
       </el-table-column>
50 50
     </el-table>
51
+    <el-pagination
52
+      style="float:right; margin:20px 0"
53
+      :total="gameTotal"
54
+      :current-page="currentPage"
55
+      :page-sizes="[10, 50, 100]"
56
+      :page-size="pageSize"
57
+      layout="total, sizes, prev, pager, next, jumper"
58
+      @current-change="handleCurrentChange"
59
+    />
51 60
   </div>
52 61
 </template>
53 62
 <script>
@@ -61,13 +70,22 @@ export default {
61 70
       daterange: undefined,
62 71
       tableData: [],
63 72
       endDate: undefined,
64
-      startDate: undefined
73
+      startDate: undefined,
74
+      //
75
+      pageSize: 10,
76
+      currentPage: 1,
77
+      gameTotal: 0// 条目总数
65 78
     }
66 79
   },
67 80
   mounted() {
68 81
     this.onSearch()
69 82
   },
70 83
   methods: {
84
+    handleCurrentChange(val) {
85
+      this.currentPage = val
86
+      this.onSearch()
87
+    },
88
+    //
71 89
     handleAdd() {
72 90
       this.$router.push({ name: 'gameEdit' })
73 91
     },
@@ -86,9 +104,13 @@ export default {
86 104
       getGameList({
87 105
         title: this.title,
88 106
         startDate: this.startDate,
89
-        endDate: this.endDate
107
+        endDate: this.endDate,
108
+        pageNum: this.currentPage
90 109
       }).then((res) => {
91 110
         this.tableData = res.data.records
111
+        this.gameTotal = res.data.total
112
+        this.pageSize = res.data.size
113
+        this.currentPage = res.data.current
92 114
       })
93 115
     },
94 116
     onReset() {