Commit d7f711175420f20630a0789c8670371249acafab

Authored by Aaron
1 parent ec612c9c
Exists in master and in 1 other branch legacy

调整Scheme点击查询按钮时重置页码为1

Showing 1 changed file with 5 additions and 2 deletions   Show diff stats
packages/scheme/index.vue
... ... @@ -81,7 +81,7 @@
81 81 <div class="eagle-scheme">
82 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 86 <template v-for="item in _searchList">
87 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 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 422 const { currPageAlias = 'currPage', pageSizeAlias = 'pageSize' } = this.option || {};
420 423 const fixedParams = this.option.params || {};
421 424 const param = {
... ...