修改登录涟计划以及大屏等其他系统时,主系统也跳转的问题
This commit is contained in:
parent
9c51afb419
commit
dbd1193679
@ -3,16 +3,25 @@
|
||||
<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>
|
||||
</el-menu-item>
|
||||
<deomon-list ref="deomonList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DeomonList from '@/views/demonstration/deomonList';
|
||||
|
||||
export default {
|
||||
name: 'Entry',
|
||||
components: {
|
||||
DeomonList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
entryList: [
|
||||
{
|
||||
name: '快速入口',
|
||||
handle: this.quickEntry
|
||||
}
|
||||
],
|
||||
stomp: null,
|
||||
header: null
|
||||
@ -28,6 +37,9 @@ export default {
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
quickEntry() {
|
||||
this.$refs.deomonList.doShow();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -8,58 +8,63 @@
|
||||
text-color="#fff"
|
||||
active-text-color="#ffd04b"
|
||||
>
|
||||
<template v-for="item in routers" v-if="!item.hidden&&item.children">
|
||||
<template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow">
|
||||
<el-menu-item :index="item.redirect">
|
||||
<a
|
||||
:href="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)"
|
||||
target="_blank"
|
||||
style="width: 100%; height: 100%; display: block;"
|
||||
>{{ item.children[0].meta.title || $t(item.children[0].meta.i18n) }}</a>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
<template
|
||||
v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow"
|
||||
:to="item.path+'/'+item.children[0].path"
|
||||
>
|
||||
<el-menu-item :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)">
|
||||
<span
|
||||
v-if="item.children[0].meta"
|
||||
slot="title"
|
||||
>{{ item.children[0].meta.title || $t(item.children[0].meta.i18n) }}</span>
|
||||
</el-menu-item>
|
||||
</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 v-for="child in item.children" v-if="!child.hidden">
|
||||
<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">
|
||||
<template slot="title">
|
||||
<span v-if="child.meta" slot="title">{{ child.meta.title || $t(item.meta.i18n) }}</span>
|
||||
</template>
|
||||
<template v-for="grandchild in child.children" v-if="!grandchild.hidden">
|
||||
<template :to="child.path+'/'+grandchild.path">
|
||||
<el-menu-item
|
||||
:index="item.redirect ? item.redirect : (child.path+'/'+grandchild.path)"
|
||||
>
|
||||
<span
|
||||
v-if="grandchild.meta"
|
||||
slot="title"
|
||||
>{{ $t(grandchild.meta.title || grandchild.meta.i18n) }}</span>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</template>
|
||||
</el-submenu>
|
||||
</template>
|
||||
<template v-else :to="item.path+'/'+child.path">
|
||||
<el-menu-item :index="item.redirect ? item.redirect : (item.path+'/'+child.path)">
|
||||
<span v-if="child.meta" slot="title">{{ child.meta.title || $t(child.meta.i18n) }}</span>
|
||||
<template v-for="(item,idx) in routers">
|
||||
<template v-if="!item.hidden&&item.children">
|
||||
<template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow">
|
||||
<template>
|
||||
<el-menu-item :key="idx" index="">
|
||||
<a
|
||||
:href="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)"
|
||||
target="_blank"
|
||||
style="width: 100%; height: 100%; display: block;"
|
||||
>{{ $t(item.children[0].meta.i18n) }}</a>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</template>
|
||||
</el-submenu>
|
||||
<template v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow">
|
||||
<template :to="item.path+'/'+item.children[0].path">
|
||||
<el-menu-item :key="idx" :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)">
|
||||
<span
|
||||
v-if="item.children[0].meta&&item.children[0].meta.i18n"
|
||||
slot="title"
|
||||
>{{ $t(item.children[0].meta.i18n) }}</span>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</template>
|
||||
<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)">
|
||||
<el-submenu :key="cdx" :index="child.name||child.path" :show-timeout="100">
|
||||
<template slot="title">
|
||||
<span v-if="child.meta" slot="title">{{ $t(child.meta.i18n) }}</span>
|
||||
</template>
|
||||
<template v-for="(grandchild,gdx) in child.children">
|
||||
<template v-if="!grandchild.hidden">
|
||||
<template :to="child.path+'/'+grandchild.path">
|
||||
<el-menu-item :key="gdx" :index="item.redirect ? item.redirect : (child.path+'/'+grandchild.path)">
|
||||
<span
|
||||
v-if="grandchild.meta"
|
||||
slot="title"
|
||||
>{{ $t(grandchild.meta.i18n) }}</span>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</el-submenu>
|
||||
</template>
|
||||
<template v-else :to="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">{{ $t(child.meta.i18n) }}</span>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</el-submenu>
|
||||
</template>
|
||||
</template>
|
||||
<quick-entry ref="quickEntry" />
|
||||
<user-logout ref="userLogout" />
|
||||
|
@ -1,36 +1,37 @@
|
||||
<template>
|
||||
<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
|
||||
v-if="hasOneShowingChildren(item.children) && !item.children[0].children&&!item.alwaysShow"
|
||||
:key="item.children[0].name"
|
||||
:to="item.path+'/'+item.children[0].path"
|
||||
>
|
||||
<el-menu-item :index="item.path+'/'+item.children[0].path" :class="{'submenu-title-noDropdown':!isNest}">
|
||||
<svg-icon v-if="item.children[0].meta&&item.children[0].meta.icon" :icon-class="item.children[0].meta.icon" />
|
||||
<span v-if="item.children[0].meta&&item.children[0].meta.title" slot="title">{{ item.children[0].meta.title }}</span>
|
||||
</el-menu-item>
|
||||
</router-link>
|
||||
|
||||
<router-link
|
||||
v-if="hasOneShowingChildren(item.children) && !item.children[0].children&&!item.alwaysShow"
|
||||
:key="item.children[0].name"
|
||||
:to="item.path+'/'+item.children[0].path"
|
||||
>
|
||||
<el-menu-item :index="item.path+'/'+item.children[0].path" :class="{'submenu-title-noDropdown':!isNest}">
|
||||
<svg-icon v-if="item.children[0].meta&&item.children[0].meta.icon" :icon-class="item.children[0].meta.icon" />
|
||||
<span v-if="item.children[0].meta&&item.children[0].meta.title" slot="title">{{ item.children[0].meta.title }}</span>
|
||||
</el-menu-item>
|
||||
</router-link>
|
||||
|
||||
<el-submenu v-else :key="item.name" :index="item.name||item.path">
|
||||
<template slot="title">
|
||||
<svg-icon v-if="item.meta&&item.meta.icon" :icon-class="item.meta.icon" />
|
||||
<span v-if="item.meta&&item.meta.title" slot="title">{{ item.meta.title }}</span>
|
||||
</template>
|
||||
|
||||
<template v-for="child in item.children" v-if="!child.hidden">
|
||||
<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">
|
||||
<el-menu-item :index="item.path+'/'+child.path">
|
||||
<svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon" />
|
||||
<span v-if="child.meta&&child.meta.title" slot="title">{{ child.meta.title }}</span>
|
||||
</el-menu-item>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-submenu>
|
||||
<el-submenu v-else :key="item.name" :index="item.name||item.path">
|
||||
<template slot="title">
|
||||
<svg-icon v-if="item.meta&&item.meta.icon" :icon-class="item.meta.icon" />
|
||||
<span v-if="item.meta&&item.meta.title" slot="title">{{ item.meta.title }}</span>
|
||||
</template>
|
||||
|
||||
<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]" />
|
||||
<router-link v-else :key="child.name" :to="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" />
|
||||
<span v-if="child.meta&&child.meta.title" slot="title">{{ child.meta.title }}</span>
|
||||
</el-menu-item>
|
||||
</router-link>
|
||||
</template>
|
||||
</template>
|
||||
</el-submenu>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -63,9 +63,9 @@ function convertRouterRoles({ roles, permissionType }) {
|
||||
*/
|
||||
function filterAsyncRouter(asyncRouter, roles, parentsRoles) {
|
||||
return asyncRouter.filter(route => {
|
||||
if (route.name === '大屏系统' && roles.indexOf(admin)===-1 && roles.indexOf(userScreen) ===-1){
|
||||
route.hidden = true;
|
||||
}
|
||||
if (route.name === '大屏系统' && roles.indexOf(admin)===-1 && roles.indexOf(userScreen) ===-1) {
|
||||
route.hidden = true;
|
||||
}
|
||||
if (hasPermission(roles, route, parentsRoles)) {
|
||||
if (route.children && route.children.length) {
|
||||
route.children = filterAsyncRouter(route.children, roles, route.meta ? route.meta.roles : undefined);
|
||||
|
@ -100,8 +100,8 @@ const user = {
|
||||
return new Promise((resolve, reject) => {
|
||||
// 设置user域token值
|
||||
commit(token.key, token.value);
|
||||
// let header = { group: '', 'X-Token': token.value };
|
||||
// creatSubscribe(perpetualTopic, header);
|
||||
const header = { group: '', 'X-Token': token.value };
|
||||
creatSubscribe(perpetualTopic, header);
|
||||
// 获取用户参数
|
||||
dispatch('GetUserConfigInfo').then(response => {
|
||||
resolve(response);
|
||||
|
Loading…
Reference in New Issue
Block a user