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: { methods: {
logout() { logout() {
this.$router.push({path: '/home'}) // this.$router.push({path: '/home'})
// window.opener=null;window.open('about:blank', '_top').close() window.opener = null
window.open('about:blank', '_top').close()
} }
} }
} }

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

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

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

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

Loading…
Cancel
Save