Browse Source

天气预报api

wangqin
zhangzhang 7 months ago
parent
commit
474edded17
  1. 2
      ruoyi-ui/src/router/routerCreater.js
  2. 9
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/sortFaceForecast/index.vue
  3. 142
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/weatherForecast/index.vue
  4. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/weatherInfoQuery/components/weaterData/index.vue
  5. 1
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/weatherWarning/components/infoWarning/index.vue
  6. 1
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/weatherWarning/components/infowWarningList/index.vue
  7. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/components/AddNEditDialog.vue
  8. 9
      ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/components/Card.vue

2
ruoyi-ui/src/router/routerCreater.js

@ -44,7 +44,7 @@ function processNode(node) {
if (!item.component) { if (!item.component) {
temp.component = compX; temp.component = compX;
} else { } else {
console.log(item.component); // console.log(item.component);
temp.component = (resolve) => temp.component = (resolve) =>
require(["@/views/JiHeExpressway/pages/" + item.component], resolve); //views/visualization/pages/${item.component} require(["@/views/JiHeExpressway/pages/" + item.component], resolve); //views/visualization/pages/${item.component}
} }

9
ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/sortFaceForecast/index.vue

@ -50,8 +50,8 @@
<span class="text">{{ item.precip || "--" }}mm</span> <span class="text">{{ item.precip || "--" }}mm</span>
</div> </div>
<div class="item"> <div class="item">
<span class="title">能见度等级</span> <span class="title">能见度</span>
<span class="text">{{ item.vis || "--" }}</span> <span class="text">{{ item.vis || "--" }}km</span>
</div> </div>
<!-- <div class="item"> <!-- <div class="item">
<span class="title">能见度等级</span> <span class="title">能见度等级</span>
@ -530,11 +530,7 @@ export default {
// //
getHourlyWeatherFacts(id) { getHourlyWeatherFacts(id) {
getHourlyWeather().then((response) => { getHourlyWeather().then((response) => {
console.log("response", response);
console.log("this.selectIndex", this.selectIndex);
let obj = response.data; let obj = response.data;
console.log("obj", obj);
let data = []; let data = [];
for (let key in obj) { for (let key in obj) {
// if (key === "hourlyWeather1") { // if (key === "hourlyWeather1") {
@ -562,7 +558,6 @@ export default {
newData.push(item[id - 1]); newData.push(item[id - 1]);
}); });
this.weatherList = newData; this.weatherList = newData;
console.log("data", newData);
}); });
}, },
}, },

142
ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/weatherForecast/index.vue

@ -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">
<img src="./assets/polygon.png" /><span>降雨量</span>
</div>
<div class="val">
{{ 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"> <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.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>

4
ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/weatherInfoQuery/components/weaterData/index.vue

@ -132,9 +132,7 @@ export default {
}, },
watch: { watch: {
data: { data: {
handler(newVal) { handler(newVal) {},
console.log(newVal);
},
deep: true, deep: true,
}, },
}, },

1
ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/weatherWarning/components/infoWarning/index.vue

@ -135,7 +135,6 @@ export default {
methods: { methods: {
getWarningData() { getWarningData() {
getMeteorologicalEarlyWarning().then((res) => { getMeteorologicalEarlyWarning().then((res) => {
console.log("气象预警", res.data);
let data = []; let data = [];
for (let key in res.data) { for (let key in res.data) {
if (res.data[key].length > 0) { if (res.data[key].length > 0) {

1
ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/weatherWarning/components/infowWarningList/index.vue

@ -56,7 +56,6 @@ export default {
}, },
getWarningType() { getWarningType() {
getListVisibility().then((res) => { getListVisibility().then((res) => {
console.log("获取预警类型", res.rows);
this.tableData = res.rows; this.tableData = res.rows;
}); });
}, },

2
ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/components/AddNEditDialog.vue

@ -245,8 +245,6 @@ export default {
}); });
} }
}); });
console.log("新增", this.formData);
}, },
}, },
}; };

9
ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/components/Card.vue

@ -80,9 +80,9 @@ export default {
// this.$emit("handleDelete", item); // this.$emit("handleDelete", item);
}, },
initData() { // initData() {
console.log("初始化数据", this.data); // console.log("", this.data);
}, // },
handleChangeSwitcher(val) { handleChangeSwitcher(val) {
let data = { let data = {
id: this.data.id, id: this.data.id,
@ -91,11 +91,10 @@ export default {
updateEnabledChannels(data).then(() => { updateEnabledChannels(data).then(() => {
this.$parent.handleSearch(); this.$parent.handleSearch();
}); });
console.log(88888, val);
}, },
}, },
mounted() { mounted() {
this.initData(); // this.initData();
}, },
watch: { watch: {
data: { data: {

Loading…
Cancel
Save