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

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="used-ele">
<div id="used-ele" :style="{ backgroundImage: 'url(' +getImageUrl(bgImage)+')' }">
<div class="content" @click="handleOpenChart">
<div class="item">
<div></div>
@@ -48,6 +48,11 @@ const isVisited = ref(false);
const eleData = ref([])
const electricityConsumptionMonthly = ref()
const monthlySavings = ref(55555)
const bgImage = computed(() =>
isVisited.value
? "bpq_active.png"
: "bg.png"
);
watch(() => props.eleData, (now) => {
getBasicData(now.frequencyChangerList)
}, {deep: true});
@@ -154,7 +159,9 @@ const initChart = () => {
myEcharts.resize();
}
}
const getImageUrl = (name) => {
return new URL(`../../../assets/images/usedEle/${name}`, import.meta.url).href
}
</script>
<style lang="scss" scoped>
@@ -184,7 +191,6 @@ const initChart = () => {
align-items: center;
justify-content: space-between;
cursor: pointer;
.item {
height: 37px;
font-size: 28px;