|
|
|
@ -11,14 +11,119 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { init_echarts } from '../utils/initEcharts'
|
|
|
|
|
import * as echarts from 'echarts'
|
|
|
|
|
import { humanTrafficStatistics } from '@/api/sensingDevice/resource'
|
|
|
|
|
export default {
|
|
|
|
|
name: 'PeopleLarge',
|
|
|
|
|
|
|
|
|
|
data() {
|
|
|
|
|
return {}
|
|
|
|
|
return {
|
|
|
|
|
list: [],
|
|
|
|
|
list1: []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
init_echarts()
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.echarts_icon()
|
|
|
|
|
}, 500)
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.onhumanTrafficStatistics()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async onhumanTrafficStatistics() {
|
|
|
|
|
const res = await humanTrafficStatistics()
|
|
|
|
|
this.list = Object.keys(res.data)
|
|
|
|
|
this.list1 = Object.values(res.data)
|
|
|
|
|
console.log(this.list, 'iiiii')
|
|
|
|
|
},
|
|
|
|
|
//
|
|
|
|
|
echarts_icon() {
|
|
|
|
|
console.log(this.list, 'haha')
|
|
|
|
|
console.log('hza')
|
|
|
|
|
var chartDom = document.getElementById('people_chart')
|
|
|
|
|
var myChart = echarts.init(chartDom)
|
|
|
|
|
var option
|
|
|
|
|
option = {
|
|
|
|
|
color: ['#80FFA5', '#00DDFF', '#37A2FF', '#FF0087', '#FFBF00'],
|
|
|
|
|
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis',
|
|
|
|
|
axisPointer: {
|
|
|
|
|
type: 'cross',
|
|
|
|
|
label: {
|
|
|
|
|
backgroundColor: '#6a7985'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
toolbox: {
|
|
|
|
|
feature: {
|
|
|
|
|
saveAsImage: {}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// legend: {
|
|
|
|
|
// itemGap: 24 // 修改间距
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
grid: {
|
|
|
|
|
top: '10%',
|
|
|
|
|
left: '3%',
|
|
|
|
|
right: '4%',
|
|
|
|
|
bottom: '3%',
|
|
|
|
|
containLabel: true
|
|
|
|
|
},
|
|
|
|
|
xAxis: [
|
|
|
|
|
{
|
|
|
|
|
type: 'category',
|
|
|
|
|
boundaryGap: false,
|
|
|
|
|
data: this.list,
|
|
|
|
|
axisLabel: {
|
|
|
|
|
textStyle: {
|
|
|
|
|
fontSize: '7'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
yAxis: [
|
|
|
|
|
{
|
|
|
|
|
type: 'value'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
name: '人流量',
|
|
|
|
|
type: 'line',
|
|
|
|
|
stack: 'Total',
|
|
|
|
|
smooth: true,
|
|
|
|
|
lineStyle: {
|
|
|
|
|
borderColor: '#464646',
|
|
|
|
|
width: 0
|
|
|
|
|
},
|
|
|
|
|
showSymbol: false,
|
|
|
|
|
areaStyle: {
|
|
|
|
|
opacity: 0.8,
|
|
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
|
|
{
|
|
|
|
|
offset: 0,
|
|
|
|
|
color: 'rgb(128, 255, 165)'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
offset: 1,
|
|
|
|
|
color: 'rgb(1, 191, 236)'
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
},
|
|
|
|
|
emphasis: {
|
|
|
|
|
focus: 'series'
|
|
|
|
|
},
|
|
|
|
|
data: this.list1
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
option && myChart.setOption(option)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
@ -52,11 +157,11 @@ export default {
|
|
|
|
|
background-image: url('@/assets/picture/bg_5.png');
|
|
|
|
|
background-size: 100% auto;
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.people_chart {
|
|
|
|
|
#people_chart {
|
|
|
|
|
width: 20vw;
|
|
|
|
|
height: 25vh;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|