UPD 调整reload方法
This commit is contained in:
parent
26e8cccd67
commit
fb3e58ef11
|
@ -20,7 +20,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="scTable-page">
|
<div class="scTable-page">
|
||||||
<div class="scTable-pagination">
|
<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>
|
||||||
<div class="scTable-do" v-if="!hideDo">
|
<div class="scTable-do" v-if="!hideDo">
|
||||||
<el-button @click="refresh" icon="el-icon-refresh" circle style="margin-left:15px"></el-button>
|
<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
|
this.$refs.scTable.$el.querySelector('.el-table__body-wrapper').scrollTop = 0
|
||||||
},
|
},
|
||||||
//分页点击
|
//分页点击
|
||||||
reload(){
|
paginationChange(){
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
//刷新数据
|
//刷新数据
|
||||||
|
@ -151,12 +151,22 @@
|
||||||
this.$refs.scTable.clearSelection();
|
this.$refs.scTable.clearSelection();
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
//更新数据
|
//更新数据 合并上一次params
|
||||||
upData(params){
|
upData(params, page=1){
|
||||||
this.currentPage = 1;
|
this.currentPage = page;
|
||||||
|
this.$refs.scTable.clearSelection();
|
||||||
Object.assign(this.tableParams, params || {})
|
Object.assign(this.tableParams, params || {})
|
||||||
this.getData()
|
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){
|
columnSettingChange(userColumn){
|
||||||
this.userColumn = userColumn;
|
this.userColumn = userColumn;
|
||||||
|
|
|
@ -147,7 +147,7 @@
|
||||||
},
|
},
|
||||||
//树点击事件
|
//树点击事件
|
||||||
dicClick(data){
|
dicClick(data){
|
||||||
this.$refs.table.upData({
|
this.$refs.table.reload({
|
||||||
code: data.code
|
code: data.code
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
@ -165,7 +165,7 @@
|
||||||
var params = {
|
var params = {
|
||||||
groupId: data.id
|
groupId: data.id
|
||||||
}
|
}
|
||||||
this.$refs.table.upData(params)
|
this.$refs.table.reload(params)
|
||||||
},
|
},
|
||||||
//搜索
|
//搜索
|
||||||
upsearch(){
|
upsearch(){
|
||||||
|
|
Loading…
Reference in New Issue