From 466f833e89792663ce18120d03b544c1ba080361 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Wed, 16 Jul 2025 19:36:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=96=B7=E6=B6=82=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=B7=A5=E8=89=BA=E9=80=A0=E6=88=90=E9=80=89?= =?UTF-8?q?=E5=8C=BA=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/spray/sprayParams/index.vue | 19 +++++++++++++------ src/components/spray/trayGraph/index.vue | 2 ++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/components/spray/sprayParams/index.vue b/src/components/spray/sprayParams/index.vue index 970f5a3..010e2b0 100644 --- a/src/components/spray/sprayParams/index.vue +++ b/src/components/spray/sprayParams/index.vue @@ -178,16 +178,22 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | }, 100) } +const swiperKey = ref(1) const matrixCraftChange = async (id: number) => { loading.value = true form.value = await getCraftById(id) - console.log(form.value) - await nextTick(() => { - form.value.times?.forEach((item: any, index: number) => { - sprayRefs.value[index].updateSelection(item.x1 * 5, item.y1 * 5, (item.x2 - item.x1) * 5, (item.y2 - item.y1) * 5) + swiperInstance?.update() + swiperKey.value++ + + setTimeout(() => { + nextTick(() => { + form.value.times?.forEach((item: any, index: number) => { + console.log(item) + sprayRefs.value[index].updateSelection(item.x1 * 5, item.y1 * 5, (item.x2 - item.x1) * 5, (item.y2 - item.y1) * 5) + }) + loading.value = false }) - loading.value = false - }) + }, 0) } const onSlideChange = (swiper: any) => { @@ -249,6 +255,7 @@ const touchendHandle = () => { { // 新增方法:更新矩形选区位置 const updateSelection = (x: number, y: number, width: number, height: number) => { if (rect.value) { + console.log(x, y, width, height) rect.value.position({ x, y }) rect.value.width(width) rect.value.height(height) newWidth = width newHeight = height + rect.value.clearCache() layer.value.draw() } }