|
|
@@ -1,27 +1,30 @@
|
|
|
<template>
|
|
|
- <div id="global-header-body" v-show="this.$route.path!=='/auth'">
|
|
|
+ <div v-show="this.$route.path!=='/auth'" id="global-header-body">
|
|
|
<el-backtop/>
|
|
|
<div @click="toPortal">
|
|
|
<img id="global-header-logo" alt="err" src="@/assets/seec-logo-full-temp.png">
|
|
|
</div>
|
|
|
-<!-- <div><span style="color: #a4a4a4">[定位用空白及调试信息]</span>———当前: <span style="color: red">{{ currentPage }}</span>页</div>-->
|
|
|
-<!-- <div></div>-->
|
|
|
-<!-- <div id="global-header-navigator">-->
|
|
|
-<!-- <div class="global-header-navigator-tab" @click="toPortal"><span class="global-header-navigator-tab-text">首页</span></div>-->
|
|
|
-<!-- <div class="global-header-navigator-tab" @click="toTask"><span class="global-header-navigator-tab-text">任务</span></div>-->
|
|
|
-<!-- <div class="global-header-navigator-tab" @click="toManage"><span class="global-header-navigator-tab-text">教师[临]</span></div>-->
|
|
|
-<!-- <div class="global-header-navigator-tab" @click="toHome"><span class="global-header-navigator-tab-text">个人中心</span></div>-->
|
|
|
-<!-- <div class="global-header-navigator-tab" @click="testButton"><span class="global-header-navigator-tab-text">...</span></div>-->
|
|
|
-<!-- </div>-->
|
|
|
- <el-menu :default-active="1" mode="horizontal" >
|
|
|
- <el-submenu index="1">
|
|
|
- <template #title>首页</template>
|
|
|
- <el-menu-item index="1-1">全部课程</el-menu-item>
|
|
|
- <el-menu-item index="1-2">全部测试</el-menu-item>
|
|
|
- </el-submenu>
|
|
|
+ <el-menu :default-active="activeMenu" class="el-menu-demo" mode="horizontal" @select="handleMenuSelect">
|
|
|
+ <el-menu-item index="1">
|
|
|
+ 首页
|
|
|
+ </el-menu-item>
|
|
|
<el-menu-item index="2">
|
|
|
任务
|
|
|
</el-menu-item>
|
|
|
+ <el-submenu index="3">
|
|
|
+ <template #title>{{quickAccessTitle}}</template>
|
|
|
+ <el-menu-item index="3-1">全部课程</el-menu-item>
|
|
|
+ <el-menu-item index="3-2">全部测试</el-menu-item>
|
|
|
+ </el-submenu>
|
|
|
+ <el-menu-item index="4">
|
|
|
+ 个人中心
|
|
|
+ </el-menu-item>
|
|
|
+ <el-menu-item index="5">
|
|
|
+ 教师[临]
|
|
|
+ </el-menu-item>
|
|
|
+ <el-menu-item index="6">
|
|
|
+ 问题[?]
|
|
|
+ </el-menu-item>
|
|
|
</el-menu>
|
|
|
<div id="global-header-icon">
|
|
|
<div class="global-header-icon-content" @click="toMessage">
|
|
|
@@ -57,12 +60,14 @@
|
|
|
|
|
|
<script>
|
|
|
import InfoCard from "@/views/PortalPage/components/InfoCard";
|
|
|
+
|
|
|
export default {
|
|
|
name: "GlobalHeader",
|
|
|
components: { InfoCard },
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+ activeMenu: "1",
|
|
|
+ quickAccessTitle: "快速访问",
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -82,20 +87,43 @@ export default {
|
|
|
toPortal() {
|
|
|
this.$router.push("/portal");
|
|
|
},
|
|
|
- toTask() {
|
|
|
- this.$router.push("/task");
|
|
|
- },
|
|
|
- toManage() {
|
|
|
- this.$router.push("/manage");
|
|
|
- },
|
|
|
toMessage() {
|
|
|
this.$router.push("/message");
|
|
|
},
|
|
|
toHome() {
|
|
|
this.$router.push("/home");
|
|
|
},
|
|
|
- testButton() {
|
|
|
- this.$apis.example();
|
|
|
+ handleMenuSelect(key) {
|
|
|
+ switch (key) {
|
|
|
+ case "1":
|
|
|
+ this.$router.push("/portal");
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ this.$router.push("/task");
|
|
|
+ break;
|
|
|
+ case "3-1":
|
|
|
+ this.$router.push("/course");
|
|
|
+ break;
|
|
|
+ case "3-2":
|
|
|
+ this.$router.push("/test");
|
|
|
+ break;
|
|
|
+ case "4":
|
|
|
+ this.$router.push("/home");
|
|
|
+ break;
|
|
|
+ case "5":
|
|
|
+ this.$router.push("/manage");
|
|
|
+ break;
|
|
|
+ case "6":
|
|
|
+ this.$router.push("/problem");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (key === "3-1") {
|
|
|
+ this.quickAccessTitle = "全部课程";
|
|
|
+ } else if(key === "3-2") {
|
|
|
+ this.quickAccessTitle = "全部测试";
|
|
|
+ } else {
|
|
|
+ this.quickAccessTitle = "快速访问";
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
@@ -122,22 +150,21 @@ export default {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
|
|
|
-/*#global-header-navigator {*/
|
|
|
-/* display: flex;*/
|
|
|
-/*}*/
|
|
|
+:deep(.el-menu--horizontal) {
|
|
|
+ height: 48px;
|
|
|
+}
|
|
|
|
|
|
-/*.global-header-navigator-tab {*/
|
|
|
-/* height: 48px;*/
|
|
|
-/* width: 72px;*/
|
|
|
-/* display: flex;*/
|
|
|
-/* justify-content: center;*/
|
|
|
-/* align-items: center;*/
|
|
|
-/* margin-left: 10px;*/
|
|
|
-/*}*/
|
|
|
+:deep(.el-menu--horizontal>.el-submenu .el-submenu__title) {
|
|
|
+ height: 48px;
|
|
|
+ position: relative;
|
|
|
+ bottom: 5px;
|
|
|
+}
|
|
|
|
|
|
-/*.global-header-navigator-tab:hover {*/
|
|
|
-/* cursor: pointer;*/
|
|
|
-/*}*/
|
|
|
+:deep(.el-menu--horizontal>.el-menu-item) {
|
|
|
+ height: 48px;
|
|
|
+ position: relative;
|
|
|
+ bottom: 5px;
|
|
|
+}
|
|
|
|
|
|
#global-header-icon {
|
|
|
width: 120px;
|