From 7f4105bc2f1d4f8562e1cb9776ce49f8be0c98d2 Mon Sep 17 00:00:00 2001
From: yj <2077506045@qq.com>
Date: 星期二, 03 十二月 2024 13:46:37 +0800
Subject: [PATCH] 更新CAQ优化,适配低分辨率设备
---
src/layout/index.vue | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/layout/index.vue b/src/layout/index.vue
index abbd80c..1de7e4b 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -1,6 +1,6 @@
<template>
<el-container>
- <el-header height="60" class="student-header header" :style="{'background-color': logo!='none'?'#fff':'#409eff'}">
+ <el-header height="60" class="student-header header" :style="{'background-color': backgroundColor}">
<div class="head-language" v-if="langFlag">
<!--<lang-select class="right-menu-item" />-->
<!--鍥介檯鍖栫殑璇█閫夋嫨-->
@@ -25,8 +25,8 @@
<el-main class="student-main" style="margin-top:20px;">
<router-view/>
</el-main>
- <el-footer height="340" class="student-footer">
- </el-footer>
+ <!-- <el-footer height="340" class="student-footer">
+ </el-footer> -->
</el-container>
</template>
@@ -39,6 +39,7 @@
return {
defaultUrl: '/index',
logoHeight: 50,
+ backgroundColor: '#fff',
userInfo: {
imagePath: null
},
@@ -51,38 +52,38 @@
},
watch: {
logo: function (val) {
- let sessionLogoUrl = sessionStorage.getItem('logoUrl')
+ let sessionLogoUrl = localStorage.getItem('logoUrl')
if (this.productType === 'API_Fan') {
this.logoUrl = require('@/assets/logo-apifan.png')
} else if (val === 'none') {
+ this.backgroundColor = '#409eff'
this.logoUrl = require('@/assets/logo-t.png')
} else if (val !== null) {
this.logoUrl = val
+ this.backgroundColor = '#fff'
} else if (sessionLogoUrl !== null) {
this.logoUrl = sessionLogoUrl
}
- console.log('logoUrl:' + this.logoUrl)
- sessionStorage.setItem('logoUrl', this.logoUrl)
+ localStorage.setItem('logoUrl', this.logoUrl)
+ localStorage.setItem('backgroundColor', this.backgroundColor)
}
},
mounted () {
- let sessionLogoUrl = sessionStorage.getItem('logoUrl')
+ let sessionLogoUrl = localStorage.getItem('logoUrl')
+ let sessionBackgroundColor = localStorage.getItem('backgroundColor')
if (sessionLogoUrl !== null) {
this.logoUrl = sessionLogoUrl
+ this.backgroundColor = sessionBackgroundColor
}
+ localStorage.setItem('backgroundColor', this.backgroundColor)
window.addEventListener('beforeunload', this.handleBeforeUnload)
- window.addEventListener('unload', this.handleUnload)
},
beforeDestroy () {
window.removeEventListener('beforeunload', this.handleBeforeUnload)
- window.removeEventListener('unload', this.handleUnload)
},
methods: {
handleBeforeUnload: function () {
- sessionStorage.setItem('logoUrl', this.logoUrl)
- },
- handleUnload: function () {
- console.log('宸茬粡鍒锋柊')
+ localStorage.setItem('logoUrl', this.logoUrl)
},
logout: function () {
window.opener = null
@@ -113,7 +114,7 @@
// logoUrl: function () {
// console.log('this.logo')
// console.log(this.logo)
- // let sessionLogoUrl = this.setLogo(sessionStorage.getItem('logoUrl'))
+ // let sessionLogoUrl = this.setLogo(localStorage.getItem('logoUrl'))
// if (this.productType === 'API_Fan') {
// return require('@/assets/logo-apifan.png')
// } else if (this.logo === 'none') {
@@ -121,7 +122,7 @@
// } else if (this.logo === null && sessionLogoUrl !== null) {
// return sessionLogoUrl
// } else {
- // sessionStorage.setItem('logoUrl', this.logo)
+ // localStorage.setItem('logoUrl', this.logo)
// return this.logo
// }
// },
--
Gitblit v1.9.1