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 { ...@@ -98,7 +98,9 @@ export default {
width: '180', width: '180',
formatter: cellValue => { formatter: cellValue => {
return cellValue.startTime + '-' + cellValue.endTime return cellValue.startTime + '-' + cellValue.endTime
} },
columnattrs:{},
columnlisteners:{}
}, },
{ {
label: '直播间名称', label: '直播间名称',
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</template> </template>
</el-table-column> </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="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"> <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"> <template slot-scope="scope">
<slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot>
...@@ -61,7 +61,8 @@ ...@@ -61,7 +61,8 @@
<slot name="additionalContent"></slot> <slot name="additionalContent"></slot>
</template> </template>
</el-table> </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> </div>
</template> </template>
...@@ -169,7 +170,7 @@ export default { ...@@ -169,7 +170,7 @@ export default {
// 分页组件配置 // 分页组件配置
layout: { layout: {
type: String, type: String,
default: 'sizes,total,->,prev,pager,next,jumper' default: 'total,sizes,prev,pager,next,jumper'
}, },
// 序号,默认有 // 序号,默认有
hasNum: { hasNum: {
...@@ -261,6 +262,18 @@ export default { ...@@ -261,6 +262,18 @@ export default {
// deep: true // deep: true
// } // }
}, },
computed:{
// 分页计算属性
hasPageComputed(){
if(this.page[this.pageConf.pageNum] <= 1){
return false;
}
if(!this.hasPage){
return false;
}
return true
}
},
methods: { methods: {
findShowHeadCol() { findShowHeadCol() {
......
...@@ -280,8 +280,12 @@ $dackColor: $color-primary-dark30; ...@@ -280,8 +280,12 @@ $dackColor: $color-primary-dark30;
.el-table--medium .el-table__cell { .el-table--medium .el-table__cell {
padding: 16px 0px; padding: 16px 0px;
} }
.el-table th.el-table__cell>.cell{
padding: 0 16px;
}
.el-table .cell { .el-table .cell {
line-height: 20px; line-height: 20px;
padding: 0 16px;
} }
.el-table .el-table__header tr { .el-table .el-table__header tr {
background: #f4f6fc; background: #f4f6fc;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!