scTable resetQuery

This commit is contained in:
曹前明 2022-06-17 09:01:45 +08:00
parent e0bf4eef82
commit 5586dea490
2 changed files with 14 additions and 1 deletions

View File

@ -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) {

View File

@ -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 = {}
}
}
}