|
@@ -7,7 +7,7 @@
|
|
</Header>
|
|
</Header>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
- <div class="mySwiper">
|
|
|
|
|
|
+ <div class="mySwiper" v-if="loaded">
|
|
<div class="swiper-wrapper">
|
|
<div class="swiper-wrapper">
|
|
<div class="swiper-slide" v-for="(i, index) in eleList">
|
|
<div class="swiper-slide" v-for="(i, index) in eleList">
|
|
<div class="warpper" :class="{ downMode }" :id="`layoutRef${index}`">
|
|
<div class="warpper" :class="{ downMode }" :id="`layoutRef${index}`">
|
|
@@ -20,7 +20,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import { reactive, ref, toRefs, onBeforeMount, onMounted, nextTick, onActivated } from 'vue';
|
|
|
|
|
|
+import { reactive, ref, toRefs, onBeforeMount, onMounted, nextTick, onActivated, onDeactivated } from 'vue';
|
|
import { router } from '@/router';
|
|
import { router } from '@/router';
|
|
import Swiper from 'swiper';
|
|
import Swiper from 'swiper';
|
|
import 'swiper/swiper.min.css';
|
|
import 'swiper/swiper.min.css';
|
|
@@ -64,7 +64,7 @@ const getLayoutImage = async () => {
|
|
Message.success({ msg: '已保存至相册', time: 2000 });
|
|
Message.success({ msg: '已保存至相册', time: 2000 });
|
|
|
|
|
|
const blob = await new Promise<Blob>((resolve) => canvas.toBlob(resolve, 'image/jpeg', 0.95));
|
|
const blob = await new Promise<Blob>((resolve) => canvas.toBlob(resolve, 'image/jpeg', 0.95));
|
|
- await downloadImage(blob, '12312.jpg');
|
|
|
|
|
|
+ await downloadImage(blob, `tables_${index}.jpg`);
|
|
});
|
|
});
|
|
downMode.value = false;
|
|
downMode.value = false;
|
|
|
|
|
|
@@ -94,35 +94,29 @@ const initTables = () => {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const mySwiper = ref(null);
|
|
const mySwiper = ref(null);
|
|
|
|
+const loaded = ref(false);
|
|
onActivated(() => {
|
|
onActivated(() => {
|
|
initTables();
|
|
initTables();
|
|
|
|
+ loaded.value = true;
|
|
mySwiper.value = null;
|
|
mySwiper.value = null;
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
- mySwiper.value = new Swiper('.mySwiper', {
|
|
|
|
- on: {
|
|
|
|
- init: function (swiper) {
|
|
|
|
- console.error(swiper)
|
|
|
|
- swiper.slideTo(0);
|
|
|
|
-
|
|
|
|
- // for (let i = 0; i < imageList.value.length; i++) {
|
|
|
|
- // vmZoom.value[i] = document.getElementById(`vmRef_${i}`)
|
|
|
|
- // zoomElement(vmZoom.value[i])
|
|
|
|
- // }
|
|
|
|
- },
|
|
|
|
- transitionStart: function (swiper) {
|
|
|
|
- // alert(swiper.previousIndex)
|
|
|
|
- // console.log(vmZoom.value[swiper.previousIndex].style.transform)
|
|
|
|
- // let scale = getTransform(vmZoom.value[swiper.previousIndex])
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- touchStart: function (swiper, event) {
|
|
|
|
- // console.log(swiper.previousIndex)
|
|
|
|
|
|
+ if (loaded.value) {
|
|
|
|
+ mySwiper.value = new Swiper('.mySwiper', {
|
|
|
|
+ on: {
|
|
|
|
+ init: function (swiper) {
|
|
|
|
+ console.error(swiper);
|
|
|
|
+ },
|
|
|
|
+ transitionStart: function (swiper) {},
|
|
|
|
+ touchStart: function (swiper, event) {},
|
|
},
|
|
},
|
|
- },
|
|
|
|
- });
|
|
|
|
|
|
+ });
|
|
|
|
+ }
|
|
});
|
|
});
|
|
});
|
|
});
|
|
onMounted(() => {});
|
|
onMounted(() => {});
|
|
|
|
+onDeactivated(() => {
|
|
|
|
+ loaded.value = false;
|
|
|
|
+});
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.mySwiper {
|
|
.mySwiper {
|