导航栏右侧menu调整

This commit is contained in:
fan 2019-10-24 15:15:52 +08:00
parent e8b8d5a91d
commit 62541373f1
6 changed files with 68 additions and 53 deletions

View File

@ -164,5 +164,7 @@ export default {
simulationSystem: 'The simulation system',
lessonSystem: 'The lesson system',
examSystem: 'The exam system',
personalDetails: 'information'
personalDetails: 'information',
trainingPlatformEntrance: 'Training platform entrance',
designPlatformEntrance: 'Design platform entrance'
};

View File

@ -164,5 +164,7 @@ export default {
simulationSystem: '仿真系统',
lessonSystem: '教学系统',
examSystem: '考试系统',
personalDetails: '个人信息'
personalDetails: '个人信息',
trainingPlatformEntrance: '实训平台入口',
designPlatformEntrance: '设计平台入口'
};

View File

@ -1,21 +1,23 @@
<template>
<div style="display:inline-block">
<div class="linkDiv">
<router-link tag="a" target="_blank" to="/design" class="linkClass">设计平台入口</router-link>
</div>
<div class="avatar-container" style="display:inline-block;margin-right:10px">
<el-menu-item v-for="item in entryList" v-show="!item.hidden" :key="item.name" class="avatar-wrapper" index="" @click="item.handle">
<span style="color: white;">{{ $t(item.name) }}</span>
</el-menu-item>
<deomon-list ref="deomonList" />
<qcode ref="qcode" />
</div>
</div>
<div style="display:inline-block">
<div class="avatar-container" style="display:inline-block;margin-right:10px">
<el-menu-item v-for="item in entryList" v-show="!item.hidden" :key="item.name" class="avatar-wrapper" :index="$route.fullPath" @click="item.handle">
<el-tooltip v-if="item.tip" effect="dark" :content="$t('login.clickSwitchLanguage')" placement="bottom-end">
<span style="color: white;">{{ item.name }}</span>
</el-tooltip>
<span v-else style="color: white;">{{ $t(item.name) }}</span>
</el-menu-item>
<deomon-list ref="deomonList" />
<qcode ref="qcode" />
</div>
</div>
</template>
<script>
import DeomonList from '@/views/demonstration/deomonList';
import Qcode from './Qcode';
import { getSessionStorage } from '@/utils/auth';
import LangStorage from '@/utils/lang';
export default {
name: 'Entry',
@ -26,11 +28,16 @@ export default {
data() {
return {
entryList: [
// {
// // global.designPlatform
// name: '',
// handle: this.goToDesign
// },
{
name: 'global.designPlatformEntrance',
handle: this.goToDesign,
hidden: getSessionStorage('design')
},
{
name: 'global.trainingPlatformEntrance',
handle: this.goToTraining,
hidden: !getSessionStorage('design')
},
{
name: 'global.scan',
handle: this.qcodeEntry,
@ -38,11 +45,18 @@ export default {
},
{
name: 'global.quickEntry',
handle: this.quickEntry
handle: this.quickEntry,
hidden: getSessionStorage('design')
},
{
name: LangStorage.getLang('zh')==='zh'?'English':'中文',
handle: this.switchLanguage,
tip: true
}
],
stomp: null,
header: null
header: null,
lang: 'zh'
};
},
computed: {
@ -53,6 +67,10 @@ export default {
watch: {
},
mounted() {
const nowLang = LangStorage.getLang('zh');
if (nowLang === 'zh') {
this.lang = 'en';
}
},
methods: {
quickEntry() {
@ -61,12 +79,22 @@ export default {
qcodeEntry() {
this.$refs.qcode.doShow();
},
// goToDesign() {
// const routeData = this.$router.resolve({
// path: '/design'
// });
// window.open(routeData.href, '_blank');
// }
goToDesign() {
const routeData = this.$router.resolve({
path: '/design'
});
window.open(routeData.href, '_blank');
},
goToTraining() {
const routeData = this.$router.resolve({
path: '/'
});
window.open(routeData.href, '_blank');
},
switchLanguage() {
this.$i18n.locale = this.lang;
LangStorage.setLang(this.lang);
}
}
};
</script>

View File

@ -1,7 +1,7 @@
<template>
<el-menu
class="navbar"
:router="isRoute"
router
:default-active="activePath"
mode="horizontal"
background-color="#545c64"
@ -69,15 +69,7 @@
</template>
</template>
<div class="rightGroup">
<quick-entry v-if="isShow" ref="quickEntry" />
<!-- <div v-if="!isShow" class="avatar-container" @click="goToTraining">
<el-menu-item class="avatar-wrapper" index="">
<span style="color: white;">实训平台入口</span>
</el-menu-item>
</div> -->
<div v-if="!isShow" class="linkDiv">
<router-link tag="a" target="_blank" to="/" class="linkClass">实训平台入口</router-link>
</div>
<quick-entry ref="quickEntry" />
<user-logout ref="userLogout" />
</div>
</el-menu>
@ -88,7 +80,6 @@ import { mapGetters } from 'vuex';
import UserLogout from './Logout';
import QuickEntry from './Entry';
import SystemTitle from './Title';
import { getSessionStorage } from '@/utils/auth';
export default {
components: {
@ -100,8 +91,7 @@ export default {
return {
routes: [],
isShow: false,
activePath: '',
isRoute: true
activePath: ''
};
},
computed: {
@ -111,14 +101,7 @@ export default {
])
},
mounted() {
this.routes = this.$router.options.routes;
if (getSessionStorage('design')) {
this.isShow=false;
this.isRoute = true;
} else {
this.isShow=true;
this.isRoute = false;
}
this.routes = this.$router.options.routes;
if (this.$route.fullPath.indexOf('design/userlist')>=0) {
this.activePath='/design/userlist/home';
} else if (this.$route.fullPath.indexOf('design/lesson')>=0 || this.$route.fullPath.indexOf('design/script')>=0 || this.$route.fullPath.indexOf('design/runPlan')>=0) {
@ -159,7 +142,7 @@ export default {
return true;
}
return false;
},
}
}
};
</script>

View File

@ -2198,7 +2198,7 @@ export const IbpOperation = {
};
export const loginTitle = {
xty: '西铁院城市轨道交通实训平台',
xty: '西铁院实训平台',
login: '城市轨道交通实训平台',
design: '城市轨道交通设计平台'
};

View File

@ -35,7 +35,7 @@
</div>
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
<div class="title_box">{{ $t('login.welcomeTo') + '城市轨道交通实训平台' }}</div>
<div class="title_box">{{ $t('login.welcomeTo') + title }}</div>
<el-form-item prop="username" class="item_form_box">
<span class="svg-container svg-container_login">
<svg-icon icon-class="user" />
@ -396,7 +396,7 @@ export default {
background-origin: border-box;
background-size: 100% 100%;
.content-box{
width: 720px;
width: 740px;
display: flex;
align-items: center;
justify-content: center;
@ -423,7 +423,7 @@ export default {
}
}
.login-form {
width: 420px;
width: 440px;
padding: 0 50px;
}