diff --git a/src/components/scTable/index.vue b/src/components/scTable/index.vue index 490ec0c5..c1fcd76f 100644 --- a/src/components/scTable/index.vue +++ b/src/components/scTable/index.vue @@ -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) { diff --git a/src/views/hrm/employee.vue b/src/views/hrm/employee.vue index 2799d711..b7a9371e 100644 --- a/src/views/hrm/employee.vue +++ b/src/views/hrm/employee.vue @@ -14,7 +14,7 @@ - + @@ -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 = {} } } }