From 2c8a4daeecab6f6241c061bc624c32101aff97c1 Mon Sep 17 00:00:00 2001 From: xujingliang <3225043@qq.com> Date: Wed, 27 Sep 2023 15:17:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 5 ++- src/views/home/lib/userSport.js | 52 ++++++++++++++++++++++++++ src/views/home/widget/socketdiabox.vue | 4 ++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 src/views/home/lib/userSport.js diff --git a/.env.dev b/.env.dev index 9af454b..8d41ff9 100644 --- a/.env.dev +++ b/.env.dev @@ -23,8 +23,9 @@ VUE_APP_BASE_IMG_URL = http://123.132.248.154:9231 VUE_APP_WEBSOCKET_URL = ws://123.132.248.154:9225/ws -#VUE_APP_BASE_API = http://221.2.83.254:7001/api -#VUE_APP_BASE_IMG_URL = http://221.2.83.254:7001 + +#VUE_APP_BASE_API = https://fx.hopetrytech.com:7001/api +#VUE_APP_BASE_IMG_URL = https://fx.hopetrytech.com:7001 #VUE_APP_WEBSOCKET_URL = ws://221.2.83.254:9002/ws #VUE_APP_BASE_API = http://123.132.248.154:9224/api diff --git a/src/views/home/lib/userSport.js b/src/views/home/lib/userSport.js new file mode 100644 index 0000000..a7f1ea0 --- /dev/null +++ b/src/views/home/lib/userSport.js @@ -0,0 +1,52 @@ +const currentUsers = [] + + +export function handlerData(newUsers){ + // 判断是否是第一次传入 + if(currentUsers.length == 0){ + currentUsers = newUsers; + } + + // 添加数据 + for(let i=0;i{ + return item.createId == newUsers[i].createId; + }) + if(!obj){ + currentUsers.push(newUsers[i]); + } + } + + // 更新和删除数据 + for(let i=0;i { + // let obj = currentUsers.find((item,index)=>{ + // return item.createId == graphic + // }) + // if (graphic.isPrivate) { + // return + // } + // graphic.addDynamicPosition(position, time) // 按time秒运动至指定位置 + // }) +} + + + + + + diff --git a/src/views/home/widget/socketdiabox.vue b/src/views/home/widget/socketdiabox.vue index 30f61c0..67c0c38 100644 --- a/src/views/home/widget/socketdiabox.vue +++ b/src/views/home/widget/socketdiabox.vue @@ -26,6 +26,7 @@ import AppConfig from '../../../../public/config/app.json' import { parse } from '../lib/handleGeojson.js'; import * as turf from '@turf/turf' import { isJson } from "../../../utils/index"; +import { handlerData } from "../lib/userSport"; export default { name: 'monitorbox', @@ -156,6 +157,9 @@ export default { res.data.forEach(item =>{ this.pointData.push(item) }) + // let currentUsers = handlerData(this.pointData); + + // console.log("currentUsers",currentUsers); this.addLayerPoint() console.log('this.markGraphicLayerArr',this.markGraphicLayerArr) })