Commit 1e0df149 authored by Xiaxuxia's avatar Xiaxuxia

统一分页样式

parent 13158806
...@@ -56,11 +56,20 @@ ...@@ -56,11 +56,20 @@
<!-- 分页 --> <!-- 分页 -->
<div class="page-foot"> <div class="page-foot">
<el-pagination <el-pagination
@size-change="handleSizeChange"
@current-change="currentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10, 20, 30, 40]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
<!-- <el-pagination
background background
layout="prev, pager, next" layout="prev, pager, next"
:page-size="listQuery.limit" :page-size="listQuery.limit"
:total="total" @current-change="currentChange"> :total="total" @current-change="currentChange">
</el-pagination> </el-pagination> -->
</div> </div>
<!-- 使用图片查看器预览当前缩略图 --> <!-- 使用图片查看器预览当前缩略图 -->
...@@ -140,6 +149,11 @@ export default { ...@@ -140,6 +149,11 @@ export default {
this.getList()//获取数据 this.getList()//获取数据
}, },
methods: { methods: {
handleSizeChange(val) {
this.listQuery.limit = val
this.getList();
},
closePreview() { closePreview() {
this.currentIcon.showPreview = false; this.currentIcon.showPreview = false;
}, },
...@@ -180,27 +194,6 @@ export default { ...@@ -180,27 +194,6 @@ export default {
} }
this.getList() this.getList()
}, },
// //清除搜索
// filterData() {
// if (this.searchForm.status === 0 && this.searchForm.title === '') {
// this.list = this.data;
// return ;
// }
// let temp = this.data.filter(v => this.searchForm.status === 0 ? true: !!(this.searchForm.status === v.status))
// if (!!this.searchForm.title) {
// temp = temp.filter(v => v.title.includes(this.searchForm.title))
// }
// this.list = temp
// },
// //清除搜索
// clearFilterData() {
// this.searchForm = {
// status: 0,
// title: ""
// }
// this.list = this.data;
// },
//切换页码 //切换页码
currentChange(val) { currentChange(val) {
this.listQuery.page = val; this.listQuery.page = val;
...@@ -210,14 +203,7 @@ export default { ...@@ -210,14 +203,7 @@ export default {
edit(row) { edit(row) {
this.dialogTitle = "编辑banner"; this.dialogTitle = "编辑banner";
this.formObject.formVal = this.filterParams(row) this.formObject.formVal = this.filterParams(row)
// this.formObject = {
// formVal: this.filterParams(row),
// rules: this.formObject.rules,//表单规则
// formItem: banner.formInfo,//表单项。
// }
this.dialogVisible = true; this.dialogVisible = true;
// console.log(this.formObject.formVal)
}, },
closeDialog() { closeDialog() {
this.$bus.$emit('upload-clearFiles') this.$bus.$emit('upload-clearFiles')
...@@ -245,24 +231,6 @@ export default { ...@@ -245,24 +231,6 @@ export default {
this.formObject.formVal = banner.init(); this.formObject.formVal = banner.init();
}, },
// //打开弹窗
// onOpen() {
// this.$nextTick(() => {
// this.formObject = {
// formVal: {
// title: "",
// cover: "",
// rank: "",
// url: "",
// status: 1,
// jumpType: 0,
// jumpId: '',
// },
// rules: this.formObject.rules,//表单规则
// formItem: banner.formInfo,//表单项。
// }
// })
// },
filterParams(row) { filterParams(row) {
let a = {}; let a = {};
for (let i in this.formObject.formVal) { for (let i in this.formObject.formVal) {
...@@ -329,8 +297,6 @@ export default { ...@@ -329,8 +297,6 @@ export default {
cursor: pointer; cursor: pointer;
} }
.page-foot { .page-foot {
display: flex;
justify-content: center;
margin-top: 20px; margin-top: 20px;
} }
</style> </style>
...@@ -48,12 +48,21 @@ ...@@ -48,12 +48,21 @@
<div class="page-foot"> <div class="page-foot">
<el-pagination <el-pagination
@size-change="handleSizeChange"
@current-change="currentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10, 20, 30, 40]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="~~total">
</el-pagination>
<!-- <el-pagination
background background
layout="prev, pager, next" layout="prev, pager, next"
:total="~~total" :total="~~total"
:current-page="listQuery.page" :current-page="listQuery.page"
@current-change="currentChange"> @current-change="currentChange">
</el-pagination> </el-pagination> -->
</div> </div>
</div> </div>
...@@ -106,6 +115,11 @@ export default { ...@@ -106,6 +115,11 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
handleSizeChange(val) {
this.listQuery.limit = val
this.getList();
},
changePageInfo(page) { changePageInfo(page) {
// this.listQuery = page; // this.listQuery = page;
this.$emit('recordPageInfo', page) this.$emit('recordPageInfo', page)
...@@ -244,8 +258,6 @@ export default { ...@@ -244,8 +258,6 @@ export default {
height: auto; height: auto;
} }
.page-foot { .page-foot {
display: flex;
justify-content: center;
margin-top: 20px; margin-top: 20px;
} }
</style> </style>
...@@ -52,12 +52,21 @@ ...@@ -52,12 +52,21 @@
/> />
<div class="page-foot"> <div class="page-foot">
<el-pagination <el-pagination
@size-change="handleSizeChange"
@current-change="currentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10, 20, 30, 40]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="~~total">
</el-pagination>
<!-- <el-pagination
background background
layout="prev, pager, next" layout="prev, pager, next"
:page-size="listQuery.limit" :page-size="listQuery.limit"
:current-page="listQuery.page" :current-page="listQuery.page"
:total="total" @current-change="currentChange"> :total="total" @current-change="currentChange">
</el-pagination> </el-pagination> -->
</div> </div>
</div> </div>
...@@ -109,6 +118,11 @@ export default { ...@@ -109,6 +118,11 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
handleSizeChange(val) {
this.listQuery.limit = val
this.getList();
},
showPreview(url) { showPreview(url) {
this.currentIcon.url = url; this.currentIcon.url = url;
this.currentIcon.showPreview = true; this.currentIcon.showPreview = true;
...@@ -246,8 +260,6 @@ export default { ...@@ -246,8 +260,6 @@ export default {
cursor: pointer; cursor: pointer;
} }
.page-foot { .page-foot {
display: flex;
justify-content: center;
margin-top: 20px; margin-top: 20px;
} }
</style> </style>
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