Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
卡
卡车调度系统
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
caicaicai
卡车调度系统
Commits
a1e3ff04
Commit
a1e3ff04
authored
Nov 07, 2022
by
xxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改天气接口
parent
6605fa8e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
36 deletions
+22
-36
DPcomputer6.vue
...s/MLargeScreen/components/smallComponents/DPcomputer6.vue
+22
-36
No files found.
src/views/MLargeScreen/components/smallComponents/DPcomputer6.vue
View file @
a1e3ff04
...
@@ -4,23 +4,23 @@
...
@@ -4,23 +4,23 @@
<div
class=
"dataScrView_rightView_title"
>
气象数据
</div>
<div
class=
"dataScrView_rightView_title"
>
气象数据
</div>
<div
class=
"dataScrView_rightView_content"
>
<div
class=
"dataScrView_rightView_content"
>
<div
class=
"todayWeather1"
>
<div
class=
"todayWeather1"
>
<div
style=
"font-size:40px;margin-right:30px;"
>
{{
(
parseInt
(
weatherData
.
today
.
high
.
slice
(
3
,
5
))
+
parseInt
(
weatherData
.
today
.
low
.
slice
(
3
,
5
)))
/
2
}}
℃
</div>
<div
style=
"font-size:40px;margin-right:30px;"
>
{{
weatherData
.
fengli
.
temp
}}
℃
</div>
<img
:src=
" weatherData.today.
type == '晴' ? weatherPic.sunnyPic : weatherData.today.type
== '多云' ? weatherPic.cloudyPic : weatherPic.overcastPic "
height=
"25"
>
<img
:src=
" weatherData.today.
weather == '晴' ? weatherPic.sunnyPic : weatherData.today.weather
== '多云' ? weatherPic.cloudyPic : weatherPic.overcastPic "
height=
"25"
>
<div
style=
"font-size:1
8px;"
>
{{
weatherData
.
today
.
type
}}
/
{{
currentTime
.
day
}}
</div>
<div
style=
"font-size:1
6px;"
>
{{
weatherData
.
today
.
weather
}}
/
{{
currentTime
.
day
}}
</div>
</div>
</div>
<div
class=
"todayWeather2"
>
<div
class=
"todayWeather2"
>
<div
v-for=
"(item,index) in weatherData.forecastData"
:key=
"index"
>
<div
v-for=
"(item,index) in weatherData.forecastData"
:key=
"index"
>
<div
style=
"color:#D0DAFF;font-size:13px;margin-bottom:5px;"
>
{{
item
.
date
}}
</div>
<div
style=
"color:#D0DAFF;font-size:13px;margin-bottom:5px;"
>
{{
item
.
week
}}
</div>
<img
:src=
"item.
type == '晴' ? weatherPic.sunnyPic : item.type
== '多云' ? weatherPic.cloudyPic : weatherPic.overcastPic "
height=
"25"
>
<img
:src=
"item.
weather == '晴' ? weatherPic.sunnyPic : item.weather
== '多云' ? weatherPic.cloudyPic : weatherPic.overcastPic "
height=
"25"
>
<div
style=
"color:#D0DAFF;font-size:1
5px;margin-top:5px;"
>
{{
(
item
.
low
.
slice
(
3
,
6
))
+
'
-
'
+
(
item
.
high
.
slice
(
3
,
6
))
}}
</div>
<div
style=
"color:#D0DAFF;font-size:1
3px;margin-top:5px;"
>
{{
item
.
temp_night_c
+
'
℃-
'
+
item
.
temp_day_c
}}
℃
</div>
</div>
</div>
</div>
</div>
<div
class=
"todayWeather3"
>
<div
class=
"todayWeather3"
>
<img
src=
"../../../../assets/images/cutGraph/fengli1.png"
height=
"45"
>
<img
src=
"../../../../assets/images/cutGraph/fengli1.png"
height=
"45"
>
<div>
风力:
{{
weatherData
.
today
.
fengli
.
slice
(
9
,
10
)
}}
级
</div>
<div>
风力:
{{
weatherData
.
fengli
.
wD
+
weatherData
.
fengli
.
wS
}}
</div>
<div>
<div>
<div>
温度:
{{
(
parseInt
(
weatherData
.
today
.
high
.
slice
(
3
,
5
))
+
parseInt
(
weatherData
.
today
.
low
.
slice
(
3
,
5
)))
/
2
}}
℃
</div>
<div>
温度:
{{
weatherData
.
fengli
.
temp
}}
℃
</div>
<div>
湿度:
{{
(
parseInt
(
weatherData
.
today
.
high
.
slice
(
3
,
5
))
+
parseInt
(
weatherData
.
today
.
low
.
slice
(
3
,
5
)))
/
2
}}
%
</div>
<div>
湿度:
{{
weatherData
.
fengli
.
sD
}}
%
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -37,7 +37,6 @@ import overcastPic from '../../../../assets/images/cutGraph/overcast.png'
...
@@ -37,7 +37,6 @@ import overcastPic from '../../../../assets/images/cutGraph/overcast.png'
export
default
{
export
default
{
data
(){
data
(){
return
{
return
{
DPcomputer6BoxTimer
:
null
,
//时间
//时间
currentTime
:{
currentTime
:{
day
:
''
,
day
:
''
,
...
@@ -53,12 +52,8 @@ export default {
...
@@ -53,12 +52,8 @@ export default {
//天气数据
//天气数据
weatherData
:{
weatherData
:{
forecastData
:[],
forecastData
:[],
today
:{
today
:{},
high
:
'
高温 10℃
'
,
fengli
:{},
low
:
'
高温 10℃
'
,
type
:
'
多云
'
,
fengli
:
'
<![CDATA[0级]]>
'
,
},
},
},
}
}
},
},
...
@@ -72,24 +67,20 @@ export default {
...
@@ -72,24 +67,20 @@ export default {
this
.
yearCurrentTimeFn
();
this
.
yearCurrentTimeFn
();
//获取天气
//获取天气
HttpReq
.
truckDispatching
.
getWeatherInforQuery
({
cityName
:
'
济南
'
}).
then
((
res
)
=>
{
HttpReq
.
truckDispatching
.
getWeatherInforQuery
({
ids
:
'
101121301
'
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
&&
res
.
msg
){
if
(
res
.
code
==
200
&&
res
.
msg
){
let
data1
=
JSON
.
parse
(
res
.
msg
).
data
.
forecast
;
let
data1
=
JSON
.
parse
(
res
.
msg
).
value
[
0
].
weathers
;
this
.
weatherData
.
forecastData
=
data1
;
let
data2
=
[];
this
.
weatherData
.
today
=
data1
[
0
];
for
(
let
i
=
0
;
i
<
5
;
i
++
){
data2
.
push
(
data1
[
i
])
}
}
})
this
.
weatherData
.
forecastData
=
data2
;
this
.
DPcomputer6BoxTimer
=
setInterval
(()
=>
{
//获取天气
HttpReq
.
truckDispatching
.
getWeatherInforQuery
({
cityName
:
'
济南
'
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
&&
res
.
msg
){
let
data1
=
JSON
.
parse
(
res
.
msg
).
data
.
forecast
;
this
.
weatherData
.
forecastData
=
data1
;
this
.
weatherData
.
today
=
data1
[
0
];
this
.
weatherData
.
today
=
data1
[
0
];
let
data3
=
JSON
.
parse
(
res
.
msg
).
value
[
0
].
realtime
;
this
.
weatherData
.
fengli
=
data3
;
}
}
})
})
},
10000
)
},
},
//获取当前时间
//获取当前时间
...
@@ -127,12 +118,7 @@ export default {
...
@@ -127,12 +118,7 @@ export default {
this
.
currentTime
.
year
=
currentFormatDate
;
this
.
currentTime
.
year
=
currentFormatDate
;
},
},
},
},
beforeDestroy
(){
beforeDestroy
(){}
if
(
this
.
DPcomputer6BoxTimer
)
{
clearInterval
(
this
.
DPcomputer6BoxTimer
);
this
.
DPcomputer6BoxTimer
=
null
;
}
}
}
}
</
script
>
</
script
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment