natasha před 11 měsíci
rodič
revize
978cad2a8d
1 změnil soubory, kde provedl 100 přidání a 100 odebrání
  1. 100 100
      src/components/Header.vue

+ 100 - 100
src/components/Header.vue

@@ -2,14 +2,14 @@
   <!-- 顶部登录导航 -->
   <div class="LoginNav1">
     <div class="logo" v-if="configInfor">
-      <img
+      <!-- <img
         v-if="configInfor.logo_image_url"
         :src="configInfor.logo_image_url"
         alt=""
         class="logo-image"
         @click="handleSelect"
       />
-      <span class="logo-img" v-else>logo</span>
+      <span class="logo-img" v-else>logo</span> -->
       <ul class="logo-projectlist">
         <li
           v-for="(itemI, indexI) in projectList"
@@ -43,7 +43,7 @@
         </el-dropdown>
       </template>
       <div v-if="!userMessage" class="selectLoginOrRegistration">
-        <span @click="cutLoginReg">{{ $t("Key9") }}</span>
+        <span @click="cutLoginReg">{{ $t('Key9') }}</span>
       </div>
       <!-- 用户头像和用户名 -->
       <div class="user" v-else>
@@ -66,12 +66,12 @@
           <p @click="gotoPersonalcenter">
             <img src="../assets/login/project7.png" alt="" />
             <!-- 个人中心 -->
-            {{ $t("Key38") }}
+            {{ $t('Key38') }}
           </p>
           <p @click="QuitLogin">
             <img src="../assets/login/Frame77.png" alt="" />
             <!-- 退出登录 -->
-            {{ $t("Key39") }}
+            {{ $t('Key39') }}
           </p>
         </div>
       </div>
@@ -89,210 +89,210 @@
 </template>
 
 <script>
