hezhengao
何峥傲 1 year ago
parent 1a19526ff9
commit 361452b465

@ -23,3 +23,19 @@ export function humanVehicleStatistics(params) {
params params
}) })
} }
//人流量
export function humanTrafficStatistics(params) {
return request({
url: '/base/perceptionDevice/humanTrafficStatistics',
method: 'post',
params
})
}
//车流量
export function vehicleTrafficStatistics(params) {
return request({
url: '/base/perceptionDevice/vehicleTrafficStatistics',
method: 'post',
params
})
}

@ -3,10 +3,10 @@ import vm from '../main'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
const request = axios.create({ const request = axios.create({
baseURL: 'http://50.146.63.43:1129/hjapi', // baseURL: 'http://50.146.63.43:1129/hjapi',
// baseURL: 'http://121.41.91.94:12002/hjapi', // baseURL: 'http://121.41.91.94:12002/hjapi',
//baseURL: `http://${window.location.host}/hjapi`, //baseURL: `http://${window.location.host}/hjapi`,
// baseURL: 'http://121.41.91.94:12524/hjapi/', //外网 baseURL: 'http://121.41.91.94:12524/hjapi/', //外网
timeout: 50000, timeout: 50000,
headers: { 'content-type': 'application/json' } headers: { 'content-type': 'application/json' }
}) })

