李志伟 3 年 前
コミット
6ea327eb8b
共有1 個のファイルを変更した24 個の追加2 個の削除を含む
  1. 24
    2
      src/views/gameManage/index.vue

+ 24
- 2
src/views/gameManage/index.vue ファイルの表示

48
         </template>
48
         </template>
49
       </el-table-column>
49
       </el-table-column>
50
     </el-table>
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
   </div>
60
   </div>
52
 </template>
61
 </template>
53
 <script>
62
 <script>
61
       daterange: undefined,
70
       daterange: undefined,
62
       tableData: [],
71
       tableData: [],
63
       endDate: undefined,
72
       endDate: undefined,
64
-      startDate: undefined
73
+      startDate: undefined,
74
+      //
75
+      pageSize: 10,
76
+      currentPage: 1,
77
+      gameTotal: 0// 条目总数
65
     }
78
     }
66
   },
79
   },
67
   mounted() {
80
   mounted() {
68
     this.onSearch()
81
     this.onSearch()
69
   },
82
   },
70
   methods: {
83
   methods: {
84
+    handleCurrentChange(val) {
85
+      this.currentPage = val
86
+      this.onSearch()
87
+    },
88
+    //
71
     handleAdd() {
89
     handleAdd() {
72
       this.$router.push({ name: 'gameEdit' })
90
       this.$router.push({ name: 'gameEdit' })
73
     },
91
     },
86
       getGameList({
104
       getGameList({
87
         title: this.title,
105
         title: this.title,
88
         startDate: this.startDate,
106
         startDate: this.startDate,
89
-        endDate: this.endDate
107
+        endDate: this.endDate,
108
+        pageNum: this.currentPage
90
       }).then((res) => {
109
       }).then((res) => {
91
         this.tableData = res.data.records
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
     onReset() {
116
     onReset() {