feat: base scTable增加选择数量显示
This commit is contained in:
parent
d1e9fd5a2d
commit
43e1dd40c3
|
@ -13,7 +13,7 @@
|
|||
<el-table v-bind="$attrs" :data="tableData" :row-key="rowKey" :key="toggleIndex" ref="scTable"
|
||||
:height="height == 'auto' ? null : '100%'" :size="config.size" :border="config.border" :stripe="config.stripe"
|
||||
:summary-method="remoteSummary ? remoteSummaryMethod : summaryMethod" @sort-change="sortChange"
|
||||
@filter-change="filterChange">
|
||||
@filter-change="filterChange" @selection-change="selectionChange">
|
||||
<slot></slot>
|
||||
<template v-for="(item, index) in userColumn" :key="index">
|
||||
<el-table-column v-if="!item.hide" :column-key="item.prop" :label="item.label" :prop="item.prop"
|
||||
|
@ -40,6 +40,7 @@
|
|||
@current-change="paginationChange" @update:page-size="pageSizeChange"></el-pagination>
|
||||
</div>
|
||||
<div class="scTable-do" v-if="!hideDo">
|
||||
<span v-show="selectNum>0">已选择 <span style="font-weight: bold">{{selectNum}}</span> 项</span>
|
||||
<el-button v-if="!hideRefresh" @click="refresh" icon="el-icon-refresh" circle style="margin-left: 15px">
|
||||
</el-button>
|
||||
<el-button v-if="!hideRefresh" @click="reload" icon="el-icon-refresh-right" circle style="margin-left: 15px">
|
||||
|
@ -155,6 +156,7 @@ export default {
|
|||
border: true,
|
||||
stripe: this.stripe,
|
||||
},
|
||||
selectNum: 0
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -359,6 +361,10 @@ export default {
|
|||
}
|
||||
this.getData();
|
||||
},
|
||||
// select事件
|
||||
selectionChange(rows){
|
||||
this.selectNum = rows.length;
|
||||
},
|
||||
//本地过滤
|
||||
filterHandler(value, row, column) {
|
||||
const property = column.property;
|
||||
|
|
Loading…
Reference in New Issue