From b91df839f379ba575914ba257d7eb37c4e3deac2 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Tue, 15 Jul 2025 19:28:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B8=85=E6=B0=94=E8=80=8C=E5=8F=88?= =?UTF-8?q?=E7=82=AB=E9=85=B7=E7=9A=84=E5=96=B7=E6=B6=82=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/martixCraft/Edit/index.vue | 8 ++-- src/components/spray/sprayParams/index.vue | 63 +++++++++++++++++++++++++++--- 2 files changed, 62 insertions(+), 9 deletions(-) diff --git a/src/components/martixCraft/Edit/index.vue b/src/components/martixCraft/Edit/index.vue index 4dc7c06..2205141 100644 --- a/src/components/martixCraft/Edit/index.vue +++ b/src/components/martixCraft/Edit/index.vue @@ -348,10 +348,10 @@ const tabChangeHandle = () => { } } - :deep(.swiper-pagination-bullet) { - width: 20px; - height: 20px; - } +:deep(.swiper-pagination-bullet) { + width: 20px; + height: 20px; +} .el-select { width: 70%; margin: 0 30px; diff --git a/src/components/spray/sprayParams/index.vue b/src/components/spray/sprayParams/index.vue index 36d5594..f1052be 100644 --- a/src/components/spray/sprayParams/index.vue +++ b/src/components/spray/sprayParams/index.vue @@ -12,7 +12,12 @@ import FtDialog from 'components/common/FTDialog/index.vue' import TrayGraph from 'components/spray/trayGraph/index.vue' import { FtMessage } from 'libs/message' import { cloneDeep } from 'lodash' +import { Navigation, Pagination } from 'swiper/modules' +import { Swiper, SwiperSlide } from 'swiper/vue' import { nextTick, onMounted, ref } from 'vue' +import 'swiper/css' +import 'swiper/css/pagination' +import 'swiper/css/navigation' const props = defineProps({ formData: { @@ -159,6 +164,11 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | } form.value.times.splice(activeTab.value, 1) } + swiperInstance?.slideTo(activeTab.value) + // 异步任务调用 + setTimeout(() => { + swiperInstance?.update() + }, 100) } const matrixCraftChange = async (id: number) => { @@ -172,6 +182,19 @@ const matrixCraftChange = async (id: number) => { loading.value = false }) } + +const onSlideChange = (swiper: any) => { + activeTab.value = swiper.activeIndex +} + +let swiperInstance: any = null +const onSwiperInitialized = (swiper: any) => { + swiperInstance = swiper +} + +const tabChangeHandle = () => { + swiperInstance?.slideTo(activeTab.value) +}