@ -15,11 +15,14 @@
</div> </div>
<div> <div>
<div class="build_box_for" v-for="(item, index) in boxlist" :key="index"> <div
class="build_box_for"
v-for="(item, index) in boxlist"
:key="index"
>
<div class="build_box_right">{{ item.place }}</div> <div class="build_box_right">{{ item.place }}</div>
</div> </div>
</div> </div>
</div> </div>
<!-- 实有房屋 --> <!-- 实有房屋 -->
<ActualBuildingVue></ActualBuildingVue> <ActualBuildingVue></ActualBuildingVue>
@ -57,7 +60,11 @@
> >
{{ item.floor2 }} {{ item.floor2 }}
</div> </div>
<div class="f3" :style="{ backgroundImage: back_change2(item.type1) }"> <div
class="f3"
@click="floorinfo1"
:style="{ backgroundImage: back_change2(item.type1) }"
>
{{ item.floor3 }} {{ item.floor3 }}
</div> </div>
</div> </div>
@ -165,6 +172,10 @@ export default {
console.log(123) console.log(123)
this.$emit('floorinfo') this.$emit('floorinfo')
}, },
floorinfo1() {
console.log(123)
this.$emit('floorinfo1')
},
deleteinfo() { deleteinfo() {
this.play = !this.play this.play = !this.play
this.$emit('deleteinfo') this.$emit('deleteinfo')
@ -269,8 +280,6 @@ export default {
} }
} }
.structure { .structure {
width: 18vw; width: 18vw;
height: 4vh; height: 4vh;

@ -35,7 +35,11 @@
<!-- 显示实有房屋弹窗 --> <!-- 显示实有房屋弹窗 -->
<div class="left_house_box" v-else-if="isplay == '2'"> <div class="left_house_box" v-else-if="isplay == '2'">
<BuildingInform @floorinfo="floorinfo" @deleteinfo="deleteinfo" ></BuildingInform> <BuildingInform
@floorinfo="floorinfo"
@deleteinfo="deleteinfo"
@floorinfo1="floorinfo1"
></BuildingInform>
</div> </div>
<div class="floorInform" v-if="only"> <div class="floorInform" v-if="only">
<floorInform></floorInform> <floorInform></floorInform>
@ -160,7 +164,6 @@ export default {
this.isplay = 2 this.isplay = 2
// //
document.getElementsByClassName('point_list')[0].style.right = '0' document.getElementsByClassName('point_list')[0].style.right = '0'
}, },
timeStart() { timeStart() {
this.timer = setInterval(() => { this.timer = setInterval(() => {
@ -181,6 +184,11 @@ export default {
}, },
floorinfo() { floorinfo() {
this.only = true this.only = true
// this.only = false
},
floorinfo1() {
this.only = false
this.only = true
}, },
deleteinfo() { deleteinfo() {
this.isplay = 1 this.isplay = 1
@ -201,7 +209,6 @@ export default {
left: 21vw; left: 21vw;
} }
.system_title { .system_title {
width: 100vw; width: 100vw;
height: 18vh; height: 18vh;

@ -11,39 +11,97 @@
</template> </template>
<script> <script>
import { vehicleTrafficStatistics } from '@/api/sensingDevice/resource'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import EleResize from '@/utils/esresize'
export default { export default {
name: 'CarLarge', name: 'CarLarge',
data() { data() {
return {} return {
list: [],
list1: []
}
}, },
mounted() { mounted() {
setTimeout(() => {
this.init_charts() this.init_charts()
}, 500)
},
created() {
this.onvehicleTrafficStatistics()
}, },
methods: { methods: {
async onvehicleTrafficStatistics() {
console.log(456)
const res = await vehicleTrafficStatistics()
this.list = Object.keys(res.data)
this.list1 = Object.values(res.data)
console.log(this.list, 'kkk')
},
init_charts() { init_charts() {
console.log(123)
var chartDom = document.getElementById('carMain') var chartDom = document.getElementById('carMain')
var myChart = echarts.init(chartDom) var myChart = echarts.init(chartDom)
let resize_div = document.getElementById('carMain')
// *echarts
EleResize.on(resize_div, () => {
myChart.resize()
})
var option var option
option = { option = {
xAxis: { tooltip: {
type: 'category', trigger: 'axis',
data: ['11-28', '11-29', '11-30', '12-01', '12-02', '12-03', '12-04'] axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
}, },
yAxis: {
type: 'value' xAxis: [
{
type: 'category',
data: this.list,
axisPointer: {
type: 'shadow'
}
}
],
yAxis: [
{
type: 'value',
min: 0,
max: 250,
interval: 50,
axisLabel: {
formatter: '{value} ml'
}
}, },
{
type: 'value',
min: 0,
max: 25,
interval: 5,
axisLabel: {
formatter: '{value} °C'
}
}
],
series: [ series: [
{ {
data: [120, 200, 150, 80, 70, 110, 130], name: '车流量',
type: 'bar' type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value + ' ml'
}
},
data: this.list1
},
{
// name: 'Temperature',
type: 'line',
yAxisIndex: 1,
data: this.list1
} }
] ]
} }
@ -80,12 +138,11 @@ export default {
background-image: url('@/assets/picture/bg_5.png'); background-image: url('@/assets/picture/bg_5.png');
background-size: 100% auto; background-size: 100% auto;
background-repeat: no-repeat; background-repeat: no-repeat;
}
.car_charts { .car_charts {
width: 20vw; width: 20vw;
height: 30vh; height: 34vh;
color: #4ca5dd; color: #4ca5dd;
} }
} }
}
</style> </style>

@ -32,11 +32,12 @@ export default {
this.onhumanVehicleStatistics() this.onhumanVehicleStatistics()
}, },
methods: { methods: {
onhumanVehicleStatistics() { async onhumanVehicleStatistics() {
const res = humanVehicleStatistics() const res = await humanVehicleStatistics()
console.log(res, 'aaa') this.list = res.data
console.log(this.list, 'aaa')
}, },
//
init_charts() { init_charts() {
var chartDom = document.getElementById('man-charts') var chartDom = document.getElementById('man-charts')
var myChart = echarts.init(chartDom) var myChart = echarts.init(chartDom)
@ -44,7 +45,7 @@ export default {
const gaugeData = [ const gaugeData = [
{ {
value: 2656446, value: this.list.userCount,
name: '人口', name: '人口',
title: { title: {
offsetCenter: ['0%', '30%'] offsetCenter: ['0%', '30%']
@ -126,6 +127,7 @@ export default {
}, 2000) }, 2000)
option && myChart.setOption(option) option && myChart.setOption(option)
}, },
//
init_car_charts() { init_car_charts() {
var chartDom = document.getElementById('car-charts') var chartDom = document.getElementById('car-charts')
var myChart = echarts.init(chartDom) var myChart = echarts.init(chartDom)
@ -133,7 +135,7 @@ export default {
const gaugeData = [ const gaugeData = [
{ {
value: 755554, value: this.list.vehicleCount,
name: '车辆', name: '车辆',
title: { title: {
offsetCenter: ['0%', '30%'] offsetCenter: ['0%', '30%']

@ -11,14 +11,119 @@
</template> </template>
<script> <script>
import { init_echarts } from '../utils/initEcharts' import * as echarts from 'echarts'
import { humanTrafficStatistics } from '@/api/sensingDevice/resource'
export default { export default {
name: 'PeopleLarge', name: 'PeopleLarge',
data() { data() {
return {} return {
list: [],
list1: []
}
}, },
mounted() { 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> </script>
@ -52,11 +157,11 @@ export default {
background-image: url('@/assets/picture/bg_5.png'); background-image: url('@/assets/picture/bg_5.png');
background-size: 100% auto; background-size: 100% auto;
background-repeat: no-repeat; background-repeat: no-repeat;
}
.people_chart { #people_chart {
width: 20vw; width: 20vw;
height: 25vh; height: 25vh;
} }
} }
}
</style> </style>

Loading…
Cancel
Save