123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <template>
- <div id="app">
- <router-view v-if="isRouterAlive" />
- </div>
- </template>
- <script>
- import Home from '@/views/Home'
- import tabers from '@/components/taber'
- import {getUserTaskComplete} from "@/api/user";
- export default {
- name: 'App',
- data() {
- return{
- isRouterAlive: true
- }
- },
- provide () {
- return {
- reload: this.reload
- }
- },
- created () {
- document.title = this.$t('common.GEIDcpTitleSeptember');
- let app=document.getElementById('app');
- if(this.$i18n.locale=='en'){
- app.style.fontFamily="Helvetica,neue,sans-serif"
- }else{
- app.style.fontFamily="Microsoft YaHei,Arial,helvetica,neue,sans-serif"
- }
- // window.localStorage.setItem("locale",'en');
- //在页面加载时读取sessionStorage里的状态信息
- if (window.localStorage.getItem("router") ) {
- // this.$store.replaceState(Object.assign({}, this.$store.state.user,JSON.parse(sessionStorage.getItem("user"))))
- this.$store.commit('modify', localStorage.getItem("routerItem")?localStorage.getItem("routerItem"):localStorage.getItem("router")?localStorage.getItem("router"):this.$route.path.substr(1));
- }
- },
- mounted () {
- this.$store.dispatch("user/SAVE_USER_TASK_COMPLETE")
- this.$store.dispatch("user/SAVE_USER_GRADES")
- this.$store.dispatch("user/SAVE_USER_RIGHTS")
- if ('-ms-scroll-limit' in document.documentElement.style &&
- '-ms-ime-align' in document.documentElement.style) {
- window.addEventListener('hashchange', () => {
- var currentPath = window.location.hash.slice(1)
- if (this.$route.path !== currentPath) {
- this.$router.push(currentPath)
- }
- }, false)
- }
- },
- watch:{
- '$i18n.locale'(){
- document.title = this.$t('common.GEIDcpTitleSeptember');
- let app=document.getElementById('app');
- if(this.$i18n.locale=='en'){
- app.style.fontFamily="Helvetica,neue,sans-serif"
- }else{
- app.style.fontFamily="Microsoft YaHei,Arial,helvetica,neue,sans-serif"
- }
- }
- },
- methods: {
- reload () {
- this.isRouterAlive = false;
- this.$nextTick(function () {
- this.isRouterAlive = true;
- })
- }
- }
- }
- </script>
- <style>
- #app {
- font-family: "Microsoft YaHei",Arial,helvetica,neue,sans-serif;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- text-align: left;
- color: #2c3e50;
- background-color: #f5f5f5;
- /* overflow: hidden; */
- }
- body {
- width: 100%;
- height: 100%;
- margin: 0;
- padding: 0;
- font-family: "Microsoft YaHei";
- }
- @media (max-width: 1199px){
- body{
- width: 1200px;
- overflow: scroll;
- }
- }
- input {font-family: "Microsoft YaHei";}
- ul {
- list-style-type: none;
- padding: 0;
- margin: 0;
- }
- .el-popover {
- max-height: 200px;
- overflow: hidden;overflow-y: scroll;
- }
- /* #bdSharePopup_selectshare1598520503574box{
- display: block !important;
- }
- .bdselect_share_head {
- display: none;
- } */
- </style>
|