修改登录涟计划以及大屏等其他系统时,主系统也跳转的问题

This commit is contained in:
ival 2019-08-12 15:39:29 +08:00
parent 9c51afb419
commit dbd1193679
5 changed files with 101 additions and 83 deletions

View File

@ -3,16 +3,25 @@
<el-menu-item v-for="item in entryList" :key="item.name" class="avatar-wrapper" index="" @click="item.handle"> <el-menu-item v-for="item in entryList" :key="item.name" class="avatar-wrapper" index="" @click="item.handle">
<span style="color: white;">{{ item.name }}</span> <span style="color: white;">{{ item.name }}</span>
</el-menu-item> </el-menu-item>
<deomon-list ref="deomonList" />
</div> </div>
</template> </template>
<script> <script>
import DeomonList from '@/views/demonstration/deomonList';
export default { export default {
name: 'Entry', name: 'Entry',
components: {
DeomonList
},
data() { data() {
return { return {
entryList: [ entryList: [
{
name: '快速入口',
handle: this.quickEntry
}
], ],
stomp: null, stomp: null,
header: null header: null
@ -28,6 +37,9 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
quickEntry() {
this.$refs.deomonList.doShow();
}
} }
}; };
</script> </script>

View File

@ -8,59 +8,64 @@
text-color="#fff" text-color="#fff"
active-text-color="#ffd04b" active-text-color="#ffd04b"
> >
<template v-for="item in routers" v-if="!item.hidden&&item.children"> <template v-for="(item,idx) in routers">
<template v-if="!item.hidden&&item.children">
<template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow"> <template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow">
<el-menu-item :index="item.redirect"> <template>
<el-menu-item :key="idx" index="">
<a <a
:href="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)" :href="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)"
target="_blank" target="_blank"
style="width: 100%; height: 100%; display: block;" style="width: 100%; height: 100%; display: block;"
>{{ item.children[0].meta.title || $t(item.children[0].meta.i18n) }}</a> >{{ $t(item.children[0].meta.i18n) }}</a>
</el-menu-item> </el-menu-item>
</template> </template>
<template </template>
v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow" <template v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow">
:to="item.path+'/'+item.children[0].path" <template :to="item.path+'/'+item.children[0].path">
> <el-menu-item :key="idx" :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)">
<el-menu-item :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)">
<span <span
v-if="item.children[0].meta" v-if="item.children[0].meta&&item.children[0].meta.i18n"
slot="title" slot="title"
>{{ item.children[0].meta.title || $t(item.children[0].meta.i18n) }}</span> >{{ $t(item.children[0].meta.i18n) }}</span>
</el-menu-item> </el-menu-item>
</template> </template>
<el-submenu v-else :key="item.name" :index="item.name||item.path" :show-timeout="100">
<template slot="title">
<span v-if="item.meta" slot="title">{{ $t(item.meta.i18n) || item.meta.title }}</span>
</template> </template>
<template v-for="child in item.children" v-if="!child.hidden"> <el-submenu v-else :key="idx" :index="item.name||item.path" :show-timeout="100">
<template slot="title">
<span v-if="item.meta" slot="title">{{ $t(item.meta.i18n) }}</span>
</template>
<template v-for="(child,cdx) in item.children">
<template v-if="!child.hidden">
<template v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)"> <template v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)">
<el-submenu :key="child.name" :index="child.name||child.path" :show-timeout="100"> <el-submenu :key="cdx" :index="child.name||child.path" :show-timeout="100">
<template slot="title"> <template slot="title">
<span v-if="child.meta" slot="title">{{ child.meta.title || $t(item.meta.i18n) }}</span> <span v-if="child.meta" slot="title">{{ $t(child.meta.i18n) }}</span>
</template> </template>
<template v-for="grandchild in child.children" v-if="!grandchild.hidden"> <template v-for="(grandchild,gdx) in child.children">
<template v-if="!grandchild.hidden">
<template :to="child.path+'/'+grandchild.path"> <template :to="child.path+'/'+grandchild.path">
<el-menu-item <el-menu-item :key="gdx" :index="item.redirect ? item.redirect : (child.path+'/'+grandchild.path)">
:index="item.redirect ? item.redirect : (child.path+'/'+grandchild.path)"
>
<span <span
v-if="grandchild.meta" v-if="grandchild.meta"
slot="title" slot="title"
>{{ $t(grandchild.meta.title || grandchild.meta.i18n) }}</span> >{{ $t(grandchild.meta.i18n) }}</span>
</el-menu-item> </el-menu-item>
</template> </template>
</template> </template>
</template>
</el-submenu> </el-submenu>
</template> </template>
<template v-else :to="item.path+'/'+child.path"> <template v-else :to="item.path+'/'+child.path">
<el-menu-item :index="item.redirect ? item.redirect : (item.path+'/'+child.path)"> <el-menu-item :key="cdx" :index="item.redirect ? item.redirect : (item.path+'/'+child.path)">
<span v-if="child.meta" slot="title">{{ child.meta.title || $t(child.meta.i18n) }}</span> <span v-if="child.meta" slot="title">{{ $t(child.meta.i18n) }}</span>
</el-menu-item> </el-menu-item>
</template> </template>
</template> </template>
</template>
</el-submenu> </el-submenu>
</template> </template>
</template>
<quick-entry ref="quickEntry" /> <quick-entry ref="quickEntry" />
<user-logout ref="userLogout" /> <user-logout ref="userLogout" />
</el-menu> </el-menu>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="menu-wrapper"> <div class="menu-wrapper">
<template v-for="item in routes" v-if="!item.hidden&&item.children"> <template v-if="!item.hidden&&item.children">
<template v-for="item in routes">
<router-link <router-link
v-if="hasOneShowingChildren(item.children) && !item.children[0].children&&!item.alwaysShow" v-if="hasOneShowingChildren(item.children) && !item.children[0].children&&!item.alwaysShow"
:key="item.children[0].name" :key="item.children[0].name"
@ -19,9 +19,9 @@
<span v-if="item.meta&&item.meta.title" slot="title">{{ item.meta.title }}</span> <span v-if="item.meta&&item.meta.title" slot="title">{{ item.meta.title }}</span>
</template> </template>
<template v-for="child in item.children" v-if="!child.hidden"> <template v-if="!child.hidden">
<template v-for="child in item.children">
<sidebar-item v-if="child.children&&child.children.length>0" :key="child.path" :is-nest="true" class="nest-menu" :routes="[child]" /> <sidebar-item v-if="child.children&&child.children.length>0" :key="child.path" :is-nest="true" class="nest-menu" :routes="[child]" />
<router-link v-else :key="child.name" :to="item.path+'/'+child.path"> <router-link v-else :key="child.name" :to="item.path+'/'+child.path">
<el-menu-item :index="item.path+'/'+child.path"> <el-menu-item :index="item.path+'/'+child.path">
<svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon" /> <svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon" />
@ -29,8 +29,9 @@
</el-menu-item> </el-menu-item>
</router-link> </router-link>
</template> </template>
</template>
</el-submenu> </el-submenu>
</template>
</template> </template>
</div> </div>
</template> </template>

View File

@ -100,8 +100,8 @@ const user = {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 设置user域token值 // 设置user域token值
commit(token.key, token.value); commit(token.key, token.value);
// let header = { group: '', 'X-Token': token.value }; const header = { group: '', 'X-Token': token.value };
// creatSubscribe(perpetualTopic, header); creatSubscribe(perpetualTopic, header);
// 获取用户参数 // 获取用户参数
dispatch('GetUserConfigInfo').then(response => { dispatch('GetUserConfigInfo').then(response => {
resolve(response); resolve(response);