diff --git a/src/components/content/airInfo/childComps/ItemInfo.vue b/src/components/content/airInfo/childComps/ItemInfo.vue index f09c288..8da6d26 100644 --- a/src/components/content/airInfo/childComps/ItemInfo.vue +++ b/src/components/content/airInfo/childComps/ItemInfo.vue @@ -41,14 +41,28 @@ const setValue = () => { value.value.style.width = `${width}px`; let flag = (params.wp.point * length.value.offsetWidth) / params.wp.max; point.value.style.left = `${flag}px`; - if (width >= flag) { - value.value.style.background = - "linear-gradient(270deg, #FB3838 0%, #E98526 100%)"; - } else { - value.value.style.background = - "linear-gradient(270deg, #38CAFB 0%, #E9D726 100%)"; + + + if(params.wp.name=='氧气'){ + if (width < flag) { + value.value.style.background = + "linear-gradient(270deg, #FB3838 0%, #E98526 100%)"; + } else { + value.value.style.background = + "linear-gradient(270deg, #38CAFB 0%, #E9D726 100%)"; + } + isWaring.value = params.wp.value < params.wp.point; + }else { + if (width >= flag) { + value.value.style.background = + "linear-gradient(270deg, #FB3838 0%, #E98526 100%)"; + } else { + value.value.style.background = + "linear-gradient(270deg, #38CAFB 0%, #E9D726 100%)"; + } + isWaring.value = params.wp.value >= params.wp.point; } - isWaring.value = params.wp.value >= params.wp.point; + } // let isWaring = computed(() => { // return params.wp.value >= params.wp.point; diff --git a/src/components/content/windPressure/childComps/WindPressureItem.vue b/src/components/content/windPressure/childComps/WindPressureItem.vue index 65e635e..723b0ad 100644 --- a/src/components/content/windPressure/childComps/WindPressureItem.vue +++ b/src/components/content/windPressure/childComps/WindPressureItem.vue @@ -42,7 +42,7 @@ function setValue() { value.value.style.width = `${width}px`; let flag = (params.wp.point * length.value.offsetWidth) / params.wp.max; point.value.style.left = `${flag}px`; - if (width >= flag) { + if (width < flag) { value.value.style.background = "#F53839"; } else { value.value.style.background = "#60DDDE"; @@ -50,7 +50,7 @@ function setValue() { } let isWaring = computed(() => { - return params.wp.value >= params.wp.point; + return params.wp.value < params.wp.point; });