|
@ -4,37 +4,84 @@ |
|
|
<div class="board"> |
|
|
<div class="board"> |
|
|
<div class="showRoad"> |
|
|
<div class="showRoad"> |
|
|
<div class="weaterIcon"> |
|
|
<div class="weaterIcon"> |
|
|
<img src="./assets/weather.png" /> |
|
|
<!-- <img src="./assets/weather.png" /> --> |
|
|
<div> |
|
|
<div> |
|
|
{{ weaterType }} |
|
|
{{ cityWeather.text ? cityWeather.text : "-" }} |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="weaterNum"> |
|
|
<div class="weaterNum"> |
|
|
<div class="num">{{ weaterNum }}°</div> |
|
|
<div class="num"> |
|
|
|
|
|
{{ cityWeather.temp ? cityWeather.temp : "-" }}° |
|
|
|
|
|
</div> |
|
|
<div class="maxMin"> |
|
|
<div class="maxMin"> |
|
|
{{ weaterMaxMin }} |
|
|
{{ cityWeather.windDir ? cityWeather.windDir : "-" |
|
|
|
|
|
}}{{ cityWeather.windScale ? cityWeather.windScale : "-" }}级 |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="windType"> |
|
|
<!-- <div class="windType"> |
|
|
<div class="Warnings">{{ windWarnings }}</div> |
|
|
<div class="Warnings">{{ windWarnings }}</div> |
|
|
<div class="windTypeStr"> |
|
|
<div class="windTypeStr"> |
|
|
{{ windType }} |
|
|
{{ windType }} |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> --> |
|
|
<div class="line"></div> |
|
|
<div class="line"></div> |
|
|
<div class="cityType"> |
|
|
<div class="cityType"> |
|
|
<img src="./assets/cityPosition.png" /> |
|
|
<img src="./assets/cityPosition.png" /> |
|
|
<div class="cityText"> |
|
|
<div class="cityText"> |
|
|
{{ city }} |
|
|
<el-select |
|
|
|
|
|
v-model="city" |
|
|
|
|
|
placeholder="请选择" |
|
|
|
|
|
@change="handleChange" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in regionList" |
|
|
|
|
|
:key="item.regionName" |
|
|
|
|
|
:label="item.regionName" |
|
|
|
|
|
:value="item.regionName" |
|
|
|
|
|
> |
|
|
|
|
|
</el-option> |
|
|
|
|
|
</el-select> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="temperature"> |
|
|
<div class="temperature"> |
|
|
<div class="temperItem" v-for="(it, index) in temperatures"> |
|
|
<div class="temperItem"> |
|
|
|
|
|
<div class="text"> |
|
|
|
|
|
<img src="./assets/polygon.png" /><span>体感温度</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="val"> |
|
|
|
|
|
{{ cityWeather.feelsLike ? cityWeather.feelsLike : "-" }}℃ |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="temperItem"> |
|
|
|
|
|
<div class="text"> |
|
|
|
|
|
<img src="./assets/polygon.png" /><span>湿度</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="val"> |
|
|
|
|
|
{{ cityWeather.humidity ? cityWeather.humidity : "-" }}% |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="temperItem"> |
|
|
<div class="text"> |
|
|
<div class="text"> |
|
|
<img src="./assets/polygon.png" /><span>{{ it.text }}</span> |
|
|
<img src="./assets/polygon.png" /><span>降雨量</span> |
|
|
</div> |
|
|
</div> |
|
|
<div class="val"> |
|
|
<div class="val"> |
|
|
{{ it.value }} |
|
|
{{ cityWeather.precip ? cityWeather.precip : "-" }}mm |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="temperItem"> |
|
|
|
|
|
<div class="text"> |
|
|
|
|
|
<img src="./assets/polygon.png" /><span>能见度</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="val"> |
|
|
|
|
|
{{ cityWeather.vis ? cityWeather.vis : "-" }}km |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="temperItem"> |
|
|
|
|
|
<div class="text"> |
|
|
|
|
|
<img src="./assets/polygon.png" /><span>压力</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="val"> |
|
|
|
|
|
{{ cityWeather.pressure ? cityWeather.pressure : "-" }}hPa |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -45,6 +92,10 @@ |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import WgtTitle from "../../../widgets/title"; |
|
|
import WgtTitle from "../../../widgets/title"; |
|
|
|
|
|
import { |
|
|
|
|
|
getRegionList, |
|
|
|
|
|
getWeatherFacts, |
|
|
|
|
|
} from "@/api/perception/meteorologyCheck"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: "MonthStatistics", |
|
|
name: "MonthStatistics", |
|
@ -53,36 +104,35 @@ export default { |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
weaterNum: "21", |
|
|
regionList: [], |
|
|
weaterMaxMin: "12 / 23°", |
|
|
city: "长清区", |
|
|
weaterType: "睛转小雨", |
|
|
cityWeather: {}, |
|
|
windWarnings: "大风预警", |
|
|
|
|
|
windType: "东北风三级", |
|
|
|
|
|
city: "济南", |
|
|
|
|
|
temperatures: [ |
|
|
|
|
|
{ |
|
|
|
|
|
text: "体感", |
|
|
|
|
|
value: "-14℃", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
text: "PM2.5", |
|
|
|
|
|
value: "90", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
text: "湿度", |
|
|
|
|
|
value: "94%", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
text: "紫外线", |
|
|
|
|
|
value: "3", |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
created() {}, |
|
|
created() {}, |
|
|
methods: {}, |
|
|
methods: { |
|
|
|
|
|
initData() { |
|
|
|
|
|
getRegionList().then((res) => { |
|
|
|
|
|
this.regionList = res.rows; |
|
|
|
|
|
this.handleChange(); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
handleChange() { |
|
|
|
|
|
getWeatherFacts().then((response) => { |
|
|
|
|
|
console.log("response", response.data); |
|
|
|
|
|
for (let key in response.data) { |
|
|
|
|
|
debugger; |
|
|
|
|
|
if (response.data[key].name == this.city) { |
|
|
|
|
|
this.cityWeather = response.data[key]; |
|
|
|
|
|
console.log("this.cityWeather", this.cityWeather); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
|
|
|
this.initData(); |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
this.$nextTick(() => {}); |
|
|
this.$nextTick(() => {}); |
|
|
}); |
|
|
}); |
|
@ -139,7 +189,7 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
> div { |
|
|
> div { |
|
|
font-size: 12px; |
|
|
font-size: 22px; |
|
|
font-family: PingFang SC, PingFang SC; |
|
|
font-family: PingFang SC, PingFang SC; |
|
|
font-weight: 500; |
|
|
font-weight: 500; |
|
|
color: #ffffff; |
|
|
color: #ffffff; |
|
@ -222,11 +272,11 @@ export default { |
|
|
|
|
|
|
|
|
.cityType { |
|
|
.cityType { |
|
|
display: inline-flex; |
|
|
display: inline-flex; |
|
|
width: 60px; |
|
|
width: 100px; |
|
|
height: 80px; |
|
|
height: 80px; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
margin-right: 27px; |
|
|
margin-right: 40px; |
|
|
|
|
|
|
|
|
img { |
|
|
img { |
|
|
width: 38px; |
|
|
width: 38px; |
|
@ -245,7 +295,7 @@ export default { |
|
|
.temperature { |
|
|
.temperature { |
|
|
display: inline-flex; |
|
|
display: inline-flex; |
|
|
flex-direction: row; |
|
|
flex-direction: row; |
|
|
width: 349px; |
|
|
width: 430px; |
|
|
height: 66px; |
|
|
height: 66px; |
|
|
background: transparent; |
|
|
background: transparent; |
|
|
opacity: 1; |
|
|
opacity: 1; |
|
@ -257,6 +307,9 @@ export default { |
|
|
) |
|
|
) |
|
|
1 1; |
|
|
1 1; |
|
|
border-radius: 8px; |
|
|
border-radius: 8px; |
|
|
|
|
|
img { |
|
|
|
|
|
width: 7px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
> div { |
|
|
> div { |
|
|
display: inline-flex; |
|
|
display: inline-flex; |
|
@ -272,7 +325,7 @@ export default { |
|
|
font-weight: 500; |
|
|
font-weight: 500; |
|
|
> span { |
|
|
> span { |
|
|
opacity: 0.5; |
|
|
opacity: 0.5; |
|
|
margin-left: 10px; |
|
|
margin-left: 5px; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -282,16 +335,15 @@ export default { |
|
|
font-family: PingFang SC, PingFang SC; |
|
|
font-family: PingFang SC, PingFang SC; |
|
|
font-weight: 500; |
|
|
font-weight: 500; |
|
|
color: #ffffff; |
|
|
color: #ffffff; |
|
|
position: relative; |
|
|
// position: relative; |
|
|
left: 10px; |
|
|
// left: 10px; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.charts { |
|
|
::v-deep input.el-input__inner { |
|
|
height: 180px; |
|
|
font-size: 12px; |
|
|
width: 100%; |
|
|
|
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |
|
|