-
+
@@ -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 秒
});