|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<el-container v-loading="isLoading" class="hc-home-datav-box relative h-full w-full">
|
|
|
- <div class="datav-bg">
|
|
|
+ <div class="datav-bg" v-if="isBgImg">
|
|
|
<img :src="bgImg" alt="背景图片">
|
|
|
</div>
|
|
|
<el-header id="datav-header" class="relative p-0">
|
|
@@ -83,7 +83,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { onMounted, onUnmounted, ref } from 'vue'
|
|
|
-import { useRouter } from 'vue-router'
|
|
|
+import {useRouter} from 'vue-router'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
import { initProjectContract } from '~sto/app'
|
|
|
import { userConfigSave } from '~api/other'
|
|
@@ -113,12 +113,28 @@ defineOptions({
|
|
|
name: 'HcDataV',
|
|
|
})
|
|
|
|
|
|
+const isBgImg = ref(store.isDatavBg)
|
|
|
+
|
|
|
//渲染完成
|
|
|
onMounted(() => {
|
|
|
windowResize()
|
|
|
setInitData()
|
|
|
+ isBgImg.value = store.isDatavBg
|
|
|
+ if (!isBgImg.value) {
|
|
|
+ setTimeout(() => {
|
|
|
+ setAppStyle()
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
+//设置样式
|
|
|
+const htmlClass = ref('')
|
|
|
+const setAppStyle = () => {
|
|
|
+ const appClass = document.documentElement.getAttribute('class')
|
|
|
+ htmlClass.value = appClass
|
|
|
+ document.documentElement.setAttribute('class', `${appClass} is-no-bg`)
|
|
|
+}
|
|
|
+
|
|
|
//加载
|
|
|
const isLoading = ref(false)
|
|
|
const fullScreenRef = ref()
|
|
@@ -273,9 +289,18 @@ const fullScreenClick = () => {
|
|
|
//被卸载
|
|
|
onUnmounted(() => {
|
|
|
window.removeEventListener('resize', resizeEvent)
|
|
|
+ if (htmlClass.value) {
|
|
|
+ document.documentElement.setAttribute('class', htmlClass.value)
|
|
|
+ }
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
@import "~src/styles/view/datav.scss";
|
|
|
+html.is-no-bg {
|
|
|
+ background-color: transparent;
|
|
|
+ body, #app, .hc-home-datav-box {
|
|
|
+ background-color: transparent;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|