Browse Source

修正数组异常

lite
453530270@qq.com 3 years ago
parent
commit
580ba3ae4d
  1. 52
      src/views/ty/index.vue

52
src/views/ty/index.vue

@ -35,7 +35,7 @@
<div class="dinszone"> <div class="dinszone">
<span class="dins_title">24小时总进馆人流趋势</span> <span class="dins_title">24小时总进馆人流趋势</span>
<!-- 柱状统计图 --> <!-- 柱状统计图 -->
<div class="dins_chart" id="dinschart" style="height: 22vh; width: 100%"></div> <div class="dins_chart" ref="dinschart" style="height: 22vh; width: 100%"></div>
</div> </div>
</div> </div>
@ -67,7 +67,7 @@
<div class="venue_proportion_top" style="cursor: pointer;" @click="istygShowfn"> <div class="venue_proportion_top" style="cursor: pointer;" @click="istygShowfn">
<span class="venue_proportion_box_num" style="position: relative;cursor: pointer;"> <span class="venue_proportion_box_num" style="position: relative;cursor: pointer;">
<a target="tyg" style="text-decoration: none;color: #fff;z-index: 9999;"> <a target="tyg" style="text-decoration: none;color: #fff;z-index: 9999;">
{{ cgrate[0].proportion }} {{ cgrdata[0]['proportion'] }}
</a> </a>
<!-- v-show="istygShow == true" --> <!-- v-show="istygShow == true" -->
@ -78,14 +78,15 @@
</span> </span>
</div> </div>
<div class="venue_proportion_bo"> <div class="venue_proportion_bo">
<span>{{ cgrate[0].groupName }}</span> <span>{{ cgrdata[0]['groupName'] }}</span>
</div> </div>
</div> </div>
<div class="venue_proportion"> <div class="venue_proportion">
<div class="venue_proportion_top" style="cursor: pointer;" @click="istygShowfn2"> <div class="venue_proportion_top" style="cursor: pointer;" @click="istygShowfn2">
<span class="venue_proportion_box_num" style="position: relative;cursor: pointer;"> <span class="venue_proportion_box_num" style="position: relative;cursor: pointer;">
<a target="tyg" style="text-decoration: none;color: #fff;z-index: 9999;"> <a target="tyg" style="text-decoration: none;color: #fff;z-index: 9999;">
{{ cgrate[0].proportion }} {{ cgrdata[1]['proportion'] }}
</a> </a>
<!-- v-show="istygShow == true" --> <!-- v-show="istygShow == true" -->
<div v-show="istygShow2 == true" style="cursor: pointer;overflow-y: hidden;padding: 0.5rem;" <div v-show="istygShow2 == true" style="cursor: pointer;overflow-y: hidden;padding: 0.5rem;"
@ -95,15 +96,13 @@
</span> </span>
</div> </div>
<div class="venue_proportion_bo"> <div class="venue_proportion_bo">
<span>{{ cgrate[1].groupName }}</span> <span>{{ cgrdata[1]['groupName'] }}</span>
</div> </div>
</div> </div>
<div class="venue_proportion"> <div class="venue_proportion">
<div class="venue_proportion_top" style="cursor: pointer;" @click="istygShowfn3"> <div class="venue_proportion_top" style="cursor: pointer;" @click="istygShowfn3">
<span class="venue_proportion_box_num" style="position: relative;cursor: pointer;"> <span class="venue_proportion_box_num" style="position: relative;cursor: pointer;">
<a target="tyg" style="text-decoration: none;color: #fff;z-index: 9999;"> {{ cgrdata[2]['proportion'] }}
{{ cgrate[0].proportion }}
</a>
<!-- v-show="istygShow == true" --> <!-- v-show="istygShow == true" -->
<div v-show="istygShow3 == true" style="cursor: pointer;overflow-y: hidden;padding: 0.5rem;" <div v-show="istygShow3 == true" style="cursor: pointer;overflow-y: hidden;padding: 0.5rem;"
@click="istygShowfn3"> @click="istygShowfn3">
@ -112,7 +111,7 @@
</span> </span>
</div> </div>
<div class="venue_proportion_bo"> <div class="venue_proportion_bo">
<span>{{ cgrate[2].groupName }}</span> <span>{{ cgrdata[2]['groupName'] }}</span>
</div> </div>
</div> </div>
@ -138,10 +137,8 @@ import * as echarts from "echarts";
// api // api
import * as homeApi from '@/api/home' import * as homeApi from '@/api/home'
// import LivePlayer from '@liveqing/liveplayer'
import $ from "jquery"; import $ from "jquery";
// import Video from '../../components/btgym/Video.vue'
export default { export default {
components: { components: {
@ -160,7 +157,9 @@ export default {
// //
daData:[], daData:[],
// //
cgrate:[], cgrdata:[],
tygrate:[],
cgname:[],
initCount: 0, initCount: 0,
pubKey0: '', pubKey0: '',
@ -182,6 +181,7 @@ export default {
}); });
}, },
// 退 // 退
destroy(){ destroy(){
@ -196,15 +196,19 @@ export default {
} else { } else {
cc.classList.add("ty_bg"); cc.classList.add("ty_bg");
} }
// // //
this.getStat() this.getStat()
this.ty_bar1() this.ty_bar1()
// this.ty_bar2() // this.ty_bar2()
this.ty_bar3() this.ty_bar3()
this.$nextTick(()=>{
this.addNumber(0, this.todayNum, 'insv') this.addNumber(0, this.todayNum, 'insv')
this.addNumber(0, this.monthNum, 'insv2') this.addNumber(0, this.monthNum, 'insv2')
this.addNumber(0, this.yearNum, 'insv3') this.addNumber(0, this.yearNum, 'insv3')
});
this.getVideo() this.getVideo()
@ -244,11 +248,8 @@ export default {
}, },
ty_bar1() { ty_bar1() {
console.log("24h") var myChart = echarts.init(this.$refs.dinschart);
console.log(this.daData)
var chartDom = document.getElementById("dinschart");
var myChart = echarts.init(chartDom);
// var option;
var xData = ['09:00', '10:00', '11:00','12:00', '13:00', '14:00','15:00', '16:00', '17:00','18:00', '20:00', '21:00', '22:00']; var xData = ['09:00', '10:00', '11:00','12:00', '13:00', '14:00','15:00', '16:00', '17:00','18:00', '20:00', '21:00', '22:00'];
var data = [10000, 20000, 10000, 20000, 10000, 20000, 25000, 50000, 30000, 13000, 15000, 11000, 12000] var data = [10000, 20000, 10000, 20000, 10000, 20000, 25000, 50000, 30000, 13000, 15000, 11000, 12000]
@ -295,7 +296,6 @@ export default {
}], }],
yAxis: [{ yAxis: [{
type: 'value', type: 'value',
// name: ' ( KWh )',
axisLine: { axisLine: {
show: false show: false
}, },
@ -314,7 +314,6 @@ export default {
} }
}], }],
series: [{ series: [{
// name: '',
type: 'bar', type: 'bar',
barGap: '5%', barGap: '5%',
barWidth: '10%', barWidth: '10%',
@ -328,10 +327,6 @@ export default {
offset: 0, offset: 0,
color: '#00EAFF' color: '#00EAFF'
}, },
// {
// offset: 0.5,
// color: '#00feff'
// },
{ {
offset: 1, offset: 1,
color: '#001AFF' color: '#001AFF'
@ -344,7 +339,6 @@ export default {
zlevel: 11 zlevel: 11
}, },
{ {
// name: '',
type: 'scatter', type: 'scatter',
stack: 1, stack: 1,
xAxisIndex: 0, xAxisIndex: 0,
@ -749,12 +743,14 @@ export default {
// 24h // 24h
that.daData = res.data.data that.daData = res.data.data
const day_tmp=res.data.data.groupsData const day_tmp=res.data.data.groupsData
//
that.cgrate = day_tmp
// //
day_tmp.forEach(item=>{ day_tmp.forEach(item=>{
that.todayNum =+ item.noRepeatInNum that.todayNum =+ item.noRepeatInNum,
that.cgname.push[item.groupName]
}); });
that.cgrdata = day_tmp
}) })
// MONTHLY // MONTHLY
homeApi.allTygGroupTimeNum({granularity:"monthly",groupsId:groups}).then(res=>{ homeApi.allTygGroupTimeNum({granularity:"monthly",groupsId:groups}).then(res=>{

Loading…
Cancel
Save