From 259674c09cc7b386e0c3ab6e90f89666f1a704da Mon Sep 17 00:00:00 2001 From: sws <1141121512@qq.com> Date: Mon, 12 Aug 2024 18:10:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhot=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E6=8B=96=E6=8B=BD=E4=BA=8B=E4=BB=B6=E9=98=BB=E6=AD=A2?= =?UTF-8?q?=E5=86=92=E6=B3=A1=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E6=B3=A8=E9=87=8A=E6=8E=89`event.stopPropagation();`?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E6=8B=96=E6=8B=BD=E6=93=8D=E4=BD=9C=E6=97=B6?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=86=92=E6=B3=A1=E8=87=B3=E7=88=B6=E5=85=83?= =?UTF-8?q?=E7=B4=A0=EF=BC=8C=E4=BB=A5=E8=A7=A6=E5=8F=91=E7=88=B6=E5=85=83?= =?UTF-8?q?=E7=B4=A0=E7=9A=84=E6=8B=96=E6=8B=BD=E6=96=B9=E6=B3=95=E3=80=82?= =?UTF-8?q?=E5=90=8C=E6=97=B6=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=BA=86`start=5F?= =?UTF-8?q?drag=5Farea=5Fbox`=E5=92=8C`start=5Fdrag=5Fbtn`=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=B8=AD=E4=BA=8B=E4=BB=B6=E4=BF=AE=E9=A5=B0=E7=AC=A6?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF=E4=BD=BF=E7=94=A8=EF=BC=8C=E5=BA=94?= =?UTF-8?q?=E4=BD=BF=E7=94=A8`$event.stopPropagation();`=E8=80=8C=E4=B8=8D?= =?UTF-8?q?=E6=98=AF`event.preventDefault();`=E3=80=82=E5=8F=A6=E5=A4=96?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=BA=86`index.vue`=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E6=8B=96=E6=8B=BD=E6=8C=89=E9=92=AE=E7=9A=84?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E4=BF=AE=E9=A5=B0=E7=AC=A6=E4=BB=8E`@mousedo?= =?UTF-8?q?wn.prevent`=E6=9B=B4=E6=AD=A3=E4=B8=BA`@mousedown.stop`?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E6=AD=A3=E7=A1=AE=E9=98=BB=E6=AD=A2=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E4=BC=A0=E6=92=AD=E3=80=82=E6=9C=80=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BA=86`nextTick`=E4=B8=BA`setTimeout`?= =?UTF-8?q?=E4=BB=A5=E7=A1=AE=E4=BF=9DDOM=E6=9B=B4=E6=96=B0=E5=90=8E?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=EF=BC=8C=E8=A7=A3=E5=86=B3=E4=BA=86=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=8D=E6=AD=A3=E7=A1=AE=E6=B8=B2=E6=9F=93=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82=20sws=202024-08-12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/hot/index.vue | 12 ++++++------ src/components/model-hot-zone/index.vue | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/components/common/hot/index.vue b/src/components/common/hot/index.vue index 341f6331..f116265b 100644 --- a/src/components/common/hot/index.vue +++ b/src/components/common/hot/index.vue @@ -16,9 +16,9 @@
-
+
-
+
{{ item.name }}
{{ !is_obj_empty(item.link) ? '已设置' : '未设置' }}
@@ -160,7 +160,7 @@ const start_drag_area_box = (index: number, event: MouseEvent) => { // 当子元素拖拽方法触发后父元素方法不触发 document.onmousemove = (areaBoxEvent) => { - areaBoxEvent.stopPropagation(); + // areaBoxEvent.stopPropagation(); if (drag_box_bool.value) { if (!imgBoxRef.value) return; const new_coordinate = { @@ -186,7 +186,7 @@ const start_drag_area_box = (index: number, event: MouseEvent) => { } }; document.onmouseup = (areaBoxEvent) => { - areaBoxEvent.stopPropagation(); + // areaBoxEvent.stopPropagation(); drag_box_bool.value = false; }; }; @@ -198,7 +198,7 @@ const start_drag_btn = (index: number, event: MouseEvent) => { let clone_drag_start = hot_list.value.data[hot_list_index.value].drag_start; let clone_drag_end = hot_list.value.data[hot_list_index.value].drag_end; document.onmousemove = (dragBtnEvent) => { - dragBtnEvent.stopPropagation(); + // dragBtnEvent.stopPropagation(); //用鼠标的位置减去鼠标相对元素的位置,得到元素的位置 if (drag_box_scale_bool.value) { if (!imgBoxRef.value) return; @@ -213,7 +213,7 @@ const start_drag_btn = (index: number, event: MouseEvent) => { } }; document.onmouseup = (dragBtnEvent2) => { - dragBtnEvent2.stopPropagation(); + // dragBtnEvent2.stopPropagation(); drag_box_scale_bool.value = false; }; }; diff --git a/src/components/model-hot-zone/index.vue b/src/components/model-hot-zone/index.vue index 2ed67850..6dd441f1 100644 --- a/src/components/model-hot-zone/index.vue +++ b/src/components/model-hot-zone/index.vue @@ -39,7 +39,7 @@ watch( img_width.value = new_content?.hot.img_width || 1; img_height.value = new_content?.hot.img_height || 1; style_container.value = common_styles_computer(new_style.common_style); - nextTick(() => { + setTimeout(() => { if (containerRef.value && hotRef.value) { // 原图片的宽和高和实际展示的图片宽和高的比例 w_scale1.value = containerRef.value?.clientWidth / img_width.value; @@ -48,8 +48,9 @@ watch( // 坐标缩小比例 containerRef的宽高除以hotRef的宽高 w_scale2.value = hotRef.value?.clientWidth / containerRef.value?.clientWidth; h_scale2.value = hotRef.value?.clientHeight / containerRef.value?.clientHeight; + console.log(containerRef.value?.clientHeight); } - }); + }, 50); }, { immediate: true, deep: true } );