From 5586dea490ea630a9094000eda90278a8f3f3714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Fri, 17 Jun 2022 09:01:45 +0800 Subject: [PATCH] scTable resetQuery --- src/components/scTable/index.vue | 9 +++++++++ src/views/hrm/employee.vue | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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 = {} } } }