From 01c182ba3134afa50aa7a78f0d9eebe2b2e73757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Sat, 20 Apr 2024 13:52:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/board/senso/index.vue | 53 +++++++++++++++++------- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/ruoyi-ui/src/views/board/senso/index.vue b/ruoyi-ui/src/views/board/senso/index.vue index 1fcede7..09d6ecf 100644 --- a/ruoyi-ui/src/views/board/senso/index.vue +++ b/ruoyi-ui/src/views/board/senso/index.vue @@ -110,6 +110,10 @@ + +
+ 继续加载 +
{ - setTimeout(() => { - let arr = e.splice(nowNum * 20, (nowNum + 1) * 20) - arr.forEach(v => { + e.forEach(v => { this.setMarker([v.longitude, v.latitude], v.ts) }) - this.setPolyline(arr.map(e => { + this.setPolyline(e.map(e => { return [e.longitude, e.latitude] })) - nowNum += 1 - flag && map.setFitView() - if (nowNum * 20 <= sum) { - fun() - } - }, 1000 * 0.5) - } - fun() + // let fun = () => { + // setTimeout(() => { + // let arr = e.splice(nowNum * 20, (nowNum + 1) * 20) + // arr.forEach(v => { + // this.setMarker([v.longitude, v.latitude], v.ts) + // }) + // this.setPolyline(arr.map(e => { + // return [e.longitude, e.latitude] + // })) + // nowNum += 1 + + // flag && map.setFitView() + // if (nowNum * 20 <= sum) { + // fun() + // } + // }, 1000 * 0.5) + // } + // fun() }, async currentChange(e) { @@ -274,21 +287,25 @@ export default { this.date = null } }, - async setHistoryData() { + async setHistoryData(isTable=true) { + if(isTable){ this.isMap = false map.clearMap() this.show = false + this.mapOffset = 0 + } const {data} = await getHistoryData({ "sceneId": this.$store.getters.sceneId, "deviceId": this.deviceId, deviceModeId: this.deviceModeId, - "offset": this.topData.gpsFlag !== '1' ? (this.currentPage - 1) : null, - "limit": this.topData.gpsFlag !== '1' ? 10 : null, + "offset": this.topData.gpsFlag !== '1' ? (this.currentPage - 1) : this.mapOffset, + "limit": this.topData.gpsFlag !== '1' ? 10 : 100, startTime: this.date?.[0], endTime: this.date?.[1], }) let dataList = data.historyData?.dataList || [] if (dataList.filter(e => (Object.keys(e).includes('longitude') || Object.keys(e).includes('longitude'))).length > 0) { + this.mapTotal = data.historyData.count this.isMap = true let mapData = dataList.filter(e => (Object.keys(e).includes('longitude') || Object.keys(e).includes('longitude'))).map(e => { let [lng, lat] = wgs84togcj02(e.longitude, e.latitude) @@ -341,6 +358,10 @@ export default { map.setFitView([maptext,mapMarker]) flag = false console.log(e) + }, + continueMap(){ + this.mapOffset += 1 + this.setHistoryData(false) } } };