提交 e0a4650e authored 作者: 王鹏飞's avatar 王鹏飞

fix: 修复公告列表翻页错误的问题

上级 0c59cf05
......@@ -9,9 +9,7 @@
<template v-if="!item.isShow">
<el-badge is-dot class="item">{{ item.title }}</el-badge>
</template>
<template v-if="item.isShow">
{{ item.title }}
</template>
<template v-if="item.isShow">{{ item.title }}</template>
</template>
<div v-html="item.text"></div>
</el-collapse-item>
......@@ -19,8 +17,8 @@
</el-collapse>
<div style="height: 0.3rem;"></div>
<el-pagination
:current-page.sync="page.currentPage"
:page-size="page.limit"
:current-page.sync="page.page"
:page-size="page.page_size"
layout="total, prev, pager, next, jumper"
:total="page.total"
@current-change="handleCurrentChange"
......@@ -34,39 +32,49 @@
import cAction from '@action'
export default {
components: { },
data () {
components: {},
data() {
return {
activeNames: ['1'],
activeNames: [],
msgList: [],
page: {
offset: 0,
page: 1,
total: 0,
currentPage: 1,
limit: 10
page_size: 20
}
}
},
mounted () {
mounted() {
this.getData()
},
methods: {
handleChange (val) {
handleChange(val) {
if (typeof val === 'number' && this.msgList[val].isShow === 0) {
cAction.Other.setMsgWmp(this.msgList[val].id).then(json => {
this.getData()
}).catch(e => { this.$message.error(e.message) }).finally(() => { })
cAction.Other.setMsgWmp(this.msgList[val].id)
.then(json => {
this.getData()
})
.catch(e => {
this.$message.error(e.message)
})
}
},
getData (obj) {
cAction.Other.getMyMsg(obj).then(json => {
this.msgList = json.list
this.page.total = json.count
this.$store.commit('myMsg', json.countNum)
}).catch(e => { this.$message.error(e.message) }).finally(() => { })
getData() {
const pageParam = {
page: this.page.page,
page_size: this.page.page_size
}
cAction.Other.getMyMsg(pageParam)
.then(json => {
this.msgList = json.list
this.page.total = json.count
this.$store.commit('myMsg', json.countNum)
})
.catch(e => {
this.$message.error(e.message)
})
},
handleCurrentChange() {
this.page.offset = (this.page.currentPage - 1) * this.page.limit
this.getData()
}
}
......@@ -74,10 +82,12 @@ export default {
</script>
<style lang="scss">
.el-collapse-item__header{
.el-collapse-item__header {
line-height: 15px;
}
.total-core, .compulsory-core, .elective-core {
.total-core,
.compulsory-core,
.elective-core {
margin-top: 0.1rem;
font-size: 16px;
line-height: 36px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论