From 2d7194bb918f6c0a2c1fa2128ea82491a34399a6 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Sat, 8 Nov 2025 01:11:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=B0=E5=9B=BE=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=BD=A8=E8=BF=B9=E5=B1=95=E7=A4=BA=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/td/tdEngine.js | 9 + src/permission.js | 2 +- src/router/index.js | 12 + src/views/mapTest/allTrajectories.vue | 1121 +++++++++++++++++++++++++ src/views/mapTest/index.vue | 459 ++++++---- src/views/mapTest/trajectory.vue | 737 ++++++++++++++++ 6 files changed, 2158 insertions(+), 182 deletions(-) create mode 100644 src/views/mapTest/allTrajectories.vue create mode 100644 src/views/mapTest/trajectory.vue 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 @@ + + + + + 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 }}

-
+ + + 查看历史轨迹 + +
@@ -25,58 +29,51 @@ - - - -
-
- 编号: - {{ 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 @@ + + + + +