From 3bee550c82308748060ac050ac27ca936f4c26d0 Mon Sep 17 00:00:00 2001 From: JINGYJ <1458671527@qq.com> Date: Fri, 9 May 2025 17:40:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=96=E8=A7=82=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/AppearanceAlarmModal.vue | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/views/dashboard/components/AppearanceAlarmModal.vue b/src/views/dashboard/components/AppearanceAlarmModal.vue index c016dd1..6637ba8 100644 --- a/src/views/dashboard/components/AppearanceAlarmModal.vue +++ b/src/views/dashboard/components/AppearanceAlarmModal.vue @@ -20,14 +20,14 @@ 故障前
- +
- + @@ -38,14 +38,14 @@ 故障后
- +
- + @@ -82,7 +82,6 @@ import { Navigation, Scrollbar } from "swiper/modules"; import "swiper/css"; import 'swiper/scss'; import 'swiper/scss/navigation'; -import { it } from 'element-plus/es/locale'; interface Props { /** 弹窗显隐 */ @@ -103,12 +102,19 @@ const props = withDefaults(defineProps(), { const emit = defineEmits(); const modules = [Navigation, Scrollbar]; -const activeIndex = ref(-1); +const activeBeforeIndex = ref(-1); +const activeAfterIndex = ref(-1); const swiperModalRef = ref(null); +const imageBefore = ref(''); +const imageAfter = ref(''); const loading = ref(true); // 处理对话框关闭事件 const handleClose = () => { // emits('close'); + activeBeforeIndex.value = -1; + activeAfterIndex.value = -1; + // imageBefore.value = ''; + // imageAfter.value = ''; }; const show = computed({ @@ -127,8 +133,15 @@ const onSwiper = (swiper) => { const onSlideChange = () => { console.log("slide change"); }; -const handleSlideClick = (index) => { - activeIndex.value = index; +const handleSlideClick = (index:any, type:any) => { + if(type === 'before') { + activeBeforeIndex.value = index; + imageBefore.value = props.beforeImage[index]?.image_url; + } else if(type === 'after') { + activeAfterIndex.value = index; + imageAfter.value = props.image[index]?.image_url; + } + }; // 导出 Excel 文件 @@ -191,6 +204,9 @@ const exportToExcel = async () => { onMounted(() => { // 主图延迟加载 setTimeout(() => { + console.log(show.value); + imageBefore.value = props.beforeImage[0]?.image_url; + imageAfter.value = props.image[0]?.image_url; loading.value = false; }, 2000); // 延迟 2 秒 });