邓洁 : 打开弹窗时背景更改

This commit is contained in:
admin
2023-12-14 16:41:51 +08:00
parent d6661dc5fd
commit c70dd888fd
6 changed files with 44 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div id="bad-gas-info">
<div id="bad-gas-info" :style="{ backgroundImage: 'url(' +getImageUrl(bgImage)+')' }">
<div class="title">有害气体</div>
<div class="info-list">
<gas-info-item v-for="item in badGasList" :key="item.equipmentId" :gasInfo="item" @click="handleOpenChart"/>
@@ -38,7 +38,11 @@ const selectTimeButton = ref(0);
const isVisited = ref(false);
const badGasList = ref([])
let myEcharts = reactive({});
const bgImage = computed(() =>
isVisited.value
? "sp_active.png"
: "bg.png"
);
watch(() => props.list, (now) => {
badGasList.value.forEach(item => {
now.forEach(newItem => {
@@ -90,6 +94,9 @@ const handleOpenChart = () => {
initChart()
})
}
const getImageUrl = (name) => {
return new URL(`../../../assets/images/badGasInfo/${name}`, import.meta.url).href
}
/**
* 初始化echarts实例方法
*/
@@ -213,7 +220,7 @@ const initChart = () => {
height: 621px;
top: 1441px;
right: 72px;
background-image: url(@/assets/images/badGasInfo/bg.png);
background-image: url(../../../assets/images/badGasInfo/bg.png);
.title {