添加分页

This commit is contained in:
zhujida 2021-01-21 16:19:12 +08:00
parent 2b30cfbfe8
commit 654de5b250

View File

@ -105,10 +105,12 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div <div class="target-main-content-handle">
@click="menuDataClasseHide = !menuDataClasseHide" <div
class="target-main-content-hide" @click="menuDataClasseHide = !menuDataClasseHide"
><i :class="menuDataClasseHide?'el-icon-arrow-right':'el-icon-arrow-left'"></i></div> class="target-main-content-handle-hide"
><i :class="menuDataClasseHide?'el-icon-arrow-right':'el-icon-arrow-left'"></i></div>
</div>
<div class="target-main-content-right"> <div class="target-main-content-right">
<el-table <el-table
:data="tableData" :data="tableData"
@ -146,6 +148,18 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination
v-if="this.tablePage.currPage>1"
@size-change="handlePageSizeChange"
@current-change="handlePageCurrentChange"
:current-page.sync="tablePage.currPage"
:page-size="tablePage.pageSize"
:page-sizes="[20,50,100]"
layout="sizes, prev, pager, next"
:total="tablePage.totalCount"
class="target-main-content-right-page"
>
</el-pagination>
</div> </div>
</div> </div>
</div> </div>
@ -351,7 +365,15 @@ export default {
this.queryData.type = val ? val.id : -1 this.queryData.type = val ? val.id : -1
this.handleGetMenuList(this.queryData.type) this.handleGetMenuList(this.queryData.type)
}, },
handlePageCurrentChange (val) {
//
this.tablePage.currPage = val
this.handleGetTargetList(this.queryData.indicatorType, this.queryData.type, this.queryData.name, val)
},
handlePageSizeChange (val) {
this.tablePage.pageSize = val
this.handleGetTargetList(this.queryData.indicatorType, this.queryData.type, this.queryData.name, this.tablePage.currPage)
},
handleGetMenuList (type = -1) { handleGetMenuList (type = -1) {
// type // type
// //
@ -388,7 +410,7 @@ export default {
this.queryData.indicatorType = indicatorType this.queryData.indicatorType = indicatorType
let para = { let para = {
currPage: currPage, currPage: currPage,
pageSize: 20, pageSize: this.tablePage.pageSize,
name: name name: name
} }
if (indicatorType !== -1) { if (indicatorType !== -1) {
@ -499,27 +521,36 @@ export default {
&-content { &-content {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;
margin-top: 20px; margin-top: 20px;
overflow: hidden; overflow: hidden;
&-left { &-left {
display: flex; display: flex;
.el-table { .el-table {
width: 200px;
border: 0.5px solid @borderColor; border: 0.5px solid @borderColor;
} }
} }
&-hide { &-handle {
color: #fff; display: flex;
background-color: @borderColor; align-items: center;
width: 12px; &-hide {
height: 20px; color: #fff;
border-bottom-right-radius: 2px; background-color: @borderColor;
border-top-right-radius: 2px; width: 12px;
height: 20px;
margin-right: 10px;
border-bottom-right-radius: 2px;
border-top-right-radius: 2px;
}
} }
&-right { &-right {
flex: 1; flex: 1;
border: red; &-page {
flex: 1;
text-align: center;
margin-top: 10px;
}
} }
} }
} }