|
@@ -1,365 +0,0 @@
|
|
|
-<template>
|
|
|
- <!-- 顶部登录导航 -->
|
|
|
- <div class="OneselfNav">
|
|
|
- <div class="logo">
|
|
|
- <!-- <span> logo </span> -->
|
|
|
- <el-menu
|
|
|
- :default-active="activeIndex"
|
|
|
- class="el-menu-demo"
|
|
|
- mode="horizontal"
|
|
|
- @select="handleSelect"
|
|
|
- text-color="black"
|
|
|
- active-text-color="#FF9900"
|
|
|
- >
|
|
|
- <el-menu-item index="1">HOME PAGE</el-menu-item>
|
|
|
- <el-menu-item index="2">
|
|
|
- <el-dropdown trigger="click" @command="handleCommand">
|
|
|
- <span
|
|
|
- class="el-dropdown-link"
|
|
|
- :style="{ color: LoginNavIndex == 2 ? '#FF9900' : 'black' }"
|
|
|
- >
|
|
|
- {{ projectName }}
|
|
|
- <!-- SYSTEM -->
|
|
|
- <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
- </span>
|
|
|
- <el-dropdown-menu slot="dropdown" style="width: 300px">
|
|
|
- <el-dropdown-item
|
|
|
- v-for="(item, i) in projectList"
|
|
|
- :key="i"
|
|
|
- :command="item.name.toUpperCase()"
|
|
|
- >
|
|
|
- <img
|
|
|
- style="position: relative; top: 5px; width: 24px"
|
|
|
- :src="require('../../assets/login/' + item.img + '.png')"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- <span style="margin-left: 16px">
|
|
|
- {{ item.name }}
|
|
|
- </span>
|
|
|
- </el-dropdown-item>
|
|
|
- <!-- <el-dropdown-item command="LEARING CENTER">
|
|
|
- Learning Center
|
|
|
- </el-dropdown-item>
|
|
|
- <el-dropdown-item command="TESTING CENTER"
|
|
|
- >Testing Center</el-dropdown-item
|
|
|
- >
|
|
|
- <el-dropdown-item command="TEACHER CENTER"
|
|
|
- >Teacher Center</el-dropdown-item
|
|
|
- > -->
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
- </el-menu-item>
|
|
|
- </el-menu>
|
|
|
- </div>
|
|
|
- <div class="userName">
|
|
|
- <el-dropdown
|
|
|
- style="margin-right: 16px"
|
|
|
- trigger="click"
|
|
|
- @command="yuyanhandleCommand"
|
|
|
- >
|
|
|
- <span class="el-dropdown-link" style="color: black">
|
|
|
- <img class="flag" src="../../assets/login/Ellipse 74.png" alt="" />
|
|
|
- English<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
- </span>
|
|
|
- <el-dropdown-menu slot="dropdown" style="width: 200px">
|
|
|
- <el-dropdown-item
|
|
|
- v-for="(item, i) in language_list"
|
|
|
- :key="i"
|
|
|
- :command="item.language_name_zh"
|
|
|
- >
|
|
|
- <span>{{ item.language_name_zh }}</span>
|
|
|
- </el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
- <div v-if="!userMessage" class="selectLoginOrRegistration">
|
|
|
- <span @click="cutLoginReg('login')">LOGIN</span>
|
|
|
- <span> | </span>
|
|
|
- <span @click="cutLoginReg('signin')">SIGN UP</span>
|
|
|
- </div>
|
|
|
- <!-- 用户头像和用户名 -->
|
|
|
- <div class="user" v-else>
|
|
|
- <img
|
|
|
- @click="userShow = !userShow"
|
|
|
- class="headPhoto"
|
|
|
- src="../../assets/login/Group3214.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- <span @click="userShow = !userShow">{{ userMessage.user_name }}</span>
|
|
|
- <div class="userShow" v-show="userShow">
|
|
|
- <p @click="gotoPersonalcenter">
|
|
|
- <img src="../../assets/login/project7.png" alt="" />
|
|
|
- 个人中心
|
|
|
- </p>
|
|
|
- <p @click="QuitLogin">
|
|
|
- <img src="../../assets/login/Frame77.png" alt="" />
|
|
|
- 退出登录
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- 消息 铃铛图片 -->
|
|
|
- <div class="message">
|
|
|
- <img src="../../assets/login/Vector.png" alt="" />
|
|
|
- <!-- <span class="redDot"></span> -->
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import Cookies from "js-cookie";
|
|
|
-import { getAcsCode } from "@/api/api";
|
|
|
-
|
|
|
-export default {
|
|
|
- props: ["type", "changeLoginReg", "FatheruserMessage", "language_list"],
|
|
|
- data() {
|
|
|
- return {
|
|
|
- activeIndex: "2",
|
|
|
- LoginNavIndex: "2",
|
|
|
- projectName: "PERSONAL PROFILE",
|
|
|
- projectList: [
|
|
|
- {
|
|
|
- name: "Teaching management system",
|
|
|
- img: "project1",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "Textbook management system",
|
|
|
- img: "project2",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "Teacher training center",
|
|
|
- img: "project3",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "Learning Center",
|
|
|
- img: "project4",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "Testing Center",
|
|
|
- img: "project5",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "Teacher Center",
|
|
|
- img: "project6",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "Personal Profile",
|
|
|
- img: "project7",
|
|
|
- },
|
|
|
- ],
|
|
|
- userMessage: null,
|
|
|
- userShow: false,
|
|
|
- };
|
|
|
- },
|
|
|
- watch: {
|
|
|
- FatheruserMessage(newval, oldval) {
|
|
|
- this.userMessage = null;
|
|
|
- this.userMessage = newval;
|
|
|
- },
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // 切换导航
|
|
|
- handleSelect(key, keyPath) {
|
|
|
- this.LoginNavIndex = key;
|
|
|
- if (this.LoginNavIndex == "1") {
|
|
|
- this.$router.push("/");
|
|
|
- } else {
|
|
|
- let ulobj = document.getElementsByClassName("el-dropdown-menu")[0];
|
|
|
- ulobj.classList.add("LoginNavSeleProject");
|
|
|
- }
|
|
|
- },
|
|
|
- // 切换项目
|
|
|
- async handleCommand(command) {
|
|
|
- this.LoginNavIndex = 2;
|
|
|
- let user = Cookies.get("userMessage");
|
|
|
- if (!user) {
|
|
|
- this.$message.warning("Please login first");
|
|
|
- this.projectName = "SYSTEM";
|
|
|
- return;
|
|
|
- }
|
|
|
- let session_id = Cookies.get("session_id");
|
|
|
- let user_code = Cookies.get("user_code");
|
|
|
- let user_type = Cookies.get("user_type");
|
|
|
- let MethodName = "login_control-CreateAccessCode";
|
|
|
- let acsCode = null;
|
|
|
- await getAcsCode(MethodName, {
|
|
|
- UserCode: user_code,
|
|
|
- SessionID: session_id,
|
|
|
- UserType: user_type,
|
|
|
- }).then((res) => {
|
|
|
- acsCode = res.access_code;
|
|
|
- });
|
|
|
- this.projectName = command;
|
|
|
- if (this.projectName == "TEXTBOOK MANAGEMENT SYSTEM") {
|
|
|
- // 教材管理系统 TEXTBOOK MANAGEMENT SYSTEM
|
|
|
- location.href = `http://gcls.helxsoft.cn/GCLS_Book/#/courselist?AccessCode=${acsCode}`;
|
|
|
- } else {
|
|
|
- this.$message.warning("正则开发中,请期待");
|
|
|
- this.projectName = "SYSTEM";
|
|
|
- }
|
|
|
- },
|
|
|
- // 切换语言
|
|
|
- yuyanhandleCommand(command) {
|
|
|
- console.log(command);
|
|
|
- },
|
|
|
- // 切换登录的注册
|
|
|
- cutLoginReg(value) {
|
|
|
- this.changeLoginReg(value);
|
|
|
- },
|
|
|
- // 前往个人中心
|
|
|
- gotoPersonalcenter() {
|
|
|
- this.userShow = false;
|
|
|
- },
|
|
|
- QuitLogin() {
|
|
|
- Cookies.remove("userMessage");
|
|
|
- Cookies.remove("session_id");
|
|
|
- Cookies.remove("user_code");
|
|
|
- Cookies.remove("user_type");
|
|
|
- this.userShow = false;
|
|
|
- this.userMessage = null;
|
|
|
- this.$router.push("/")
|
|
|
- },
|
|
|
- },
|
|
|
- created() {
|
|
|
- if (this.FatheruserMessage) {
|
|
|
- this.userMessage = this.FatheruserMessage;
|
|
|
- } else {
|
|
|
- this.userMessage = null;
|
|
|
- }
|
|
|
- let user = Cookies.get("userMessage");
|
|
|
- if (user) {
|
|
|
- this.userMessage = JSON.parse(user);
|
|
|
- } else {
|
|
|
- this.userMessage = null;
|
|
|
- }
|
|
|
- },
|
|
|
-};
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
-.OneselfNav {
|
|
|
- height: 65px;
|
|
|
- position: relative;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- padding: 0 24px 0 40px;
|
|
|
- z-index: 999;
|
|
|
- font-family: "sourceR";
|
|
|
- box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.15);
|
|
|
- .logo {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- .el-menu-demo {
|
|
|
- background: rgba(0, 0, 0, 0);
|
|
|
- // margin-left: 100px;
|
|
|
- li:hover {
|
|
|
- background: none;
|
|
|
- }
|
|
|
- li {
|
|
|
- background: none;
|
|
|
- }
|
|
|
- }
|
|
|
- // 取消组件默认的样式
|
|
|
- .el-menu.el-menu--horizontal {
|
|
|
- border-bottom: none;
|
|
|
- }
|
|
|
- }
|
|
|
- .userName {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- .seek {
|
|
|
- margin-right: 100px;
|
|
|
- position: relative;
|
|
|
- img {
|
|
|
- left: 10px;
|
|
|
- top: 11px;
|
|
|
- position: absolute;
|
|
|
- }
|
|
|
- }
|
|
|
- .flag {
|
|
|
- position: relative;
|
|
|
- top: 5px;
|
|
|
- }
|
|
|
- .headPhoto {
|
|
|
- width: 50px;
|
|
|
- height: 50px;
|
|
|
- // background: url("../assets/teacherTrain/image 4.png") no-repeat 100% 100%;
|
|
|
- // background-size: 100%;
|
|
|
- border-radius: 50%;
|
|
|
- // margin-right: 10px;
|
|
|
- }
|
|
|
- .message {
|
|
|
- position: relative;
|
|
|
- margin-left: 16px;
|
|
|
- img {
|
|
|
- width: 32px;
|
|
|
- height: 32px;
|
|
|
- }
|
|
|
- .redDot {
|
|
|
- width: 6px;
|
|
|
- height: 6px;
|
|
|
- position: absolute;
|
|
|
- display: inline-block;
|
|
|
- background: red;
|
|
|
- border-radius: 50%;
|
|
|
- right: 0;
|
|
|
- }
|
|
|
- }
|
|
|
- .selectLoginOrRegistration {
|
|
|
- display: flex;
|
|
|
- width: 161px;
|
|
|
- height: 32px;
|
|
|
- border: 1px solid #ffffff;
|
|
|
- box-sizing: border-box;
|
|
|
- border-radius: 4px;
|
|
|
- justify-content: space-evenly;
|
|
|
- align-items: center;
|
|
|
- > :first-child {
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
- > :last-child {
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
- }
|
|
|
- .user {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- cursor: pointer;
|
|
|
- position: relative;
|
|
|
- > img {
|
|
|
- width: 34px;
|
|
|
- height: 34px;
|
|
|
- }
|
|
|
- > span {
|
|
|
- padding-left: 10px;
|
|
|
- }
|
|
|
- .userShow {
|
|
|
- position: absolute;
|
|
|
- width: 156px;
|
|
|
- height: 96px;
|
|
|
- background: #ffffff;
|
|
|
- box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.15);
|
|
|
- border-radius: 8px;
|
|
|
- bottom: -100px;
|
|
|
- color: black;
|
|
|
- img {
|
|
|
- width: 24px;
|
|
|
- height: 24px;
|
|
|
- margin-right: 10px;
|
|
|
- }
|
|
|
- p {
|
|
|
- height: 40px;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- padding-left: 20px;
|
|
|
- margin: 0;
|
|
|
- margin-top: 5px;
|
|
|
- }
|
|
|
- > p:hover {
|
|
|
- background: #f2f2f2;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|