|
|
@ -1,17 +1,36 @@ |
|
|
|
<template> |
|
|
|
<Card class='CrowdnessIndicatorRankings border' title="拥挤度指标排名情况"> |
|
|
|
<Card class="CrowdnessIndicatorRankings border" title="拥挤度指标排名情况"> |
|
|
|
<div class="map"> |
|
|
|
<AMapContainer v-if="delayLoad" style="z-index: 9;" /> |
|
|
|
<AMapContainer v-if="delayLoad" style="z-index: 9" /> |
|
|
|
</div> |
|
|
|
<div class="right border"> |
|
|
|
<div :class="['item', { active: isActive(item) }]" v-for="item in operation" :key="item.key" |
|
|
|
@click="handleClick(item)"> |
|
|
|
<ElPopover trigger="manual" :value="isActive(item)" :disabled="item.key !== 'weather'" placement="left"> |
|
|
|
<div v-if="item.key === 'weather'"> |
|
|
|
天气:晴 能见度:优 风向:西南 风力:1级 |
|
|
|
<div |
|
|
|
:class="['item', { active: isActive(item) }]" |
|
|
|
v-for="item in operation" |
|
|
|
:key="item.key" |
|
|
|
@click="handleClick(item)" |
|
|
|
> |
|
|
|
<ElPopover |
|
|
|
trigger="manual" |
|
|
|
:value="isActive(item)" |
|
|
|
:disabled="item.key !== 'weather'" |
|
|
|
placement="left" |
|
|
|
> |
|
|
|
<div v-if="item.key === 'weather'" class="weather"> |
|
|
|
<span>天气:{{ weatherData.text }}</span> |
|
|
|
<span>能见度:{{ weatherData.vis }}公里</span> |
|
|
|
<span>风向:{{ weatherData.windDir }}</span> |
|
|
|
<span>风力:{{ weatherData.windScale }}级</span> |
|
|
|
</div> |
|
|
|
<div class="label" slot="reference" |
|
|
|
:style="{ backgroundImage: `url(${require(`./images/${item.key}${isActive(item) ? '-active' : ''}.svg`)})` }" /> |
|
|
|
<div |
|
|
|
class="label" |
|
|
|
slot="reference" |
|
|
|
:style="{ |
|
|
|
backgroundImage: `url(${require(`./images/${item.key}${ |
|
|
|
isActive(item) ? '-active' : '' |
|
|
|
}.svg`)})`, |
|
|
|
}" |
|
|
|
/> |
|
|
|
</ElPopover> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -19,15 +38,16 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import Card from "@screen/components/Card2/Card.vue";; |
|
|
|
import AMapContainer from "@screen/pages/Home/components/AMapContainer/index.vue" |
|
|
|
import { provideMixin } from "./../../mixin" |
|
|
|
import Card from "@screen/components/Card2/Card.vue"; |
|
|
|
import AMapContainer from "@screen/pages/Home/components/AMapContainer/index.vue"; |
|
|
|
import { provideMixin } from "./../../mixin"; |
|
|
|
import { WeatherForecast } from "@/api/commandDispatch"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'CrowdnessIndicatorRankings', |
|
|
|
name: "CrowdnessIndicatorRankings", |
|
|
|
components: { |
|
|
|
Card, |
|
|
|
AMapContainer |
|
|
|
AMapContainer, |
|
|
|
}, |
|
|
|
mixins: [provideMixin], |
|
|
|
data() { |
|
|
@ -35,58 +55,71 @@ export default { |
|
|
|
active: [], |
|
|
|
operation: [ |
|
|
|
{ |
|
|
|
key: 'weather', |
|
|
|
label: "天气" |
|
|
|
key: "weather", |
|
|
|
label: "天气", |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: 'camera', |
|
|
|
label: "摄像机" |
|
|
|
key: "camera", |
|
|
|
label: "摄像机", |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: 'bar', |
|
|
|
label: "柱状图" |
|
|
|
key: "bar", |
|
|
|
label: "柱状图", |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: 'level', |
|
|
|
label: "天气" |
|
|
|
key: "level", |
|
|
|
label: "天气", |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: 'car', |
|
|
|
label: "天气" |
|
|
|
key: "car", |
|
|
|
label: "天气", |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: 'pie', |
|
|
|
label: "天气" |
|
|
|
key: "pie", |
|
|
|
label: "天气", |
|
|
|
}, |
|
|
|
], |
|
|
|
delayLoad: false |
|
|
|
} |
|
|
|
delayLoad: true, |
|
|
|
weatherData: {}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
isActive() { |
|
|
|
return item => this.active.includes(item.key) |
|
|
|
} |
|
|
|
return (item) => this.active.includes(item.key); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleClick(item) { |
|
|
|
const findIndex = this.active.indexOf(item.key); |
|
|
|
if (findIndex === -1) this.active.push(item.key); |
|
|
|
else |
|
|
|
this.active.splice(findIndex, 1) |
|
|
|
} |
|
|
|
else this.active.splice(findIndex, 1); |
|
|
|
}, |
|
|
|
getWeatherForecast() { |
|
|
|
WeatherForecast(117.2, 36.65).then((res) => { |
|
|
|
this.weatherData = |
|
|
|
res.data.weatherInTheAreaWhereTheIncidentOccurred.now; |
|
|
|
console.log("气象", res); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
setTimeout(() => { |
|
|
|
this.delayLoad = true |
|
|
|
}, 240); |
|
|
|
this.getWeatherForecast(); |
|
|
|
// setTimeout(() => { |
|
|
|
// this.delayLoad = true; |
|
|
|
// }, 240); |
|
|
|
}, |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang='scss' scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.border { |
|
|
|
border: 1px solid; |
|
|
|
border-image: linear-gradient(360deg, rgba(55, 231, 255, .42), rgba(55, 231, 255, 0)) 1 1; |
|
|
|
border-image: linear-gradient( |
|
|
|
360deg, |
|
|
|
rgba(55, 231, 255, 0.42), |
|
|
|
rgba(55, 231, 255, 0) |
|
|
|
) |
|
|
|
1 1; |
|
|
|
} |
|
|
|
|
|
|
|
.CrowdnessIndicatorRankings { |
|
|
@ -108,7 +141,11 @@ export default { |
|
|
|
height: 100%; |
|
|
|
top: 0; |
|
|
|
width: 34px; |
|
|
|
background: linear-gradient(180deg, rgba(25, 40, 52, .6) 0%, rgba(28, 50, 60, .6) 100%); |
|
|
|
background: linear-gradient( |
|
|
|
180deg, |
|
|
|
rgba(25, 40, 52, 0.6) 0%, |
|
|
|
rgba(28, 50, 60, 0.6) 100% |
|
|
|
); |
|
|
|
border-right: 0; |
|
|
|
border-bottom: 0; |
|
|
|
|
|
|
@ -125,7 +162,7 @@ export default { |
|
|
|
div { |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
transition: all .15s linear; |
|
|
|
transition: all 0.15s linear; |
|
|
|
background-size: 100% 100%; |
|
|
|
background-repeat: no-repeat; |
|
|
|
background-position: center; |
|
|
@ -133,8 +170,12 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
.active { |
|
|
|
background: linear-gradient(180deg, #005C79 0%, #009BCC 100%); |
|
|
|
background: linear-gradient(180deg, #005c79 0%, #009bcc 100%); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.weather span { |
|
|
|
margin-right: 20px; |
|
|
|
display: inline-block; |
|
|
|
} |
|
|
|
</style> |
|
|
|