-import { mapGetters } from "vuex";
-import { getToken, removeToken } from "@/utils/auth";
-import Cookies from "js-cookie";
-import { getContent, getStaticContent, getLearnWebContent } from "@/api/api";
-import { setI18nLang } from "@/utils/i18n";
-import { getConfig } from "@/utils/auth";
-import { saveSession, getSession, removeSession } from "@/utils/role";
+import { mapGetters } from 'vuex'
+import { getToken, removeToken } from '@/utils/auth'
+import Cookies from 'js-cookie'
+import { getContent, getStaticContent, getLearnWebContent } from '@/api/api'
+import { setI18nLang } from '@/utils/i18n'
+import { getConfig } from '@/utils/auth'
+import { saveSession, getSession, removeSession } from '@/utils/role'
 
 export default {
-  name: "LayoutHeader",
+  name: 'LayoutHeader',
   props: [],
   data() {
     return {
-      activeIndex: "2", // 主导航索引
+      activeIndex: '2', // 主导航索引
       LoginNavIndex: 0, //下拉框导航索引
-      projectName: "学习中心",
-      is_exist: "false",
+      projectName: '学习中心',
+      is_exist: 'false',
       projectList: [],
       teacherProList: [
         //普通教师
         {
           id: 0,
-          name: "教学中心",
-          img: "project1",
+          name: '教学中心',
+          img: 'project1',
         },
 
         {
           id: 2,
-          name: "教培中心",
-          img: "project3",
+          name: '教培中心',
+          img: 'project3',
         },
         {
           id: 3,
-          name: "教研中心",
-          img: "project4",
+          name: '教研中心',
+          img: 'project4',
         },
         {
           id: 4,
-          name: "考试中心",
-          img: "project5",
+          name: '考试中心',
+          img: 'project5',
         },
         {
           id: 5,
-          name: "学习中心",
-          img: "project6",
+          name: '学习中心',
+          img: 'project6',
         },
         {
           id: 6,
-          name: "个人中心",
-          img: "project7",
+          name: '个人中心',
+          img: 'project7',
         },
       ],
       stuProList: [
         {
           id: 0,
-          name: "教学中心",
-          img: "project1",
+          name: '教学中心',
+          img: 'project1',
         },
         {
           id: 5,
-          name: "学习中心",
-          img: "project6",
+          name: '学习中心',
+          img: 'project6',
         },
         {
           id: 6,
-          name: "个人中心",
-          img: "project7",
+          name: '个人中心',
+          img: 'project7',
         },
       ],
       userMessage: null,
       userShow: false,
       language_list: [],
-      lang: "",
+      lang: '',
       headTimer: null,
       configInfor: null,
-    };
+    }
   },
   watch: {},
   computed: {
-    ...mapGetters(["language_type"]),
+    ...mapGetters(['language_type']),
   },
   methods: {
     // 前往个人中心
     gotoPersonalcenter() {
       if (!this.userMessage) {
-        this.$message.warning(this.$t("Key573"));
-        return;
+        this.$message.warning(this.$t('Key573'))
+        return
       }
       // let MethodName = "login_control-CreateAccessCode";
       // let acsCode = "";
       // getContent(MethodName, UserCode, UserType, SessionID).then((res) => {
       //   acsCode = res.access_code;
-      location.href = `/GCLS-Personal/#/EnterSys`;
+      location.href = `/GCLS-Personal/#/EnterSys`
       // });
     },
     // 切换导航
     handleSelect(key, keyPath) {
-      window.location.href = "/";
+      window.location.href = '/'
     },
     // 切换项目
     handleCommand(command) {
-      let _this = this;
-      _this.LoginNavIndex = command;
+      let _this = this
+      _this.LoginNavIndex = command
       if (!_this.userMessage) {
-        this.$message.warning(this.$t("Key573"));
-        this.projectName = "学习中心";
-        window.location.href = "/";
-        return;
+        this.$message.warning(this.$t('Key573'))
+        this.projectName = '学习中心'
+        window.location.href = '/'
+        return
       }
-      _this.projectName = _this.projectList[command].name;
-      let relative_path = _this.projectList[command].relative_path;
-      location.href = relative_path;
+      _this.projectName = _this.projectList[command].name
+      let relative_path = _this.projectList[command].relative_path
+      location.href = relative_path
     },
     // 切换登录的注册
     cutLoginReg() {
-      window.location.href = "/";
+      window.location.href = '/'
     },
     QuitLogin() {
-      sessionStorage.removeItem("useragent_root_close");
-      window.location.href = "/";
-      removeToken();
-      removeSession("SysList");
-      Cookies.remove("JSESSIONID");
-      this.userShow = false;
-      this.userMessage = null;
+      sessionStorage.removeItem('useragent_root_close')
+      window.location.href = '/'
+      removeToken()
+      removeSession('SysList')
+      Cookies.remove('JSESSIONID')
+      this.userShow = false
+      this.userMessage = null
     },
     getLangList() {
-      let MethodName = "language_manager-GetLanguageList";
-      let data = {};
+      let MethodName = 'language_manager-GetLanguageList'
+      let data = {}
       getStaticContent(MethodName, data).then((res) => {
-        this.language_list = res.language_list;
+        this.language_list = res.language_list
         for (let i = 0; i < this.language_list.length; i++) {
-          let item = this.language_list[i];
+          let item = this.language_list[i]
           if (item.language_type == this.language_type) {
-            this.lang = item.language_name;
-            break;
+            this.lang = item.language_name
+            break
           }
         }
-      });
+      })
     },
     async changeLang(command) {
-      console.log(command);
-      this.lang = command.language_name;
-      let lang_type = command.language_type;
-      await setI18nLang(lang_type);
-      this.$router.go(0);
+      console.log(command)
+      this.lang = command.language_name
+      let lang_type = command.language_type
+      await setI18nLang(lang_type)
+      this.$router.go(0)
     },
 
     getNotReadMessage() {
-      let MethodName = "message-message_manager-IsExistMyMessage_NotRead";
-      let data = {};
+      let MethodName = 'message-message_manager-IsExistMyMessage_NotRead'
+      let data = {}
       getLearnWebContent(MethodName, data).then((res) => {
-        this.is_exist = res.is_exist;
-      });
+        this.is_exist = res.is_exist
+      })
     },
     // async _getConfig() {
     //   this.configInfor = await getConfigInfor();
     // },
     getChildSysList() {
-      let _this = this;
-      let MethodName = "login_control-GetChildSysList_CanEnter_PC";
+      let _this = this
+      let MethodName = 'login_control-GetChildSysList_CanEnter_PC'
       getContent(MethodName, {})
         .then((res) => {
           if (res.child_sys_list && res.child_sys_list.length > 0) {
-            _this.projectList = res.child_sys_list;
+            _this.projectList = res.child_sys_list
             _this.projectList.forEach((item, index) => {
-              if (item.key == "GCLS-LC") {
-                _this.LoginNavIndex = index;
+              if (item.key == 'GCLS-LC') {
+                _this.LoginNavIndex = index
               }
-            });
+            })
           }
         })
         .catch((err) => {
-          console.log(err);
-        });
+          console.log(err)
+        })
     },
   },
   created() {
-    let _this = this;
-    _this.getChildSysList();
+    let _this = this
+    _this.getChildSysList()
   },
   mounted() {
-    let _this = this;
-    let user = getToken();
+    let _this = this
+    let user = getToken()
     if (user) {
-      _this.userMessage = JSON.parse(user);
+      _this.userMessage = JSON.parse(user)
     }
-    let config = getConfig();
+    let config = getConfig()
     if (config) {
-      _this.configInfor = JSON.parse(config);
+      _this.configInfor = JSON.parse(config)
     }
-    _this.getLangList();
-    _this.headTimer = _this.getNotReadMessage();
+    _this.getLangList()
+    _this.headTimer = _this.getNotReadMessage()
     setInterval(() => {
-      _this.getNotReadMessage();
-    }, 120000);
+      _this.getNotReadMessage()
+    }, 120000)
   },
   beforeDestroy() {
     if (this.headTimer) {
       //如果定时器还在运行 或者直接关闭,不用判断
-      clearInterval(this.headTimer); //关闭
+      clearInterval(this.headTimer) //关闭
     }
   },
-};
+}
 </script>
 
 <style lang="scss" scoped>
@@ -307,7 +307,7 @@ export default {
   z-index: 999;
   background: #ffffff;
   box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.15);
-  font-family: "sourceR";
+  font-family: 'sourceR';
   .logo {
     > img {
       // width: 188px;
@@ -478,7 +478,7 @@ export default {
     justify-content: center;
     align-items: center;
     > span {
-      font-family: "sourceR";
+      font-family: 'sourceR';
       font-size: 16px;
     }
   }
@@ -489,7 +489,7 @@ export default {
   .el-dropdown {
     display: block;
     > span {
-      font-family: "sourceR";
+      font-family: 'sourceR';
       font-size: 16px;
     }
   }
@@ -505,7 +505,7 @@ export default {
     }
     > span {
       line-height: 40px;
-      font-family: "sourceR";
+      font-family: 'sourceR';
     }
   }
   &:hover {
@@ -518,4 +518,4 @@ export default {
     background: #ff9900;
   }
 }
-</style>
+</style>