From 15752382f400d6414153c33f9267fc1ca0188601 Mon Sep 17 00:00:00 2001 From: "453530270@qq.com" Date: Thu, 27 Jul 2023 23:41:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AE=9A=E6=97=B6=E8=8E=B7?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/HomeView.vue | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 9208ece..c146e74 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -109,7 +109,7 @@
{{item.groupName}} -

{{ item.allEnter }}

+

{{ item.allEnter }}

{{ item.proportion }} @@ -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;