|
@@ -47,6 +47,16 @@
|
47
|
47
|
</template>
|
48
|
48
|
</el-table-column>
|
49
|
49
|
</el-table>
|
|
50
|
+ <el-pagination
|
|
51
|
+ v-if="questionTotal!==0"
|
|
52
|
+ style="float:right; margin:20px 0"
|
|
53
|
+ :total="questionTotal"
|
|
54
|
+ :current-page="currentPage"
|
|
55
|
+ :page-size="pageSize"
|
|
56
|
+ layout="total, prev, pager, next, sizes"
|
|
57
|
+ @size-change="handleSizeChange"
|
|
58
|
+ @current-change="handleCurrentChange"
|
|
59
|
+ />
|
50
|
60
|
</div>
|
51
|
61
|
</template>
|
52
|
62
|
<script>
|
|
@@ -63,7 +73,10 @@ export default {
|
63
|
73
|
daterange: '',
|
64
|
74
|
tableData: [],
|
65
|
75
|
endDate: undefined,
|
66
|
|
- startDate: undefined
|
|
76
|
+ startDate: undefined,
|
|
77
|
+ pageSize: 10,
|
|
78
|
+ currentPage: 1,
|
|
79
|
+ questionTotal: 0// 条目总数
|
67
|
80
|
}
|
68
|
81
|
},
|
69
|
82
|
watch: {
|
|
@@ -74,6 +87,21 @@ export default {
|
74
|
87
|
}
|
75
|
88
|
},
|
76
|
89
|
methods: {
|
|
90
|
+ handleSizeChange(val) {
|
|
91
|
+ this.pageSize = val
|
|
92
|
+ this.changePagination()
|
|
93
|
+ },
|
|
94
|
+ handleCurrentChange(val) {
|
|
95
|
+ this.currentPage = val
|
|
96
|
+ this.changePagination()
|
|
97
|
+ },
|
|
98
|
+ changePagination() {
|
|
99
|
+ getQuestionList({ gameId: this.gameId, title: this.title, startDate: this.startDate, endDate: this.endDate, pageSize: this.pageSize, pageNum: this.currentPage }).then(
|
|
100
|
+ (res) => {
|
|
101
|
+ this.tableData = res.data.records
|
|
102
|
+ }
|
|
103
|
+ )
|
|
104
|
+ },
|
77
|
105
|
// 添加问题
|
78
|
106
|
handleAdd() {
|
79
|
107
|
this.$emit('handleAddQuestion', true)
|
|
@@ -91,9 +119,11 @@ export default {
|
91
|
119
|
})
|
92
|
120
|
},
|
93
|
121
|
onSearch() {
|
94
|
|
- getQuestionList({ gameId: this.gameId, title: this.title, startDate: this.startDate, endDate: this.endDate }).then(
|
|
122
|
+ getQuestionList({ gameId: this.gameId, title: this.title, startDate: this.startDate, endDate: this.endDate, pageSize: this.pageSize }).then(
|
95
|
123
|
(res) => {
|
96
|
124
|
this.tableData = res.data.records
|
|
125
|
+ this.questionTotal = res.data.total
|
|
126
|
+ this.pageSize = res.data.size
|
97
|
127
|
}
|
98
|
128
|
)
|
99
|
129
|
},
|
|
@@ -102,6 +132,8 @@ export default {
|
102
|
132
|
this.daterange = ''
|
103
|
133
|
this.startDate = ''
|
104
|
134
|
this.endDate = ''
|
|
135
|
+ this.pageSize = 10
|
|
136
|
+ this.pageNum = 1
|
105
|
137
|
this.onSearch()
|
106
|
138
|
},
|
107
|
139
|
dateChange(val) {
|