From 94ff46df856f6d4f8d8393e22001351c793f4e5b Mon Sep 17 00:00:00 2001
From: wzp <2040239371@qq.com>
Date: 星期一, 05 五月 2025 16:44:36 +0800
Subject: [PATCH] feat: 新增payInfo测试和部分优化appsecret
---
ruoyi-ui/src/views/system/gps/map.vue | 93 +++++++++++++++++++++-------------------------
1 files changed, 43 insertions(+), 50 deletions(-)
diff --git a/ruoyi-ui/src/views/system/gps/map.vue b/ruoyi-ui/src/views/system/gps/map.vue
index f96f1a6..a9ee044 100644
--- a/ruoyi-ui/src/views/system/gps/map.vue
+++ b/ruoyi-ui/src/views/system/gps/map.vue
@@ -104,7 +104,7 @@
</template>
<script>
-import { listGps } from "@/api/system/gps";
+import { anonymousList } from "@/api/system/gps";
export default {
name: "GpsMap",
@@ -126,9 +126,12 @@
dateRange: [],
// 鏌ヨ鍙傛暟
queryParams: {
- vehicleNo: undefined,
- orderByColumn: "collect_time",
- isAsc: "desc",
+ pageNum: 1,
+ pageSize: 10,
+ deviceId: null,
+ appId: null,
+ sign: null,
+ timestamp: null
},
// 鍦板浘瀵硅薄
map: null,
@@ -156,9 +159,19 @@
if (query.vehicleNo) {
this.queryParams.vehicleNo = query.vehicleNo;
}
+ // 璁剧疆璁よ瘉鍙傛暟
+ if (query.appId) {
+ this.queryParams.appId = query.appId;
+ }
+ if (query.sign) {
+ this.queryParams.sign = query.sign;
+ }
+ if (query.timestamp) {
+ this.queryParams.timestamp = query.timestamp;
+ }
// 璁剧疆鏃堕棿鑼冨洿
- if (query.startTime && query.endTime) {
- this.dateRange = [query.startTime, query.endTime];
+ if (query.beginTime && query.endTime) {
+ this.dateRange = [query.beginTime, query.endTime];
}
this.getList();
},
@@ -166,6 +179,10 @@
// 鍔ㄦ�佸姞杞界櫨搴﹀湴鍥続PI
this.loadBMapScript().then(() => {
this.initMap();
+ window.initMapFlag=true;
+ if(window.loadGpsList){
+ this.drawTrack()
+ }
});
},
methods: {
@@ -205,15 +222,16 @@
},
/** 鏌ヨGPS鍒楄〃 */
getList() {
- this.loading = true;
- listGps(this.addDateRange(this.queryParams, this.dateRange)).then(
- (response) => {
- this.gpsList = response.rows;
- this.total = response.total;
- this.loading = false;
+ this.loading = true;
+ anonymousList(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+ this.gpsList = response.rows;
+ this.total = response.total;
+ this.loading = false;
+ window.loadGpsList=true;
+ if(window.initMapFlag){
this.drawTrack();
}
- );
+ });
},
async translatePoints(points) {
// 灏哤GS84鍧愭爣杞崲涓虹櫨搴﹀潗鏍�
@@ -246,6 +264,7 @@
this.map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
// 鍚敤婊氳疆鏀惧ぇ缂╁皬
this.map.enableScrollWheelZoom();
+ console.log("initMap 鍒濆鍖栧湴鍥�")
},
/** 璁$畻涓ょ偣涔嬮棿鐨勮窛绂伙紙绫筹級 */
getDistance(point1, point2) {
@@ -258,34 +277,7 @@
return Math.atan2(dy, dx) * 180 / Math.PI;
},
- /** 鍦ㄤ袱鐐逛箣闂存彃鍏ュ钩婊戠偣 */
- getSmoothPoints(point1, point2) {
- const distance = this.getDistance(point1, point2);
- if (distance < this.minDistance) {
- return [point1, point2];
- }
-
- const angle = this.getAngle(point1, point2);
- const midPoint = new BMap.Point(
- (point1.lng + point2.lng) / 2,
- (point1.lat + point2.lat) / 2
- );
-
- // 璁$畻鎺у埗鐐�
- const controlPoint = new BMap.Point(
- midPoint.lng + this.smoothFactor * distance * Math.cos((angle + 90) * Math.PI / 180),
- midPoint.lat + this.smoothFactor * distance * Math.sin((angle + 90) * Math.PI / 180)
- );
-
- // 浣跨敤浜屾璐濆灏旀洸绾跨敓鎴愬钩婊戠偣
- const points = [];
- for (let t = 0; t <= 1; t += 0.1) {
- const x = Math.pow(1 - t, 2) * point1.lng + 2 * (1 - t) * t * controlPoint.lng + Math.pow(t, 2) * point2.lng;
- const y = Math.pow(1 - t, 2) * point1.lat + 2 * (1 - t) * t * controlPoint.lat + Math.pow(t, 2) * point2.lat;
- points.push(new BMap.Point(x, y));
- }
- return points;
- },
+
/** 缁樺埗杞ㄨ抗 */
async drawTrack() {
@@ -333,11 +325,18 @@
translatePoints.forEach((item, index) => {
const bdPoint = item;
- // 鍙湪璧风偣鍜岀粓鐐瑰垱寤烘爣璁�
- if (index === 0 || index === translatePoints.length - 1) {
+ // 鍒ゆ柇璧风偣鍜岀粓鐐规槸鍚︾浉鍚�
+ const isStartPoint = index === 0;
+ const isEndPoint = index === translatePoints.length - 1;
+ const isStartEndSame = isStartPoint && isEndPoint &&
+ translatePoints[0].lng === translatePoints[translatePoints.length - 1].lng &&
+ translatePoints[0].lat === translatePoints[translatePoints.length - 1].lat;
+
+ // 鍙湪璧风偣鍜岀粓鐐瑰垱寤烘爣璁帮紝涓旇捣鐐瑰拰缁堢偣涓嶅悓鏃舵墠鏄剧ず璧风偣鏍囪
+ if ((isStartPoint && !isStartEndSame) || isEndPoint) {
let marker;
let direction=currentSegment[index].direction;
- if (index === 0) {
+ if (isStartPoint && !isStartEndSame) {
// 璧风偣鏄剧ず"璧�"瀛�
const label = new BMap.Label("璧�", {
offset: new BMap.Size(0, 0),
@@ -410,12 +409,6 @@
this.map.addOverlay(marker);
this.markers.push(marker);
}
- // const smoothPoints = [];
- // for (let i = 0; i < points.length - 1; i++) {
- // const segmentPoints = this.getSmoothPoints(points[i], points[i + 1]);
- // smoothPoints.push(...segmentPoints);
- // }
- // smoothPoints.push(points[points.length - 1]);
// 濡傛灉鏄渶鍚庝竴涓偣锛岀粯鍒惰建杩圭嚎
if (index === currentSegment.length - 1) {
--
Gitblit v1.9.1