Commit d7f711175420f20630a0789c8670371249acafab
1 parent
ec612c9c
Exists in
master
and in
1 other branch
调整Scheme点击查询按钮时重置页码为1
Showing
1 changed file
with
5 additions
and
2 deletions
Show diff stats
packages/scheme/index.vue
| @@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
| 81 | <div class="eagle-scheme"> | 81 | <div class="eagle-scheme"> |
| 82 | <div v-if="option.showSearch !== false" class="eagle-scheme__card"> | 82 | <div v-if="option.showSearch !== false" class="eagle-scheme__card"> |
| 83 | <!-- 搜索表单 --> | 83 | <!-- 搜索表单 --> |
| 84 | - <component :is="_searchComponent" :list="_searchList" v-model="searchModel" :span="searchProps.span || 6" :formProps="searchProps" @search="handleSearch" :searching="tableLoading"> | 84 | + <component :is="_searchComponent" :list="_searchList" v-model="searchModel" :span="searchProps.span || 6" :formProps="searchProps" @search="value => handleSearch(value, true)" :searching="tableLoading"> |
| 85 | <!-- 搜索表单项具名插槽 --> | 85 | <!-- 搜索表单项具名插槽 --> |
| 86 | <template v-for="item in _searchList"> | 86 | <template v-for="item in _searchList"> |
| 87 | <slot v-if="$scopedSlots[`search-${item.key}`] || $slots[`search-${item.key}`]" :name="`search-${item.key}`" :slot="item.key" :model="searchModel"></slot> | 87 | <slot v-if="$scopedSlots[`search-${item.key}`] || $slots[`search-${item.key}`]" :name="`search-${item.key}`" :slot="item.key" :model="searchModel"></slot> |
| @@ -415,7 +415,10 @@ export default { | @@ -415,7 +415,10 @@ export default { | ||
| 415 | this.$forceUpdate(); | 415 | this.$forceUpdate(); |
| 416 | }, | 416 | }, |
| 417 | // 查询数据 | 417 | // 查询数据 |
| 418 | - async handleSearch(value) { | 418 | + async handleSearch(value, isReset) { |
| 419 | + if (isReset) { | ||
| 420 | + this.currentPage = 1; | ||
| 421 | + } | ||
| 419 | const { currPageAlias = 'currPage', pageSizeAlias = 'pageSize' } = this.option || {}; | 422 | const { currPageAlias = 'currPage', pageSizeAlias = 'pageSize' } = this.option || {}; |
| 420 | const fixedParams = this.option.params || {}; | 423 | const fixedParams = this.option.params || {}; |
| 421 | const param = { | 424 | const param = { |