Browse Source

修正数组异常

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

58
src/views/ty/index.vue

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

Loading…
Cancel
Save