UPD 调整reload方法

This commit is contained in:
sc 2021-08-02 13:01:51 +08:00
parent 26e8cccd67
commit fb3e58ef11
3 changed files with 17 additions and 7 deletions

View File

@ -20,7 +20,7 @@
</div>
<div class="scTable-page">
<div class="scTable-pagination">
<el-pagination v-if="!hidePagination" background :small="true" :layout="paginationLayout" :total="total" :page-size="pageSize" v-model:currentPage="currentPage" @current-change="reload"></el-pagination>
<el-pagination v-if="!hidePagination" background :small="true" :layout="paginationLayout" :total="total" :page-size="pageSize" v-model:currentPage="currentPage" @current-change="paginationChange"></el-pagination>
</div>
<div class="scTable-do" v-if="!hideDo">
<el-button @click="refresh" icon="el-icon-refresh" circle style="margin-left:15px"></el-button>
@ -143,7 +143,7 @@
this.$refs.scTable.$el.querySelector('.el-table__body-wrapper').scrollTop = 0
},
//
reload(){
paginationChange(){
this.getData();
},
//
@ -151,12 +151,22 @@
this.$refs.scTable.clearSelection();
this.getData();
},
//
upData(params){
this.currentPage = 1;
// params
upData(params, page=1){
this.currentPage = page;
this.$refs.scTable.clearSelection();
Object.assign(this.tableParams, params || {})
this.getData()
},
// params
reload(params, page=1){
this.currentPage = page;
this.tableParams = params || {}
this.$refs.scTable.clearSelection();
this.$refs.scTable.clearSort()
this.$refs.scTable.clearFilter()
this.getData()
},
//
columnSettingChange(userColumn){
this.userColumn = userColumn;

View File

@ -147,7 +147,7 @@
},
//
dicClick(data){
this.$refs.table.upData({
this.$refs.table.reload({
code: data.code
})
},

View File

@ -165,7 +165,7 @@
var params = {
groupId: data.id
}
this.$refs.table.upData(params)
this.$refs.table.reload(params)
},
//
upsearch(){