From 8460c52d762bd1709dd094cfdf638996aa8c2d81 Mon Sep 17 00:00:00 2001 From: dj <1042039504@qq.com> Date: Thu, 2 Jan 2025 23:33:37 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20=E9=9A=A7=E9=81=93ws=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/largeScreen.js | 7 + src/components/content/airInfo/AirInfo.vue | 3 +- .../content/airInfo/childComps/ItemInfo.vue | 21 +- .../tunnelScene/TunnelSceneSimulate.vue | 3 +- src/views/tunnel-simulate/index.vue | 238 ++---------------- 5 files changed, 42 insertions(+), 230 deletions(-) diff --git a/src/api/largeScreen.js b/src/api/largeScreen.js index 8f1f3c7..92c62d3 100644 --- a/src/api/largeScreen.js +++ b/src/api/largeScreen.js @@ -163,6 +163,13 @@ export const startSimulation = (projectId) => { method: 'get' }) } +//模拟状态 +export const simulationState = (projectId) => { + return request({ + url: `/tunnel/simulation/state/${projectId}`, + method: 'get' + }) +} // 结束模拟 export const endSimulation = (projectId) => { return request({ diff --git a/src/components/content/airInfo/AirInfo.vue b/src/components/content/airInfo/AirInfo.vue index cbe10c2..5e6cef9 100644 --- a/src/components/content/airInfo/AirInfo.vue +++ b/src/components/content/airInfo/AirInfo.vue @@ -82,6 +82,7 @@ let dataZoomTop = reactive('87%') let chartData = reactive([]) const chooseDayRef = ref(); const chooseMonthRef = ref(); +const itemInfo = ref(); const windSpeed = ref(0) const windSpeedUnit = ref('m/s') const windDirection = ref(null) @@ -109,7 +110,7 @@ watch(() => props.windSpeed, (now) => { watch(() => props.list, (now) => { airList.value?.forEach(item => { now.forEach(newItem => { - if (newItem.equipmentId === 11) {//风向传感器 + if (newItem.equipmentType === "windDirection") {//风向传感器 windDirection.value = newItem.value } if (item.equipmentId === newItem.equipmentId) { diff --git a/src/components/content/airInfo/childComps/ItemInfo.vue b/src/components/content/airInfo/childComps/ItemInfo.vue index b0af8f3..d8a7453 100644 --- a/src/components/content/airInfo/childComps/ItemInfo.vue +++ b/src/components/content/airInfo/childComps/ItemInfo.vue @@ -24,9 +24,9 @@ const length = ref(null); const value = ref(null); const point = ref(null); const isWaring = ref(); -// watch(() => params.wp.value, () => { -// setValue(); -// }); +watch(() => params.wp.value, () => { + setValue(params.wp.value); +}); onMounted(() => { if (params.wp !== undefined) { setValue(); @@ -36,8 +36,14 @@ onMounted(() => { const getImageUrl = (name) => { return new URL(`../../../../assets/images/airInfo/${name}`, import.meta.url).href } -const setValue = () => { - let width = (params.wp.value * length.value.offsetWidth) / params.wp.max; +const setValue = (realValue) => { + let newValue='' + if(realValue){ + newValue=realValue + }else{ + newValue=params.wp.value + } + let width = (newValue * length.value.offsetWidth) / params.wp.max; value.value.style.width = `${width}px`; let flag = (params.wp.point * length.value.offsetWidth) / params.wp.max; point.value.style.left = `${flag}px`; @@ -51,7 +57,7 @@ const setValue = () => { value.value.style.background = "linear-gradient(270deg, #38CAFB 0%, #E9D726 100%)"; } - isWaring.value = params.wp.value < params.wp.point; + isWaring.value = newValue < params.wp.point; }else { if (width >= flag) { value.value.style.background = @@ -60,14 +66,13 @@ const setValue = () => { value.value.style.background = "linear-gradient(270deg, #38CAFB 0%, #E9D726 100%)"; } - isWaring.value = params.wp.value >= params.wp.point; + isWaring.value = newValue >= params.wp.point; } } // let isWaring = computed(() => { // return params.wp.value >= params.wp.point; // }); -