Commit 59ede12e by caoyanzhi

update: 菜单框架

parent f1b4fb3b
......@@ -34,7 +34,7 @@ export default {
},
methods: {
toPage(menu) {
if (this.activedCode == menu.menuCode) return;
// if (this.$route.patch == '/' + menu.menuUrl) return;
this.$router.push('/' + menu.menuUrl);
}
}
......
......@@ -8,9 +8,9 @@
<!-- 页面内容 -->
<!-- <router-view v-if="activeBrand" :brandId="activeBrand" :activeGroupId="activeGroup" :tabType="activeTab" @showTab="showTab"></router-view> -->
<keep-alive v-if="$route.meta.keepAlive">
<router-view></router-view>
<router-view :brand-id="enterpriseId"></router-view>
</keep-alive>
<router-view v-else></router-view>
<router-view v-else :brand-id="enterpriseId"></router-view>
</div>
</div>
</div>
......@@ -30,6 +30,7 @@ export default {
data() {
return {
breadShow: true,
enterpriseId: '',
// 菜单树数据
menuList: [],
// 菜单平铺数据
......@@ -46,6 +47,7 @@ export default {
},
created() {
provideData.layoutVm = this;
this.enterpriseId = JSON.parse(sessionStorage.getItem('userInfos') || '{}').enterpriseId;
this.$on('command', this.onCommand);
this.$router.beforeEach((to, from, next) => {
this.activedMenu = this.getActivedMenu(this.getMenuByPath(to.path.slice(1)));
......
......@@ -19,6 +19,8 @@
<script>
import ChangeStore from './components/change-store.vue';
import UserInfo from './components/user-info.vue';
import { getRequest } from '@/api/api.js';
import errorMsg from '@/common/js/error.js';
export default {
name: 'main-menu',
components: { ChangeStore, UserInfo },
......@@ -42,6 +44,9 @@ export default {
applyCount: 0
};
},
created() {
this.updateAplyCount();
},
methods: {
toIndex() {
this.$router.push('/index');
......@@ -65,7 +70,14 @@ export default {
}
},
updateAplyCount() {
console.log('获取待审批数量');
getRequest('/haoban-manage3-web/audit/get-audit-count', {}).then(resp => {
const { errorCode, result } = resp.data || {};
if (errorCode != 1) {
errorMsg.errorMsg(resp.data);
return;
}
this.applyCount = result || 0;
});
}
}
};
......
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