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

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

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