李志伟 3 年前
父节点
当前提交
d26976e5b3
共有 1 个文件被更改,包括 26 次插入5 次删除
  1. 26
    5
      src/views/gameManage/index.vue

+ 26
- 5
src/views/gameManage/index.vue 查看文件

52
       style="float:right; margin:20px 0"
52
       style="float:right; margin:20px 0"
53
       :total="gameTotal"
53
       :total="gameTotal"
54
       :current-page="currentPage"
54
       :current-page="currentPage"
55
-      :page-sizes="[10, 50, 100]"
56
       :page-size="pageSize"
55
       :page-size="pageSize"
57
-      layout="total, sizes, prev, pager, next, jumper"
56
+      layout="total, prev, pager, next, sizes"
57
+      @size-change="handleSizeChange"
58
       @current-change="handleCurrentChange"
58
       @current-change="handleCurrentChange"
59
     />
59
     />
60
   </div>
60
   </div>
81
     this.onSearch()
81
     this.onSearch()
82
   },
82
   },
83
   methods: {
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
     handleCurrentChange(val) {
97
     handleCurrentChange(val) {
85
       this.currentPage = val
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
     handleAdd() {
110
     handleAdd() {
105
         title: this.title,
126
         title: this.title,
106
         startDate: this.startDate,
127
         startDate: this.startDate,
107
         endDate: this.endDate,
128
         endDate: this.endDate,
108
-        pageNum: this.currentPage
129
+        pageSize: this.pageSize
109
       }).then((res) => {
130
       }).then((res) => {
110
         this.tableData = res.data.records
131
         this.tableData = res.data.records
111
         this.gameTotal = res.data.total
132
         this.gameTotal = res.data.total
112
         this.pageSize = res.data.size
133
         this.pageSize = res.data.size
113
-        this.currentPage = res.data.current
114
       })
134
       })
115
     },
135
     },
116
     onReset() {
136
     onReset() {
118
       this.daterange = undefined
138
       this.daterange = undefined
119
       this.startDate = undefined
139
       this.startDate = undefined
120
       this.endDate = undefined
140
       this.endDate = undefined
141
+      this.currentPage = 1
121
       this.onSearch()
142
       this.onSearch()
122
     },
143
     },
123
     dateChange(val) {
144
     dateChange(val) {