Browse Source

修复登录系统后点击系统管理打开一个新的页面及点击平台首页和返回首页时返回系统首页

master
yunuo970428 3 years ago
parent
commit
7751ec8dc6
  1. 5
      anrui-system-ui/src/layout/components/Navbar.vue
  2. 97
      anrui-system-ui/src/layout/index.vue
  3. 36
      anrui-system-ui/src/views/Home/Home.vue

5
anrui-system-ui/src/layout/components/Navbar.vue

@ -29,8 +29,9 @@ export default {
},
methods: {
logout() {
this.$router.push({path: '/home'})
// window.opener=null;window.open('about:blank', '_top').close()
// this.$router.push({path: '/home'})
window.opener = null
window.open('about:blank', '_top').close()
}
}
}

97
anrui-system-ui/src/layout/index.vue

@ -1,19 +1,19 @@
<template>
<div :class="classObj" class="app-wrapper">
<div class="fixed-header">
<navbar />
</div>
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
<div class="fixed-header">
<navbar/>
</div>
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
<div class="main-container">
<div class="home-box">
<a href="javascript:window.opener=null;window.open('','_self');window.close();" class="text-center">平台首页</a>
<a href="javascript:void(0);" class="text-center">系统管理</a>
<a href="javascript:window.opener=null;window.open('','_self');window.close();" class="text-center">平台首页</a>
<a href="javascript:void(0);" class="text-center">系统管理</a>
</div>
<sidebar class="sidebar-container" /> <!--菜单-->
<sidebar class="sidebar-container"/> <!--菜单-->
<div class="TagsView">
<tags-view /> <!--横向标签-->
<tags-view/> <!--横向标签-->
</div>
<app-main />
<app-main/>
<!--<el-footer height="40px">Copyright © 2021 安瑞集团 All Rights Reserved</el-footer>-->
</div>
</div>
@ -50,57 +50,62 @@ export default {
methods: {
handleClickOutside() {
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
},
logout() {
this.$router.push({ path: '/home' })
}
}
}
</script>
<style lang="scss" scoped>
@import "~@/styles/mixin.scss";
@import "~@/styles/variables.scss";
@import "~@/styles/mixin.scss";
@import "~@/styles/variables.scss";
.app-wrapper {
@include clearfix;
position: relative;
height: 100%;
width: 100%;
&.mobile.openSidebar{
position: fixed;
top: 0;
}
}
.drawer-bg {
background: #000;
opacity: 0.3;
width: 100%;
top: 0;
height: 100%;
position: absolute;
z-index: 999;
}
.app-wrapper {
@include clearfix;
position: relative;
height: 100%;
width: 100%;
.fixed-header {
&.mobile.openSidebar {
position: fixed;
top: 0;
right: 0;
z-index: 9;
width: 100%;
transition: width 0.28s;
}
}
.drawer-bg {
background: #000;
opacity: 0.3;
width: 100%;
top: 0;
height: 100%;
position: absolute;
z-index: 999;
}
// .hideSidebar .fixed-header {
// width: calc(100% - 54px)
// }
.fixed-header {
position: fixed;
top: 0;
right: 0;
z-index: 9;
width: 100%;
transition: width 0.28s;
}
.mobile .fixed-header {
width: 100%;
}
// .hideSidebar .fixed-header {
// width: calc(100% - 54px)
// }
.el-footer {
line-height: 40px;
text-align: center;
background-color: #f7f9fc;
}
.mobile .fixed-header {
width: 100%;
}
.el-footer {
line-height: 40px;
text-align: center;
background-color: #f7f9fc;
}
</style>

36
anrui-system-ui/src/views/Home/Home.vue

@ -90,8 +90,6 @@
<p>{{ item.sourceName }}</p>
</li>
</template>-->
<!-- <li style="background-color: #e87861;" @click="toNavbar('http://39.104.100.138:8081/')">
<img src="@/assets/images/jcxx.png">
<p>基础信息</p>
@ -173,34 +171,34 @@
data() {
return {
menus: [{
imgUrl: require("@/assets/home/bIcon1.png"),
imgUrl: require('@/assets/home/bIcon1.png'),
title: '业务管理'
}, {
imgUrl: require("@/assets/home/scm.png"),
imgUrl: require('@/assets/home/scm.png'),
title: '供应链管理'
}, {
imgUrl: require("@/assets/home/bIcon2.png"),
imgUrl: require('@/assets/home/bIcon2.png'),
title: '风控管理'
}, {
imgUrl: require("@/assets/home/bIcon3.png"),
imgUrl: require('@/assets/home/bIcon3.png'),
title: '审计管理'
}, {
imgUrl: require("@/assets/home/bIcon4.png"),
imgUrl: require('@/assets/home/bIcon4.png'),
title: '财务管理'
}, {
imgUrl: require("@/assets/home/bIcon5.png"),
imgUrl: require('@/assets/home/bIcon5.png'),
title: '行政管理'
}, {
imgUrl: require("@/assets/home/bIcon6.png"),
imgUrl: require('@/assets/home/bIcon6.png'),
title: '报表中心'
}, {
imgUrl: require("@/assets/home/bIcon7.png"),
imgUrl: require('@/assets/home/bIcon7.png'),
title: '基础信息'
}, {
imgUrl: require("@/assets/home/notice.png"),
imgUrl: require('@/assets/home/notice.png'),
title: '消息中心'
}, {
imgUrl: require("@/assets/home/bIcon8.png"),
imgUrl: require('@/assets/home/bIcon8.png'),
title: '系统管理'
}],
userInfo: {},
@ -222,11 +220,11 @@
},
methods: {
todowork() {
this.$router.push({path: '/todo' + '?token=' + getStorage()})
this.$router.push({ path: '/todo' + '?token=' + getStorage() })
// window.open('http://127.0.0.1/message'+'?token='+getStorage(),'_blank')
},
donework() {
this.$router.push({path: '/done' + '?token=' + getStorage()})
this.$router.push({ path: '/done' + '?token=' + getStorage() })
// window.open('http://127.0.0.1/message'+'?token='+getStorage(),'_blank')
},
logout() {
@ -235,24 +233,26 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
User.logout({token: getStorage()}).then(res => {
User.logout({ token: getStorage() }).then(res => {
removeStorage()
this.$store.commit('user/SET_UESRINFO', '')
this.$router.push({path: '/login'})
this.$router.push({ path: '/login' })
})
})
},
xxzx() {
this.$alert('项目正在开发中', '提示', {
dangerouslyUseHTMLString: true
});
})
},
toNavbar(name) {
let myPopup = window.open(name + '?token=' + getStorage(), '_blank')
},
toNav(index, name, titleName) {
console.log(index, 9999)
if (index == '9') {
this.$router.push({path: '/index'})
// this.$router.push({path: '/index'})
let myPopup = window.open('/#/index', '_blank')
} else if (index == '7') {
let myPopup = window.open('http://120.46.131.15/base' + '?token=' + getStorage(), '_blank')
} else if (index == '8') {

Loading…
Cancel
Save