Browse Source

左侧图标跳转main

pull/12/head
juzi 1 year ago
parent
commit
0567df8d68
2 changed files with 9 additions and 5 deletions
  1. +8
    -4
      src/layout/components/Navbar.vue
  2. +1
    -1
      src/views/wmsHome/index.vue

+ 8
- 4
src/layout/components/Navbar.vue View File

@@ -2,7 +2,7 @@
<div class="navbar" :style="showTitle ? 'background: rgba(8,17,50,0.25)' : ''" style="padding-right: 23px;"> <div class="navbar" :style="showTitle ? 'background: rgba(8,17,50,0.25)' : ''" style="padding-right: 23px;">
<hamburger v-if="showhome" id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> <hamburger v-if="showhome" id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />


<div v-if="showTitle" style="color: #fff;font-size: 22px; float: left; letter-spacing: 1px; font-weight: 500; padding-left: 24px; marginTop: 5px">
<div v-if="showTitle" style="color: #fff;font-size: 22px; float: left; letter-spacing: 1px; font-weight: 500; padding-left: 24px; marginTop: 5px; cursor: pointer;" @click="toHome">
<img src="../../assets/img/cnbm.png" style="width: 26px; height: 26px; position: relative; top: 6px; marginRight: 14px" alt=""> <img src="../../assets/img/cnbm.png" style="width: 26px; height: 26px; position: relative; top: 6px; marginRight: 14px" alt="">
{{ 'title' | i18nFilter }} {{ 'title' | i18nFilter }}
</div> </div>
@@ -56,7 +56,7 @@
{{ 'navbar.profile' | i18nFilter }} {{ 'navbar.profile' | i18nFilter }}
</el-dropdown-item> </el-dropdown-item>
</router-link> </router-link>
<el-dropdown-item @click.native="toHome">
<el-dropdown-item @click.native="toMain">
<svg-icon class="item-icon" icon-class="help" /> <svg-icon class="item-icon" icon-class="help" />
{{ 'navbar.help' | i18nFilter }} {{ 'navbar.help' | i18nFilter }}
</el-dropdown-item> </el-dropdown-item>
@@ -210,11 +210,15 @@ export default {
this.$router.push(`/login?redirect=${this.$route.fullPath}`) this.$router.push(`/login?redirect=${this.$route.fullPath}`)
clearInterval(logoutInterval) clearInterval(logoutInterval)
}, },
toMain() {
this.$store.dispatch('app/setChoicepart')
this.$router.push('/')
},
async toHome() { async toHome() {
// this.$store.dispatch('app/setChoicepart') // this.$store.dispatch('app/setChoicepart')
// this.$router.push('/') // this.$router.push('/')
if (localStorage.getItem('param')) {
const param = JSON.parse(window.atob(localStorage.getItem('param')))
if (sessionStorage.getItem('param')) {
const param = JSON.parse(window.atob(sessionStorage.getItem('param')))
window.location = 'https://www.baidu.com/?' + param window.location = 'https://www.baidu.com/?' + param
} }
}, },


+ 1
- 1
src/views/wmsHome/index.vue View File

@@ -49,7 +49,7 @@ export default {
const path = location.href const path = location.href
if (path.indexOf('?') !== -1) { if (path.indexOf('?') !== -1) {
const param = path.split('?') const param = path.split('?')
localStorage.setItem('param', window.btoa(JSON.stringify(param[1])))
sessionStorage.setItem('param', window.btoa(JSON.stringify(param[1])))
} }
}, },
methods: { methods: {


Loading…
Cancel
Save