商家端列表页缓存

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

View File

@ -1,511 +1,313 @@
export const result = [
{
export const result = [{
name: "lili",
level: 0,
type: -1,
title: "商品",
path: "",
component: "",
icon: "md-home",
isMenu: true,
url: "",
description: "",
permTypes: [],
children: [
{
children: [{
name: "goods-list",
level: 1,
type: 0,
title: "商品管理",
path: "",
component: "Main",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: [
{
children: [{
name: "goods-operation",
level: 2,
type: 0,
title: "商品发布",
path: "goods-operation",
component: "goods-operation",
icon: "md-person",
isMenu: true,
url: "",
children: null,
permTypes: []
},
{
name: "goods",
level: 2,
type: 0,
title: "商品列表",
path: "goods",
component: "goods/goods-seller/goods",
icon: "md-person",
isMenu: true,
url: "",
children: null,
permTypes: []
},
// {
// name: "daft-goods",
//
// level: 2,
// type: 0,
// title: "草稿商品",
// path: "daft-goods",
// component: "goods/goods-seller/draftGoods",
// icon: "md-person",
// isMenu: true,
// url: "",
// children: null,
// permTypes: []
// },
{
path: "template-goods",
props: {type: "TEMPLATE"},
props: {
type: "TEMPLATE"
},
level: 2,
type: 0,
title: "商品模版",
component: "goods/goods-seller/draftGoods",
icon: "md-person",
isMenu: true,
url: "",
name: "template-goods",
children: null,
permTypes: []
},
{
name: "category",
level: 2,
type: 0,
title: "店铺分类",
path: "category",
component: "goods/goods-manage/category",
icon: "md-person",
isMenu: true,
url: "",
children: null,
permTypes: []
}
]
}
]
}]
},
{
name: "order",
level: 0,
type: -1,
title: "订单",
path: "",
component: "",
icon: "md-home",
isMenu: true,
url: "",
description: "",
permTypes: [],
children: [
{
children: [{
name: "order",
level: 1,
type: 0,
title: "订单管理",
path: "/order",
component: "Main",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: [
{
children: [{
name: "orderList",
level: 2,
type: 0,
keepAlive: true,
title: "商品订单",
path: "orderList",
component: "order/order/orderList",
icon: "md-person",
isMenu: true,
url: "",
children: null,
permTypes: []
},
{
name: "virtualOrderList",
level: 2,
type: 0,
keepAlive: true,
title: "虚拟订单",
path: "virtualOrderList",
component: "order/order/virtualOrderList",
icon: "md-person",
isMenu: true,
url: "",
children: null,
permTypes: []
children: null
}
]
},
{
name: "memberComment",
level: 1,
type: 0,
title: "评价管理",
path: "/order",
component: "Main",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: [
{
children: [{
name: "memberComment",
level: 2,
type: 0,
title: "评价管理",
path: "memberComment",
component: "member/memberComment",
icon: "md-person",
isMenu: true,
url: "",
children: null,
permTypes: []
}
]
}]
},
{
name: "order",
level: 1,
type: 0,
title: "售后管理",
path: "/order",
component: "Main",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: [
{
children: [{
name: "returnGoodsOrder",
level: 2,
type: 0,
keepAlive: true,
title: "退货管理",
path: "returnGoodsOrder",
component: "order/after-order/returnGoodsOrder",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
},
{
name: "returnMoneyOrder",
level: 2,
type: 0,
keepAlive: true,
title: "退款管理",
path: "returnMoneyOrder",
component: "order/after-order/returnMoneyOrder",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
},
{
name: "orderComplaint",
level: 2,
type: 0,
keepAlive: true,
title: "投诉管理",
path: "orderComplaint",
component: "order/after-order/orderComplaint",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
}
]
}
]
},
{
name: "bill",
level: 0,
type: -1,
title: "财务",
path: "",
component: "",
icon: "md-home",
isMenu: true,
url: "",
description: "",
permTypes: [],
children: [
{
children: [{
name: "bill",
level: 1,
type: 0,
title: "财务管理",
path: "/bill",
component: "Main",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: [
{
children: [{
name: "accountStatementBill",
level: 2,
type: 0,
keepAlive: true,
title: "财务对账",
path: "accountStatementBill",
component: "shop/bill/accountStatementBill",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
},
{
name: "storeBill",
level: 2,
type: 0,
keepAlive: true,
title: "店铺结算",
path: "storeBill",
component: "shop/bill/storeBill",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
}
]
},
{
name: "receiptManager",
level: 1,
type: 0,
title: "发票管理",
path: "/bill",
component: "Main",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: [
{
children: [{
name: "receipt",
level: 2,
type: 0,
title: "发票管理",
path: "receipt",
component: "order/receiptManager/receipt",
icon: "md-person",
isMenu: true,
url: "",
children: null,
permTypes: []
}
]
children: null
}]
}
]
},
{
name: "promotion",
level: 0,
type: -1,
title: "营销",
path: "",
component: "",
icon: "md-home",
isMenu: true,
url: "",
description: "",
permTypes: [],
children: [
{
children: [{
name: "promotion",
level: 1,
type: 0,
title: "平台活动",
path: "/promotion",
component: "Main",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: [
{
children: [{
name: "pintuan",
level: 2,
type: 0,
keepAlive: true,
title: "拼团活动",
path: "pintuan",
component: "promotion/pintuan/pintuan",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
},
{
name: "seckill",
level: 2,
type: 0,
keepAlive: true,
title: "秒杀活动",
path: "seckill",
component: "promotion/seckill/seckill",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
}
]
},
{
name: "lives",
level: 1,
type: 0,
title: "直播活动",
path: "/promotion",
component: "Main",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: [
{
children: [{
name: "live",
level: 2,
type: 0,
title: "直播管理",
path: "live",
component: "promotion/live/live",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
},
{
name: "liveGoods",
level: 2,
type: 0,
title: "直播商品",
path: "liveGoods",
component: "promotion/live/liveGoods",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
}
]
},
{
name: "storePromotion",
level: 1,
type: 0,
title: "商家活动",
path: "/storePromotion",
component: "Main",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: [
{
children: [{
name: "full-cut",
level: 2,
type: 0,
title: "满额活动",
path: "full-cut",
component: "promotion/fullCut/fullCut",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
},
{
name: "coupon",
level: 2,
type: 0,
title: "优惠券",
path: "coupon",
component: "promotion/coupon/coupon",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
},
]
},
{
name: "distribution",
level: 1,
type: 0,
title: "分销管理",
path: "/distribution",
component: "Main",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: [
{
children: [{
name: "distributionGoods",
level: 2,
type: 0,
title: "分销商品",
path: "distributionGoods",
component: "distribution/distributionGoods",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
},
{
@ -515,17 +317,12 @@ export const result = [
title: "分销订单",
path: "distributionOrder",
component: "distribution/distributionOrder",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
}
]
}
]
},
{
name: "statistics",
level: 0,
@ -533,35 +330,20 @@ export const result = [
title: "统计",
path: "",
component: "",
icon: "md-home",
isMenu: true,
url: "",
description: "",
permTypes: [],
children: [
{
children: [{
name: "statistics",
level: 1,
type: 0,
title: "统计管理",
path: "/statistics",
component: "Main",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: [
{
children: [{
name: "goodsStatistics",
level: 2,
type: 0,
title: "商品统计",
path: "goodsStatistics",
component: "statistics/goods",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
},
{
@ -571,10 +353,6 @@ export const result = [
title: "订单统计",
path: "orderStatistics",
component: "statistics/order",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
},
{
@ -584,17 +362,11 @@ export const result = [
title: "流量统计",
path: "trafficStatistics",
component: "statistics/traffic",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
},
]
}
]
}]
},
{
name: "settings",
level: 0,
@ -602,22 +374,14 @@ export const result = [
title: "设置",
path: "",
component: "",
icon: "md-home",
isMenu: true,
url: "",
description: "",
children: [
{
children: [{
name: "user-manage",
level: 1,
type: 0,
title: "页面设置",
path: "user-manage",
component: "sys/user-manage/userManage",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: []
},
{
@ -627,22 +391,13 @@ export const result = [
title: "配送设置",
path: "",
component: "Main",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: [
{
children: [{
name: "shipTemplate",
level: 2,
type: 0,
title: "配送模板",
path: "shipTemplate",
component: "shop/ship/shipTemplate",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
},
{
@ -652,10 +407,6 @@ export const result = [
title: "物流公司",
path: "logistics",
component: "shop/ship/logistics",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
}
]
@ -667,88 +418,52 @@ export const result = [
title: "店铺管理",
path: "/shop",
component: "Main",
icon: "md-person",
isMenu: true,
url: "",
description: "",
children: [
{
children: [{
name: "shopSetting",
level: 2,
type: 0,
title: "店铺设置",
path: "shopSetting",
component: "shop/shopSetting",
icon: "md-log-in",
isMenu: true,
url: null,
description: null,
children: null,
permTypes: []
},
{
name: "shopAddress",
level: 2,
type: 0,
title: "自提管理",
path: "shopAddress",
component: "shop/shopAddress",
icon: "md-log-in",
isMenu: true,
url: null,
description: null,
children: null,
permTypes: []
}
]
}
]
},
{
name: "messages",
level: 0,
type: -1,
title: "消息",
path: "",
component: "",
icon: "md-home",
isMenu: true,
url: "",
description: "",
children: [
{
children: [{
name: "user-manage",
level: 1,
type: 0,
title: "系统消息",
path: "user-manage",
component: "sys/user-manage/userManage",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: [
{
children: [{
name: "message_index",
level: 2,
type: 0,
title: "系统消息",
path: "message",
component: "message",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
}
]
}
]
}]
}]
}
];

View File

@ -1,7 +1,4 @@
import axios from 'axios';
import { getMenuList } from '@/api/index';
import lazyLoading from './lazyLoading.js';
import router from '@/router/index';
import Cookies from "js-cookie";
import { result } from './routerJson.js';
@ -233,7 +230,6 @@ util.openNewPage = function (vm, name, argu, query) {
if (query) {
tag.query = query;
}
console.log(tag);
vm.$store.commit('increateTag', tag);
}
}
@ -399,7 +395,6 @@ util.initMenuData = function (vm, data) {
let nav = {
name: e.name,
title: e.title,
icon: e.icon
}
navList.push(nav);
})
@ -450,20 +445,17 @@ util.initRouterNode = function (routers, data) { // data为所有子菜单数
for (var item of data) {
let menu = Object.assign({}, item);
// menu.component = import(`@/views/${menu.component}.vue`);
menu.component = lazyLoading(menu.component);
if (item.children && item.children.length > 0) {
menu.children = [];
util.initRouterNode(menu.children, item.children);
}
let meta = {};
// 给页面添加权限、标题、第三方网页链接
meta.permTypes = menu.permTypes ? menu.permTypes : null;
// 给页面添加标题
meta.title = menu.title ? menu.title + " - lilishop商家后台" : null;
meta.url = menu.url ? menu.url : null;
meta.firstRouterName = item.firstRouterName
meta.firstRouterName = menu.firstRouterName
meta.keepAlive = menu.keepAlive ? true : false
menu.meta = meta;
routers.push(menu);

View File

@ -11,14 +11,6 @@
.select-clear {
margin-left: 10px;
}
.page {
margin-top: 2vh;
}
.drop-down {
margin-left: 5px;
}
}
.tree-list {

View File

@ -39,9 +39,12 @@
</div>
<div class="single-page-con">
<div class="single-page">
<keep-alive :include="cachePage">
<router-view></router-view>
<!-- <keep-alive :include="cachePage"> -->
<!-- </keep-alive> -->
<keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive"></router-view>
</div>
</div>
<!-- 全局加载动画 -->
@ -65,7 +68,7 @@ export default {
data() {
return {
sliceNum: 5, // nav
userInfo: "", //
userInfo: {}, //
navType: 1, // nav
};
},

View File

@ -35,7 +35,7 @@
</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>
</Card>

View File

@ -12,7 +12,7 @@
</Form>
<Table class="mt_10" :loading="loading" border :columns="columns" :data="data" ref="table"></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>

View File

@ -60,7 +60,7 @@
class="mt_10"
sortable="custom"
></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="searchForm.pageNumber"
:total="total"
@ -106,7 +106,7 @@ export default {
{
title: "商品原图",
key: "original",
width: 150,
width: 120,
align: "center",
render: (h, params) => {
return h("img", {

View File

@ -64,7 +64,7 @@
</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>
@ -664,7 +664,7 @@ export default {
mounted() {
this.init();
},
activated() {
mounted() {
this.init();
},
};

View File

@ -50,7 +50,6 @@ export default {
//
$route: {
handler: function (val, oldVal) {
console.log(val);
if (val.meta.firstRouterName && val.meta.firstRouterName !== this.currNav) {
this.selectNav(val.meta.firstRouterName)
}

View File

@ -49,7 +49,7 @@
ref="table"
class="mt_10"
></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="searchForm.pageNumber"
:total="total"
@ -369,7 +369,7 @@ export default {
});
},
},
activated() {
mounted() {
this.init();
},
};

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();
},
// KeepAlivefalse
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"),
};
},
// keepAlivetrue
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();
},
// KeepAlivefalse
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();
},
// KeepAlivefalse
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();
},
// keepAlivetrue
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();
},
// keepAlivetrue
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();
},
// KeepAlivefalse
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();
},
// KeepAlivefalse
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();
},
};

View File

@ -29,10 +29,9 @@
<template slot-scope="{ row }" slot="action">
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="info" size="small" :style="{'marginRight': row.promotionStatus !== 'CLOSE'?'5px':'0'}" @click="edit(row)"></Button>
<Button v-if="row.promotionStatus !== 'CLOSE'" type="error" size="small" @click="remove(row)"></Button>
<!-- <Button v-if="row.promotionStatus === 'CLOSE' || row.promotionStatus === 'NEW'" type="success" size="small" @click="open(row)"></Button> -->
</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>
@ -337,7 +336,7 @@ export default {
});
},
},
activated() {
mounted() {
this.init();
},
};

View File

@ -296,8 +296,13 @@ export default {
});
},
},
activated () {
mounted () {
this.init();
},
// KeepAlivefalse
beforeRouteLeave(to, from, next) {
from.meta.keepAlive = false
next()
}
};
</script>

View File

@ -25,7 +25,7 @@
</Tabs>
<Table :columns="liveColumns" :data="liveData"></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="changePageNumber" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page>
</Row>

View File

@ -98,7 +98,7 @@
</div>
</template>
</Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="searchForm.pageNumber + 1"
:total="total"
@ -329,9 +329,14 @@ export default {
});
},
},
activated() {
mounted() {
this.init();
},
// KeepAlivefalse
beforeRouteLeave(to, from, next) {
from.meta.keepAlive = false
next()
}
};
</script>
<style lang="scss">

View File

@ -285,6 +285,13 @@ export default {
mounted () {
this.init();
},
// keepAlivetrue
beforeRouteLeave(to, from, next){
if(to.name === 'pintuan') {
to.meta.keepAlive = true
}
next()
}
};
</script>
<style lang="scss" scoped>

View File

@ -56,7 +56,7 @@
>
</template>
</Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page :current="searchForm.pageNumber + 1" :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>
@ -206,8 +206,13 @@ export default {
return hourArr;
},
},
activated() {
mounted() {
this.init();
},
// KeepAlivefalse
beforeRouteLeave(to, from, next) {
from.meta.keepAlive = false
next()
}
};
</script>
@ -223,11 +228,5 @@ export default {
.select-clear {
margin-left: 10px;
}
.page {
margin-top: 2vh;
}
.drop-down {
margin-left: 5px;
}
}
</style>

View File

@ -395,6 +395,13 @@ export default {
mounted() {
this.init();
},
// keepAlivetrue
beforeRouteLeave(to, from, next){
if(to.name === 'seckill') {
to.meta.keepAlive = true
}
next()
}
};
</script>
<style lang="scss" scoped>

View File

@ -42,7 +42,7 @@
:data="data"
ref="table"
></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="searchForm.pageNumber"
:total="total"
@ -213,9 +213,14 @@
},
},
activated() {
mounted() {
this.init();
},
// KeepAlivefalse
beforeRouteLeave(to, from, next) {
from.meta.keepAlive = false
next()
}
};
</script>
<style lang="scss" scoped>

View File

@ -40,7 +40,7 @@
:data="orderData"
ref="table"
></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="orderParam.pageNumber"
:total="orderTotal"
@ -61,7 +61,7 @@
:data="refundData"
ref="table"
></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="refundParam.pageNumber"
:total="refundTotal"
@ -82,7 +82,7 @@
:data="distributionData"
ref="table"
></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="distributionParam.pageNumber"
:total="distributionTotal"
@ -604,6 +604,13 @@ export default {
mounted() {
this.init();
},
// keepAlivetrue
beforeRouteLeave(to, from, next){
if(to.name === 'accountStatementBill' || to.name === 'storeBill') {
to.meta.keepAlive = true
}
next()
}
};
</script>

View File

@ -48,7 +48,7 @@
ref="table"
class="mt_10"
></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="searchForm.pageNumber"
:total="total"
@ -179,6 +179,7 @@
},
//
changePageSize(v) {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = v;
this.getDataList();
},
@ -218,9 +219,14 @@
},
},
activated () {
mounted () {
this.init();
},
// KeepAlivefalse
beforeRouteLeave(to, from, next) {
from.meta.keepAlive = false
next()
}
};
</script>
<style lang="scss" scoped>

View File

@ -152,7 +152,7 @@
<div>
<Table stripe :columns="columns" :data="data"></Table>
</div>
<Page @on-change="(index)=>{refundParams.pageNumber = index}" @on-page-size-change="(size)=>{refundParams.pageSize= size}" class="page" show-total show-elevator :total="total" />
<Page @on-change="(index)=>{refundParams.pageNumber = index}" @on-page-size-change="(size)=>{refundParams.pageSize= size}" class="mt_10" show-total show-elevator :total="total" />
</div>
</Card>