diff --git a/src/api/td/tdEngine.js b/src/api/td/tdEngine.js
index 7cf7393..3558c72 100644
--- a/src/api/td/tdEngine.js
+++ b/src/api/td/tdEngine.js
@@ -7,3 +7,12 @@ export function getLastData() {
method: 'get'
})
}
+
+// 获取设备历史轨迹
+export function getDeviceTrajectory(deviceId, params) {
+ return request({
+ url: `/tdengine/td/trajectory/${deviceId}`,
+ method: 'get',
+ params: params
+ })
+}
diff --git a/src/permission.js b/src/permission.js
index 02fe4ac..1f33195 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -11,7 +11,7 @@ import usePermissionStore from '@/store/modules/permission'
NProgress.configure({ showSpinner: false })
-const whiteList = ['/login', '/register', '/redirectTo', '/bdsLocation']
+const whiteList = ['/login', '/register', '/redirectTo', '/bdsLocation', '/trajectory', '/allTrajectories']
router.beforeEach((to, from, next) => {
NProgress.start()
diff --git a/src/router/index.js b/src/router/index.js
index 21558ff..1ef88f5 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -107,6 +107,18 @@ export const constantRoutes = [
component: () => import('@/views/mapTest/index.vue'),
hidden: true,
meta: { title: '北斗上位机实时显示位置' }
+ },
+ {
+ path: '/trajectory',
+ component: () => import('@/views/mapTest/trajectory.vue'),
+ hidden: true,
+ meta: { title: '设备历史轨迹' }
+ },
+ {
+ path: '/allTrajectories',
+ component: () => import('@/views/mapTest/allTrajectories.vue'),
+ hidden: true,
+ meta: { title: '所有设备历史轨迹' }
}
]
diff --git a/src/views/mapTest/allTrajectories.vue b/src/views/mapTest/allTrajectories.vue
new file mode 100644
index 0000000..8650aaa
--- /dev/null
+++ b/src/views/mapTest/allTrajectories.vue
@@ -0,0 +1,1121 @@
+
+
+
+
+
+
+
+
+
+
+
+ 显示全部
+
+
+ 取消全部
+
+
+
+
+
+
+
+ {{ device.name }}
+
+
+ {{ device.pointCount || 0 }}点
+
+
+
+
+
+
+
+
+
轨迹信息
+
设备总数: {{ devices.length }}
+
显示设备: {{ visibleDeviceCount }}
+
轨迹点数: {{ totalPointCount }}
+
当前缩放: {{ currentZoom }}
+
+
+
+
+
+
+
diff --git a/src/views/mapTest/index.vue b/src/views/mapTest/index.vue
index 706fefe..00322b9 100644
--- a/src/views/mapTest/index.vue
+++ b/src/views/mapTest/index.vue
@@ -5,13 +5,17 @@
地图信息
总点位数: {{ points.length }}
当前缩放级别: {{ currentZoom }}
-
+
+
+ 查看历史轨迹
+
+
-
-
-
-
-
- 编号:
- {{ selectedPoint.id }}
-
-
- 上报时间:
- {{ selectedPoint.reportTime }}
-
-
- 经度:
- {{ selectedPoint.longitude }}
-
-
- 纬度:
- {{ selectedPoint.latitude }}
-
-
-
@@ -388,6 +504,7 @@ onBeforeUnmount(() => {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
min-width: 220px;
backdrop-filter: blur(10px);
+ z-index: 100; // 确保信息面板显示在地图之上
h3 {
margin: 0 0 15px 0;
@@ -460,8 +577,8 @@ onBeforeUnmount(() => {
.marker-container {
position: relative;
- width: 40px;
- height: 48px;
+ width: 32px;
+ height: 38px;
display: flex;
align-items: center;
justify-content: center;
@@ -472,8 +589,8 @@ onBeforeUnmount(() => {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
- width: 50px;
- height: 50px;
+ width: 40px;
+ height: 40px;
border: 2px solid #5B8FF9;
border-radius: 50%;
opacity: 0;
@@ -485,8 +602,8 @@ onBeforeUnmount(() => {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
- width: 42px;
- height: 42px;
+ width: 34px;
+ height: 34px;
border-radius: 50%;
background: radial-gradient(circle, rgba(91, 143, 249, 0.4) 0%, transparent 70%);
animation: glow-pulse 2s ease-in-out infinite;
@@ -494,8 +611,8 @@ onBeforeUnmount(() => {
.marker-pin {
position: relative;
- width: 28px;
- height: 28px;
+ width: 22px;
+ height: 22px;
border-radius: 50% 50% 50% 0;
transform: rotate(-45deg);
background: linear-gradient(135deg, #5B8FF9 0%, #7BA3FF 100%);
@@ -538,8 +655,8 @@ onBeforeUnmount(() => {
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(45deg);
- width: 16px;
- height: 16px;
+ width: 13px;
+ height: 13px;
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}
@@ -548,8 +665,8 @@ onBeforeUnmount(() => {
bottom: -5px;
left: 50%;
transform: translateX(-50%);
- width: 20px;
- height: 8px;
+ width: 16px;
+ height: 6px;
background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, transparent 70%);
border-radius: 50%;
animation: shadow-pulse 3s ease-in-out infinite;
@@ -560,8 +677,8 @@ onBeforeUnmount(() => {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
- width: 38px;
- height: 38px;
+ width: 30px;
+ height: 30px;
border: 2px solid #5B8FF9;
border-radius: 50%;
opacity: 0.4;
@@ -644,115 +761,95 @@ onBeforeUnmount(() => {
}
}
-// 点位信息弹出框样式
-:deep(.el-dialog) {
- border-radius: 12px;
- overflow: hidden;
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
+// 自定义 L7 Popup 样式
+:deep(.l7-popup) {
+ pointer-events: none !important;
- .el-dialog__header {
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- padding: 24px 30px;
- margin: 0;
- border-bottom: none;
-
- .el-dialog__title {
- color: #fff;
- font-size: 18px;
- font-weight: 600;
- letter-spacing: 0.5px;
- }
-
- .el-dialog__headerbtn {
- top: 24px;
- right: 30px;
- width: 32px;
- height: 32px;
- background: rgba(255, 255, 255, 0.2);
- border-radius: 50%;
- transition: all 0.3s ease;
-
- &:hover {
- background: rgba(255, 255, 255, 0.3);
- transform: rotate(90deg);
- }
-
- .el-dialog__close {
- color: #fff;
- font-size: 18px;
- font-weight: bold;
- }
- }
+ .l7-popup-content {
+ padding: 0;
+ background: transparent;
+ box-shadow: none;
+ pointer-events: none !important;
}
- .el-dialog__body {
- padding: 32px 30px;
- background: #fff;
+ .l7-popup-tip {
+ border-top-color: #667eea;
+ pointer-events: none !important;
}
}
-.point-info {
- .info-row {
+// 确保tooltip内容也不阻挡
+:deep(.trajectory-tooltip) {
+ pointer-events: none !important;
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
+ border-radius: 12px;
+ padding: 0;
+ min-width: 280px;
+ box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
+ overflow: hidden;
+
+ .tooltip-header {
display: flex;
align-items: center;
- margin-bottom: 18px;
- padding: 16px 18px;
- background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
- border-radius: 8px;
- border-left: 4px solid #667eea;
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- position: relative;
- overflow: hidden;
+ gap: 10px;
+ padding: 12px 16px;
+ background: rgba(255, 255, 255, 0.15);
+ border-bottom: 1px solid rgba(255, 255, 255, 0.1);
- &::before {
- content: '';
- position: absolute;
- left: 0;
- top: 0;
- height: 100%;
- width: 0;
- background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, transparent 100%);
- transition: width 0.3s ease;
- }
-
- &:last-child {
- margin-bottom: 0;
- }
-
- &:hover {
- background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
- transform: translateX(4px);
- box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
- border-left-color: #764ba2;
-
- &::before {
- width: 100%;
- }
- }
-
- .label {
- font-weight: 600;
- color: #495057;
- min-width: 95px;
- font-size: 14px;
+ .header-icon {
display: flex;
align-items: center;
- position: relative;
+ justify-content: center;
+ width: 28px;
+ height: 28px;
+ background: rgba(255, 255, 255, 0.2);
+ border-radius: 50%;
- &::after {
- content: ':';
- margin-left: 4px;
- color: #667eea;
+ svg {
+ color: #fff;
}
}
- .value {
- color: #212529;
- font-size: 14px;
- flex: 1;
- word-break: break-all;
- font-family: 'Consolas', 'Monaco', monospace;
- letter-spacing: 0.3px;
+ .header-title {
+ font-size: 15px;
+ font-weight: 600;
+ color: #fff;
+ letter-spacing: 0.5px;
+ }
+ }
+
+ .tooltip-content {
+ padding: 14px 16px;
+
+ .info-row {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ margin-bottom: 10px;
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+
+ .icon {
+ color: rgba(255, 255, 255, 0.9);
+ flex-shrink: 0;
+ }
+
+ .label {
+ font-size: 13px;
+ color: rgba(255, 255, 255, 0.85);
+ min-width: 45px;
+ }
+
+ .value {
+ flex: 1;
+ font-size: 13px;
+ font-weight: 600;
+ color: #fff;
+ text-align: right;
+ font-family: 'Monaco', 'Consolas', monospace;
+ }
}
}
}
diff --git a/src/views/mapTest/trajectory.vue b/src/views/mapTest/trajectory.vue
new file mode 100644
index 0000000..b97c6db
--- /dev/null
+++ b/src/views/mapTest/trajectory.vue
@@ -0,0 +1,737 @@
+
+
+
+
+
+
+
+
轨迹信息
+
轨迹点数: {{ trajectoryPoints.length }}
+
当前缩放级别: {{ currentZoom }}
+
起点时间: {{ trajectoryPoints[0]?.time }}
+
终点时间: {{ trajectoryPoints[trajectoryPoints.length - 1]?.time }}
+
+
+
+
+
+
+