商家端列表页缓存

This commit is contained in:
mabo
2021-07-31 15:49:54 +08:00
parent ad17d8b743
commit 8cec0e6ab8
30 changed files with 279 additions and 493 deletions

View File

@@ -54,7 +54,7 @@
</Poptip>
</template>
</Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="searchForm.pageNumber"
:total="total"
@@ -243,9 +243,14 @@
});
},
},
activated() {
mounted() {
this.init();
},
// 页面缓存处理从该页面离开时修改KeepAlive为false保证进入该页面是刷新
beforeRouteLeave(to, from, next) {
from.meta.keepAlive = false
next()
}
};
</script>
<style lang="scss">

View File

@@ -371,13 +371,20 @@ export default {
});
},
},
activated () {
mounted () {
this.id = this.$route.query.id;
this.getDetail();
this.accessToken = {
accessToken: this.getStore("accessToken"),
};
},
// 如果是从详情页返回列表页修改列表页keepAlive为true确保不刷新页面
beforeRouteLeave(to, from, next){
if(to.name === 'orderComplaint') {
to.meta.keepAlive = true
}
next()
}
};
</script>
<style lang="scss" scoped>

View File

@@ -77,7 +77,7 @@
</template>
</Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="searchForm.pageNumber"
:total="total"
@@ -279,9 +279,14 @@
},
},
activated () {
mounted () {
this.init();
},
// 页面缓存处理从该页面离开时修改KeepAlive为false保证进入该页面是刷新
beforeRouteLeave(to, from, next) {
from.meta.keepAlive = false
next()
}
};
</script>
<style lang="scss">

View File

@@ -79,7 +79,7 @@
</template>
</Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="searchForm.pageNumber"
:total="total"
@@ -260,7 +260,6 @@
this.loading = false;
if (res.success) {
this.data = res.result.records;
console.log(this.data)
this.total = res.result.total;
}
});
@@ -277,9 +276,14 @@
},
},
activated() {
mounted() {
this.init();
},
// 页面缓存处理从该页面离开时修改KeepAlive为false保证进入该页面是刷新
beforeRouteLeave(to, from, next) {
from.meta.keepAlive = false
next()
}
};
</script>
<style lang="scss">

View File

@@ -522,6 +522,13 @@ export default {
this.sn = this.$route.query.sn;
this.getDetail();
},
// 如果是从详情页返回列表页修改列表页keepAlive为true确保不刷新页面
beforeRouteLeave(to, from, next){
if(to.name === 'returnGoodsOrder' || to.name === 'returnMoneyOrder') {
to.meta.keepAlive = true
}
next()
}
};
</script>
<style lang="scss" scoped>

View File

@@ -817,6 +817,13 @@ export default {
this.sn = this.$route.query.sn;
this.getDataDetail();
},
// 如果是从详情页返回列表页修改列表页keepAlive为true确保不刷新页面
beforeRouteLeave(to, from, next){
if(to.name === 'orderList' || to.name === 'virtualOrderList') {
to.meta.keepAlive = true
}
next()
}
};
</script>
<style lang="scss" scoped>

View File

@@ -43,7 +43,7 @@
</download-excel>
</div>
<Table class="mt_10" :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
show-total show-elevator show-sizer></Page>
</Row>
@@ -298,9 +298,14 @@ export default {
});
},
},
activated() {
mounted() {
this.init();
},
// 页面缓存处理从该页面离开时修改KeepAlive为false保证进入该页面是刷新
beforeRouteLeave(to, from, next) {
from.meta.keepAlive = false
next()
}
};
</script>
<style lang="scss">

View File

@@ -41,7 +41,7 @@
</div>
<Table class="mt_10" :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
show-total show-elevator show-sizer></Page>
</Row>
@@ -261,9 +261,14 @@ export default {
});
},
},
activated() {
mounted() {
this.init();
},
// 页面缓存处理从该页面离开时修改KeepAlive为false保证进入该页面是刷新
beforeRouteLeave(to, from, next) {
from.meta.keepAlive = false
next()
}
};
</script>
<style lang="scss">

View File

@@ -28,7 +28,7 @@
<a @click="$router.push({name: 'order-detail',query: {sn: scope.row.orderSn}})">{{scope.row.orderSn}}</a>
</template>
</Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
show-total show-elevator show-sizer></Page>
</Row>
@@ -264,7 +264,7 @@ export default {
});
},
},
activated() {
mounted() {
this.init();
},
};