fix: 所有可搜索列表在非第1页搜索时不返回第1页的问题

This commit is contained in:
kuaifan 2022-03-23 10:12:37 +08:00
parent 24e9ff4c86
commit 6fba94594b
7 changed files with 40 additions and 11 deletions

View File

@ -22,7 +22,7 @@
placement="right" placement="right"
transfer-class-name="search-button-clear" transfer-class-name="search-button-clear"
transfer> transfer>
<Button :loading="loadIng > 0" type="primary" icon="ios-search" @click="getLists">{{$L('搜索')}}</Button> <Button :loading="loadIng > 0" type="primary" icon="ios-search" @click="onSearch">{{$L('搜索')}}</Button>
<div slot="content"> <div slot="content">
<Button :loading="loadIng > 0" type="text" @click="refresh">{{$L('刷新')}}</Button> <Button :loading="loadIng > 0" type="text" @click="refresh">{{$L('刷新')}}</Button>
</div> </div>
@ -199,6 +199,11 @@ export default {
this.getLists(); this.getLists();
}, },
onSearch() {
this.page = 1;
this.getLists();
},
getLists() { getLists() {
this.loadIng++; this.loadIng++;
this.$store.dispatch("call", { this.$store.dispatch("call", {

View File

@ -34,7 +34,7 @@
placement="right" placement="right"
transfer-class-name="search-button-clear" transfer-class-name="search-button-clear"
transfer> transfer>
<Button :loading="loadIng > 0" type="primary" icon="ios-search" @click="getLists">{{$L('搜索')}}</Button> <Button :loading="loadIng > 0" type="primary" icon="ios-search" @click="onSearch">{{$L('搜索')}}</Button>
<div slot="content"> <div slot="content">
<Button :loading="loadIng > 0" type="text" @click="getLists">{{$L('刷新')}}</Button> <Button :loading="loadIng > 0" type="text" @click="getLists">{{$L('刷新')}}</Button>
</div> </div>
@ -178,6 +178,10 @@ export default {
}, },
] ]
}, },
onSearch() {
this.page = 1;
this.getLists();
},
getLists() { getLists() {
let archived = 'all'; let archived = 'all';
if (this.keys.status == 'archived') { if (this.keys.status == 'archived') {

View File

@ -33,7 +33,7 @@
placement="right" placement="right"
transfer-class-name="search-button-clear" transfer-class-name="search-button-clear"
transfer> transfer>
<Button :loading="loadIng > 0" type="primary" icon="ios-search" @click="searchTab">{{$L('搜索')}}</Button> <Button :loading="loadIng > 0" type="primary" icon="ios-search" @click="onSearch">{{$L('搜索')}}</Button>
<div slot="content"> <div slot="content">
<Button :loading="loadIng > 0" type="text" @click="getLists">{{$L('刷新')}}</Button> <Button :loading="loadIng > 0" type="text" @click="getLists">{{$L('刷新')}}</Button>
</div> </div>
@ -154,6 +154,11 @@ export default {
] ]
}, },
onSearch() {
this.listPage = 1;
this.getLists();
},
getLists() { getLists() {
this.loadIng = 1; this.loadIng = 1;
this.$store.dispatch("call", { this.$store.dispatch("call", {

View File

@ -40,7 +40,7 @@
placement="right" placement="right"
transfer-class-name="search-button-clear" transfer-class-name="search-button-clear"
transfer> transfer>
<Button :loading="loadIng > 0" type="primary" icon="ios-search" @click="searchTab">{{$L('搜索')}}</Button> <Button :loading="loadIng > 0" type="primary" icon="ios-search" @click="onSearch">{{$L('搜索')}}</Button>
<div slot="content"> <div slot="content">
<Button :loading="loadIng > 0" type="text" @click="getLists">{{$L('刷新')}}</Button> <Button :loading="loadIng > 0" type="text" @click="getLists">{{$L('刷新')}}</Button>
</div> </div>
@ -178,6 +178,11 @@ export default {
] ]
}, },
onSearch() {
this.listPage = 1;
this.getLists();
},
getLists() { getLists() {
this.loadIng = 1; this.loadIng = 1;
this.$store.dispatch("call", { this.$store.dispatch("call", {
@ -216,10 +221,6 @@ export default {
this.getLists(); this.getLists();
} }
}, },
searchTab() {
this.getLists();
},
} }
} }
</script> </script>

View File

@ -22,7 +22,7 @@
placement="right" placement="right"
transfer-class-name="search-button-clear" transfer-class-name="search-button-clear"
transfer> transfer>
<Button :loading="loadIng > 0" type="primary" icon="ios-search" @click="getLists">{{$L('搜索')}}</Button> <Button :loading="loadIng > 0" type="primary" icon="ios-search" @click="onSearch">{{$L('搜索')}}</Button>
<div slot="content"> <div slot="content">
<Button :loading="loadIng > 0" type="text" @click="getLists">{{$L('刷新')}}</Button> <Button :loading="loadIng > 0" type="text" @click="getLists">{{$L('刷新')}}</Button>
</div> </div>
@ -238,6 +238,11 @@ export default {
this.getLists() this.getLists()
}, },
onSearch() {
this.page = 1;
this.getLists();
},
getLists() { getLists() {
if (!this.projectId) { if (!this.projectId) {
return; return;

View File

@ -22,7 +22,7 @@
placement="right" placement="right"
transfer-class-name="search-button-clear" transfer-class-name="search-button-clear"
transfer> transfer>
<Button :loading="loadIng > 0" type="primary" icon="ios-search" @click="getLists">{{$L('搜索')}}</Button> <Button :loading="loadIng > 0" type="primary" icon="ios-search" @click="onSearch">{{$L('搜索')}}</Button>
<div slot="content"> <div slot="content">
<Button :loading="loadIng > 0" type="text" @click="getLists">{{$L('刷新')}}</Button> <Button :loading="loadIng > 0" type="text" @click="getLists">{{$L('刷新')}}</Button>
</div> </div>
@ -186,6 +186,11 @@ export default {
this.getLists() this.getLists()
}, },
onSearch() {
this.page = 1;
this.getLists();
},
getLists() { getLists() {
if (!this.projectId) { if (!this.projectId) {
return; return;

View File

@ -48,7 +48,7 @@
placement="bottom" placement="bottom"
transfer-class-name="search-button-clear" transfer-class-name="search-button-clear"
transfer> transfer>
<Button :loading="loadIng > 0" type="primary" icon="ios-search" @click="getLists">{{$L('搜索')}}</Button> <Button :loading="loadIng > 0" type="primary" icon="ios-search" @click="onSearch">{{$L('搜索')}}</Button>
<div slot="content"> <div slot="content">
<Button :loading="loadIng > 0" type="text" @click="getLists">{{$L('刷新')}}</Button> <Button :loading="loadIng > 0" type="text" @click="getLists">{{$L('刷新')}}</Button>
</div> </div>
@ -286,6 +286,10 @@ export default {
} }
] ]
}, },
onSearch() {
this.page = 1;
this.getLists();
},
getLists() { getLists() {
this.loadIng++; this.loadIng++;
this.$store.dispatch("call", { this.$store.dispatch("call", {