|
@ -47,9 +47,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
<div class="item"> |
|
|
<div class="item"> |
|
|
<span class="label">风向:</span> |
|
|
<span class="label">风向:</span> |
|
|
<span class="text">{{ |
|
|
<span class="text">{{formattedWindInfo }}</span> |
|
|
data.windDirection ? data.windDirection + "°" : "-" |
|
|
|
|
|
}}</span> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="item"> |
|
|
<div class="item"> |
|
|
<span class="label">风速:</span> |
|
|
<span class="label">风速:</span> |
|
@ -162,6 +160,29 @@ export default { |
|
|
dataList: [], |
|
|
dataList: [], |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
|
|
|
computed: { |
|
|
|
|
|
formattedWindDirection() { |
|
|
|
|
|
const windDirection = this.data.windDirection; |
|
|
|
|
|
|
|
|
|
|
|
if (windDirection === undefined || windDirection === null) { |
|
|
|
|
|
return "-"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (windDirection >= 350 || windDirection <= 10) return "北风"; |
|
|
|
|
|
else if (windDirection > 10 && windDirection <= 80) return "东北风"; |
|
|
|
|
|
else if (windDirection > 80 && windDirection <= 100) return "东风"; |
|
|
|
|
|
else if (windDirection > 100 && windDirection <= 170) return "东南风"; |
|
|
|
|
|
else if (windDirection > 170 && windDirection <= 190) return "南风"; |
|
|
|
|
|
else if (windDirection > 190 && windDirection <= 260) return "西南风"; |
|
|
|
|
|
else if (windDirection > 260 && windDirection <= 280) return "西风"; |
|
|
|
|
|
else if (windDirection > 280 && windDirection < 350) return "西北风"; |
|
|
|
|
|
else return "-"; |
|
|
|
|
|
}, |
|
|
|
|
|
formattedWindInfo() { |
|
|
|
|
|
const windDirection = this.data.windDirection; |
|
|
|
|
|
return windDirection ? `${windDirection}° (${this.formattedWindDirection})` : "-"; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
created() {}, |
|
|
created() {}, |
|
|
methods: {}, |
|
|
methods: {}, |
|
|
mounted() { |
|
|
mounted() { |
|
|