Commit b027e386 authored by lixin's avatar lixin

课程提问,分页

parent 8ffab53c
......@@ -82,11 +82,9 @@ export default {
return {
columns: columns,
data: [],
searchPage: {
pagination: {
pageIndex: 1,
pageSize: 10,
},
pagination: {
showQuickJumper: true,
showSizeChanger: true,
},
......@@ -111,17 +109,15 @@ export default {
},
// 创建完毕
created() {
let questionId = this.$route.query.id;
if (questionId) {
this.searchPage.questionId = questionId;
this.getAnswerList(this.searchPage);
}
this.getAnswerList(this.pagination);
},
// 即将更新渲染
beforeUpdate() {},
methods: {
getAnswerList(query) {
this.loading = true;
let questionId = this.$route.query.id;
query.questionId = questionId;
fetchAnswerList(query)
.then((res) => {
if (res.code == 200) {
......@@ -146,7 +142,7 @@ export default {
.then((res) => {
if (res.resp_code == 200) {
this.$message.info("回复成功");
this.getAnswerList(this.searchPage);
this.getAnswerList(this.pagination);
} else {
this.$message.info(res.resp_msg);
}
......@@ -176,11 +172,13 @@ export default {
this.$refs.formModelRef.resetFields();
},
handleTableChange() {
let queryParam = { ...this.searchPage };
queryParam.pageIndex = pagination.current;
queryParam.pageSize = pagination.pageSize;
this.getList(queryParam);
handleTableChange(pagination) {
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageIndex = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getAnswerList(this.pagination);
},
navigateIndexPage(row) {
let queryParam = {
......
......@@ -158,8 +158,14 @@ export default {
let queryParam = { ...this.searchPage };
this.getList(queryParam);
},
handleTableChange() {
handleTableChange(pagination) {
let queryParam = { ...this.searchPage };
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageIndex = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
queryParam.pageIndex = pagination.current;
queryParam.pageSize = pagination.pageSize;
this.getList(queryParam);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment