scTable resetQuery
This commit is contained in:
parent
e0bf4eef82
commit
5586dea490
|
@ -336,6 +336,14 @@ export default {
|
|||
Object.assign(this.tableParams, params || {});
|
||||
this.getData();
|
||||
},
|
||||
//重载数据 替换params 保留sort
|
||||
queryData(params, page = 1) {
|
||||
this.currentPage = page;
|
||||
this.tableParams = params || {};
|
||||
this.$refs.scTable.clearSelection();
|
||||
this.$refs.scTable.clearFilter();
|
||||
this.getData();
|
||||
},
|
||||
//重载数据 替换params
|
||||
reload(params, page = 1) {
|
||||
this.currentPage = page;
|
||||
|
@ -344,6 +352,7 @@ export default {
|
|||
this.$refs.scTable.clearSort();
|
||||
this.$refs.scTable.clearFilter();
|
||||
this.getData();
|
||||
this.$emit('resetQuery')
|
||||
},
|
||||
//自定义变化事件
|
||||
columnSettingChange(userColumn) {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" stripe>
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" stripe :resetQuery="resetQuery" >
|
||||
<el-table-column type="selection" width="50"></el-table-column>
|
||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="姓名" prop="name" width="150"></el-table-column>
|
||||
|
@ -59,6 +59,7 @@
|
|||
permission: false
|
||||
},
|
||||
apiObj: this.$API.hrm.employee.list,
|
||||
query: {},
|
||||
selection: [],
|
||||
search: {
|
||||
keyword: null
|
||||
|
@ -159,6 +160,9 @@
|
|||
}else if(mode=='edit'){
|
||||
this.$refs.table.refresh()
|
||||
}
|
||||
},
|
||||
resetQuery(){
|
||||
this.query = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue