From 9145e31408c7e861ef122ff3f86bb9c2406b9c73 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 19 三月 2026 13:03:34 +0800
Subject: [PATCH] #
---
src/main/webapp/views/stationPathPolicy/stationPathPolicy.html | 34 +---------------------------------
src/main/webapp/static/js/stationPathPolicy/stationPathPolicy.js | 25 ++++++++++++-------------
2 files changed, 13 insertions(+), 46 deletions(-)
diff --git a/src/main/webapp/static/js/stationPathPolicy/stationPathPolicy.js b/src/main/webapp/static/js/stationPathPolicy/stationPathPolicy.js
index dbd3182..bfcb6b7 100644
--- a/src/main/webapp/static/js/stationPathPolicy/stationPathPolicy.js
+++ b/src/main/webapp/static/js/stationPathPolicy/stationPathPolicy.js
@@ -783,7 +783,7 @@
var scaleX = usableWidth / contentWidth
var scaleY = usableHeight / contentHeight
var scale = Math.min(scaleX, scaleY, 1.7)
- var zoomPercent = Math.max(60, Math.min(220, Math.floor(scale * 100)))
+ var zoomPercent = Math.max(1, Math.min(220, Math.floor(scale * 100)))
var centerX = (bounds.minX + bounds.maxX) / 2
var centerY = (bounds.minY + bounds.maxY) / 2
this.mapZoomPercent = zoomPercent
@@ -829,7 +829,7 @@
if (zoomPercent == null) {
return
}
- zoomPercent = Math.max(60, Math.min(220, zoomPercent))
+ zoomPercent = Math.max(1, Math.min(220, zoomPercent))
if (!wrap || !this.mapContext.width || !this.mapContext.height) {
this.mapZoomPercent = zoomPercent
return
@@ -858,19 +858,18 @@
if (!this.mapContext.nodes.length) {
return
}
- if (event.ctrlKey || event.metaKey) {
- var wrap = this.$refs.mapCanvasWrap
- if (!wrap) {
- return
- }
- var rect = wrap.getBoundingClientRect()
- var delta = event.deltaY < 0 ? 10 : -10
- var nextPercent = Math.max(60, Math.min(220, this.mapZoomPercent + delta))
- this.setMapZoomAroundPoint(nextPercent, event.clientX - rect.left, event.clientY - rect.top)
+ var wrap = this.$refs.mapCanvasWrap
+ if (!wrap) {
return
}
- this.mapPanX -= event.deltaX
- this.mapPanY -= event.deltaY
+ var wheelDelta = Math.abs(event.deltaY) >= Math.abs(event.deltaX) ? event.deltaY : event.deltaX
+ if (!wheelDelta) {
+ return
+ }
+ var rect = wrap.getBoundingClientRect()
+ var delta = wheelDelta < 0 ? 10 : -10
+ var nextPercent = Math.max(1, Math.min(220, this.mapZoomPercent + delta))
+ this.setMapZoomAroundPoint(nextPercent, event.clientX - rect.left, event.clientY - rect.top)
},
beginMapDrag: function (event) {
var wrap = this.$refs.mapCanvasWrap
diff --git a/src/main/webapp/views/stationPathPolicy/stationPathPolicy.html b/src/main/webapp/views/stationPathPolicy/stationPathPolicy.html
index e11fc4e..5da93c6 100644
--- a/src/main/webapp/views/stationPathPolicy/stationPathPolicy.html
+++ b/src/main/webapp/views/stationPathPolicy/stationPathPolicy.html
@@ -298,7 +298,7 @@
}
.preview-toolbar-row-secondary {
- grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
+ grid-template-columns: 1fr;
}
.preview-toolbar-actions {
@@ -307,31 +307,6 @@
justify-content: flex-end;
align-items: center;
flex-wrap: wrap;
- }
-
- .preview-zoom-card {
- display: flex;
- align-items: center;
- gap: 14px;
- padding: 10px 14px;
- border-radius: 18px;
- background: linear-gradient(180deg, rgba(247, 250, 255, 0.96) 0%, rgba(243, 248, 254, 0.96) 100%);
- border: 1px solid rgba(217, 227, 236, 0.96);
- }
-
- .preview-zoom-meta {
- min-width: 74px;
- }
-
- .preview-zoom-meta strong {
- display: block;
- font-size: 12px;
- margin-bottom: 2px;
- }
-
- .preview-zoom-meta span {
- font-size: 12px;
- color: var(--text-sub);
}
.preview-panel-body {
@@ -938,13 +913,6 @@
</el-select>
</div>
<div class="preview-toolbar-row preview-toolbar-row-secondary">
- <div class="preview-zoom-card">
- <div class="preview-zoom-meta">
- <strong>鍦板浘缂╂斁</strong>
- <span>{{ mapZoomPercent }}%</span>
- </div>
- <el-slider :value="mapZoomPercent" @input="updateMapZoom" :min="60" :max="220" :step="10" :show-tooltip="false" style="flex: 1;"></el-slider>
- </div>
<div class="preview-toolbar-actions">
<el-button @click="fitMap" :disabled="!mapContext.nodes.length">閫傞厤鍦板浘</el-button>
<el-button @click="resetPreview">娓呯┖</el-button>
--
Gitblit v1.9.1