From 50743b4225da2b487a8f045cc7ec17f800c2753d Mon Sep 17 00:00:00 2001 From: maxmon <541182180@qq.com> Date: Fri, 14 Apr 2023 00:01:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor(point):=20=E6=89=8B=E6=9C=BA=E7=AB=AF?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=9B=B8=E5=90=8C=E7=B1=BB=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E7=82=B9=EF=BC=8C=E5=8F=AF=E4=BB=A5=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/src/components/CV/point.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fe/src/components/CV/point.vue b/fe/src/components/CV/point.vue index 2f63a19..f40bc8c 100644 --- a/fe/src/components/CV/point.vue +++ b/fe/src/components/CV/point.vue @@ -6,7 +6,7 @@ left: annoDetail.points[0][0]*100 + '%', top: annoDetail.points[0][1]*100 + '%', backgroundColor: types[annoDetail.type]?types[annoDetail.type].color:'#f00', - }" class="point" @contextmenu="$event.preventDefault();delPoint(annoDetail)" @mouseover="overPoint($event, annoDetail)"> + }" class="point" @contextmenu="$event.preventDefault();delPoint(annoDetail, true)" @touchstart="$event.preventDefault();delPoint(annoDetail, false)" @mouseover="overPoint($event, annoDetail)"> @@ -69,7 +69,13 @@ export default ({ this.save() return false }, - delPoint (annoDetail) { + delPoint (annoDetail, isForce) { + if (!isForce) { + // 非强制删除,就判定下当前类型是否一致,不一致就不删除 + if (this.nowType !== annoDetail.type) { + return + } + } const idx = this.annoDetails.indexOf(annoDetail) console.log(annoDetail, this.points) this.annoDetails.splice(idx, 1)