diff --git a/src/components/heat.vue b/src/components/heat.vue index 4c874af..b1cdabe 100644 --- a/src/components/heat.vue +++ b/src/components/heat.vue @@ -23,12 +23,11 @@ export default defineComponent({ }, mounted() { + this.getHeatImaging(); setInterval(() => { // 获取数据 this.getHeatImaging(); - }, 5000); - // 获取数据 - this.getHeatImaging(); + }, 3000); }, unmounted() { @@ -45,7 +44,9 @@ export default defineComponent({ const { warehouseId } = this.$route.query; const param = { warehouseId: warehouseId ? warehouseId : 7 }; const data = await getHeatImaging(param); - this.src = data.imageData; + if (data && data.imageData) { + this.src = data.imageData; + } } catch (error) { console.log("error: ", error); } diff --git a/src/components/humidity.vue b/src/components/humidity.vue index e654b41..104c96e 100644 --- a/src/components/humidity.vue +++ b/src/components/humidity.vue @@ -61,6 +61,7 @@ export default defineComponent({ }, mounted() { + this.getTeamAndHumidity(); setInterval(() => { // 获取数据 this.getTeamAndHumidity(); diff --git a/src/components/temperature.vue b/src/components/temperature.vue index 5207e2b..1d66176 100644 --- a/src/components/temperature.vue +++ b/src/components/temperature.vue @@ -61,6 +61,7 @@ export default defineComponent({ }, mounted() { + this.getTeamAndHumidity(); setInterval(() => { // 获取数据 this.getTeamAndHumidity(); diff --git a/src/components/top-bar.vue b/src/components/top-bar.vue index d80c51f..8ece7f7 100644 --- a/src/components/top-bar.vue +++ b/src/components/top-bar.vue @@ -59,6 +59,9 @@ export default defineComponent({ }, mounted() { + this.getTeamAndHumidity(); + this.getFireOrFlood(); + // 获取当前时间 setInterval(() => { this.getNowFormatDate(); @@ -68,7 +71,7 @@ export default defineComponent({ // 获取数据 this.getTeamAndHumidity(); this.getFireOrFlood(); - }, 600000); + }, 3000); }, methods: { @@ -77,7 +80,7 @@ export default defineComponent({ try { const { parkId, warehouseId } = this.$route.query; const param = { - parkId: parkId ? parkId : 1, + parkId: parkId ? parkId : 2, warehouseId: warehouseId ? warehouseId : 7, }; const data = await getTeamAndHumidity(param); @@ -97,7 +100,7 @@ export default defineComponent({ try { const { parkId, warehouseId } = this.$route.query; const param = { - parkId: parkId ? parkId : 1, + parkId: parkId ? parkId : 2, warehouseId: warehouseId ? warehouseId : 7, }; const data = await getFireOrFlood(param); @@ -240,6 +243,15 @@ export default defineComponent({ background-image: url("../assets/img/water.png"); } +.state { + animation: twinkling 1s infinite ease-in-out; +} +.animated { + animation-duration: 1s; + animation-duration: 1s; + animation-fill-mode: both; + animation-fill-mode: both; +} @keyframes twinkling { 0% { opacity: 0; @@ -248,8 +260,4 @@ export default defineComponent({ opacity: 1; } } - -.state { - animation: twinkling 1s infinite; -}