|
@@ -71,11 +71,12 @@
|
|
|
</div>
|
|
|
<!-- 分页 -->
|
|
|
<div class="pageMenu">
|
|
|
- <div id="dataNum">共0条</div>
|
|
|
+ <div id="dataNum">共{{ this.total }}条</div>
|
|
|
<el-pagination
|
|
|
background
|
|
|
layout="prev, pager, next"
|
|
|
- :total="total"
|
|
|
+ :total="this.total"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
:page-size="pageSize"
|
|
|
>
|
|
|
</el-pagination>
|
|
@@ -187,32 +188,41 @@ export default {
|
|
|
value1: "",
|
|
|
tableData: [],
|
|
|
mockNoticeList: [],
|
|
|
- total: 0,
|
|
|
- pageSize: 5,
|
|
|
- totalNum: "",
|
|
|
+ total: 1,
|
|
|
+ pageSize: 2,
|
|
|
+ pageNum: 1,
|
|
|
row_ : "1",
|
|
|
- noticeTime_: "1"
|
|
|
+ noticeTime_: "1",
|
|
|
+ currentPageData: [],
|
|
|
+ currentPage: 1,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
//获取总条目的id
|
|
|
- this.totalNum = document.querySelector("#dataNum");
|
|
|
+ // this.totalNum = document.querySelector("#dataNum");
|
|
|
this.getMockNoticeList();
|
|
|
// this.getTableList();
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
getMockNoticeList() {
|
|
|
- getNotice().then((res) => {
|
|
|
+ getNotice(this.pageNum).then((res) => {
|
|
|
//获取数据
|
|
|
this.tableData = res.rows;
|
|
|
- console.log(res);
|
|
|
+ this.total = res.total
|
|
|
|
|
|
- //获取数据总数
|
|
|
- this.totalNum.innerHTML = `共:${res.rows.length}条`;
|
|
|
- this.total = res.rows.length;
|
|
|
+ console.log(res);
|
|
|
+ console.log(res.rows)
|
|
|
});
|
|
|
},
|
|
|
+ //分页
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ getNotice(val).then((res) => {
|
|
|
+ this.tableData = res.rows
|
|
|
+ this.total = res.total
|
|
|
+ // console.log(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
// 删除按钮
|
|
|
deleteNotice(row) {
|
|
|
console.log(row);
|