Commit 8764dea9 by luyt

add: 1.调整table单元格间距 2.page分页顺序,单页隐藏分页

1 parent 094bf523
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
......@@ -98,7 +98,9 @@ export default {
width: '180',
formatter: cellValue => {
return cellValue.startTime + '-' + cellValue.endTime
}
},
columnattrs:{},
columnlisteners:{}
},
{
label: '直播间名称',
......
......@@ -8,7 +8,7 @@
</template>
</el-table-column>
<el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" type="selection" width="55" :selectable="checkSelectable" :reserve-selection="true"></el-table-column>
<el-table-column v-if="hasNum" align="center" width="60px" label="序号" type="index" :index="index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"></el-table-column>
<el-table-column v-if="hasNum" align="center" width="72px" label="序号" type="index" :index="index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"></el-table-column>
<el-table-column v-for="(item, index) in tableColumns" :key="index" v-bind="item.columnattrs ? item.columnattrs : {}" v-on="item.columnlisteners ? item.columnlisteners : {}" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'center'" :sortable="item.sortable" :render-header="item.renderHeader">
<template slot-scope="scope">
<slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot>
......@@ -61,7 +61,8 @@
<slot name="additionalContent"></slot>
</template>
</el-table>
<el-pagination v-if="hasPage" v-bind="paginationattrs" v-on="paginationlisteners" background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page[this.pageConf.pageNum]" :page-sizes="pageSizes" :page-size="page[this.pageConf.pageSize]" :total="getListApi ? total : tableTotal" :layout="layout"></el-pagination>
<!-- hasPageComputed -->
<el-pagination v-if="hasPageComputed" v-bind="paginationattrs" v-on="paginationlisteners" background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page[this.pageConf.pageNum]" :page-sizes="pageSizes" :page-size="page[this.pageConf.pageSize]" :total="getListApi ? total : tableTotal" :layout="layout"></el-pagination>
</div>
</template>
......@@ -169,7 +170,7 @@ export default {
// 分页组件配置
layout: {
type: String,
default: 'sizes,total,->,prev,pager,next,jumper'
default: 'total,sizes,prev,pager,next,jumper'
},
// 序号,默认有
hasNum: {
......@@ -261,6 +262,18 @@ export default {
// deep: true
// }
},
computed:{
// 分页计算属性
hasPageComputed(){
if(this.page[this.pageConf.pageNum] <= 1){
return false;
}
if(!this.hasPage){
return false;
}
return true
}
},
methods: {
findShowHeadCol() {
......
......@@ -280,8 +280,12 @@ $dackColor: $color-primary-dark30;
.el-table--medium .el-table__cell {
padding: 16px 0px;
}
.el-table th.el-table__cell>.cell{
padding: 0 16px;
}
.el-table .cell {
line-height: 20px;
padding: 0 16px;
}
.el-table .el-table__header tr {
background: #f4f6fc;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!