Commit 2cd0b7a5 by 曾经

Merge branch 'feature/停复机1' into test

* feature/停复机1:
  提示 占用 高度计算
  移动横栏位置 不改变框架高度计算
  好办功能即将到期提示
  消息通知组件

# Conflicts:
#	src/components/layout/index.vue
parents 60b0b3c9 2afbd796
......@@ -49,7 +49,7 @@ export default {
margin-right: 16px;
padding: 8px 10px;
width: 190px;
height: calc(100vh - 60px);
height: calc(100% - 60px);
box-sizing: border-box;
overflow-y: auto;
.aside-menu-list {
......
<template>
<div>
<notice></notice>
<div class="hb-layout" v-loading="fullLoading.visible">
<notice @showNotice="_ => (isShowNotice = _)" />
<div class="hb-layout" :style="{ height: isShowNotice ? 'calc(100vh - 42px)' : '100vh' }" v-loading="fullLoading.visible">
<main-menu ref="mainMenu" :menu-list="menuList" :actived-code="activedMenu.length > 0 ? activedMenu[0].menuCode : ''" @showLoading="onShowLoading"></main-menu>
<aside-menu v-show="showAside" :menu-list="activedMenu.length > 0 ? activedMenu[0].childList : []" :actived-code="activedMenu.length > 2 ? activedMenu[2].menuCode : ''"></aside-menu>
<div class="hb-layout-content" :style="{ width: showAside ? 'calc(100% - 206px)' : '100%' }">
......@@ -9,9 +9,10 @@
<div class="hb-layout-pager" id="hb-layout-pager-one" :style="{ height: activedMenu.length > 3 ? `calc(100% - 30px)` : '100%', 'padding-bottom': pagePaddingBottom }">
<!-- 页面内容 -->
<!-- <router-view v-if="activeBrand" :brandId="activeBrand" :activeGroupId="activeGroup" :tabType="activeTab" @showTab="showTab"></router-view> -->
<keep-alive :include="keepAlive">
<router-view :key="$route.path" :brand-id="enterpriseId"></router-view>
<keep-alive>
<router-view :brand-id="enterpriseId" v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive" :brand-id="enterpriseId"></router-view>
</div>
</div>
</div>
......@@ -43,7 +44,7 @@ export default {
},
data() {
return {
keepAlive: [],
isShowNotice: false,
showAside: true,
pagePaddingBottom: null,
enterpriseId: '',
......@@ -69,10 +70,8 @@ export default {
}
},
created() {
this.setKeepAlive(this.$route, {});
this.$router.beforeEach((to, from, next) => {
this.activedMenu = this.getActivedMenu(this.getMenuByPath(to.path.slice(1)));
this.setKeepAlive(to, from);
next();
});
provideData.layoutVm = this;
......@@ -121,32 +120,6 @@ export default {
getMenuByPath(path) {
return this.pageRight.find(el => el.regexp.test('/' + path)) || {};
},
setKeepAlive(to, from) {
if (Array.isArray(to.meta.fromPath)) {
const isKeepAlive = to.meta.fromPath.some(el => {
let menuUrlReg = el;
let pathConfigReg = /(:.*)(\/?)/;
const pathRegStr = '([\\d\\w]+[\\-]*[\\d\\w]*)';
while (pathConfigReg.test(menuUrlReg)) {
menuUrlReg = menuUrlReg.replace(pathConfigReg, `${pathRegStr}$2`);
}
pathConfigReg = /(\/\*)(\/?)/;
while (pathConfigReg.test(menuUrlReg)) {
menuUrlReg = menuUrlReg.replace(pathConfigReg, `${pathRegStr}$2`);
}
const reg = new RegExp(`^${menuUrlReg}$`);
return reg.test(from.path);
});
if (!isKeepAlive) {
this.keepAlive = this.keepAlive.filter(el => el != to.meta.componentName);
}
setTimeout(() => {
if (this.keepAlive.every(el => el != to.meta.componentName)) {
this.keepAlive.push(to.meta.componentName);
}
}, 100);
}
},
onShowLoading(loading) {
if (loading) {
this.fullLoading.visible = true;
......@@ -190,7 +163,7 @@ export default {
overflow-x: auto;
.hb-layout-content {
padding-top: 20px;
height: calc(100vh - 60px);
height: calc(100% - 60px);
box-sizing: border-box;
.hb-layout-pager {
height: 100%;
......
......@@ -82,10 +82,7 @@ export default {
let { otherExpireServices, expireStatus, expireDayStr } = result;
otherExpireServices = otherExpireServices || [];
if (expireStatus == 1) {
this.expireTip.content = `${service.serviceName}将于 ${expireDayStr} 到期,到期后将被冻结无法登录,请及时联系运营人员续费。`;
this.expireTip.show = true;
} else if (otherExpireServices.length) {
this.expireTip.content = `${otherExpireServices[0].serviceName}将于 ${otherExpireServices[0].expireDayStr} 到期,到期后功能无法使用,请及时联系运营人员续费。`;
this.expireTip.content = `${service.serviceName}将于 ${expireDayStr} 到期,到期后功能无法使用,请及时联系运营人员续费。`;
this.expireTip.show = true;
}
this.expireTip.showButton = otherExpireServices.length && serviceType == 11;
......@@ -113,6 +110,11 @@ export default {
toRecharge() {
window.open(location.origin + '/marketing/#/recharge/do');
}
},
watch: {
showNotice(n) {
this.$emit('showNotice', n);
}
}
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment