From 65d84a98a83683876e031e165a69169699c5cf29 Mon Sep 17 00:00:00 2001 From: yuan Date: Thu, 24 Jun 2021 18:14:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E6=9C=BA=E8=B7=9D=E7=A6=BB?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=96=B9=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapoperate/responder/responderBatchOperate.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/responder/responderBatchOperate.vue b/src/views/newMap/newMapdraft/mapoperate/responder/responderBatchOperate.vue index cb9082dc5..12836b643 100644 --- a/src/views/newMap/newMapdraft/mapoperate/responder/responderBatchOperate.vue +++ b/src/views/newMap/newMapdraft/mapoperate/responder/responderBatchOperate.vue @@ -62,9 +62,9 @@ export default { return idx; }, - // 只是用来比较就不开根号了, 同一个区段的信号机距离应该不会溢出 + // 采用合理的距离计算方式 distanceOf(a, b) { - return (b.x - a.x) ** 2 + (b.y - a.y) ** 2; + return Math.hypot(b.x - a.x, b.y - a.y); } } };