Browse Source

调整定时获取

master
453530270@qq.com 3 years ago
parent
commit
15752382f4
  1. 25
      src/views/HomeView.vue

25
src/views/HomeView.vue

@ -109,7 +109,7 @@
<!-- 場館實時 -->
<div class="pcg_item" v-for="item in ssjgNumDatas" :key="item.groupId">
<span class="pcpos">{{item.groupName}}</span>
<p class="pcval">{{ item.allEnter }}</p>
<p class="pcval" :id="item.groupId">{{ item.allEnter }}</p>
<span class="pcrate"
:class="[{ pcrate2: parseInt(item.proportion) >= 80 && parseInt(item.proportion) < 90 }, { pcrate3: parseInt(item.proportion) >= 90 }]">{{
item.proportion }}</span>
@ -125,7 +125,7 @@ import * as echarts from 'echarts';
import * as btApi from '../api/home'
//
import { numGrow,ecMaxVal ,rtsocket} from '@/utils/comm';
import { numGrow,ecMaxVal} from '@/utils/comm';
// api
import * as homeApi from '@/api/home'
@ -185,7 +185,11 @@ export default {
this.getGcgNumDatas()
//
this.getStat();
this.getInfoDatas();
//
setInterval(()=>{
this.getInfoDatas();
},3000)
},
//
@ -669,14 +673,11 @@ export default {
},
//
async getInfoDatas() {
getInfoDatas() {
// interface
// homeApi.allInfoDatas().then(res => {
// get allTimeData
// console.log("from api")
// console.log(res.data.returnData)
// this.ssjgNumDatas = res.data.returnData
// });
homeApi.allGcgNumDatas().then(res=>{
this.ssjgNumDatas = res.data.returnData
})
// websocket
const param ={
type:'realTimeData',
@ -690,6 +691,10 @@ export default {
var jstr = JSON.parse(e.data)
func1(jstr)
};
//
ws.onclose=function(e){
}
let func2=function(jstr){
const darr = jstr.data;

Loading…
Cancel
Save