ZhangXianQiang
2024-04-01 bd9cb65c8ee634f1f7bad5a69e891e3a4f46b768
src/views/screen/components/screen-wrapper/index.vue
@@ -5,19 +5,21 @@
      <el-button type="primary" @click="returnPath">管理系统</el-button>
    </div>
    <div class="wrapper-content">
      <screen-map-three></screen-map-three>
      <div class="left-container wrapper">
        <screen-face></screen-face>
        <screen-car></screen-car>
        <screen-video></screen-video>
        <screen-face class="enter-left" :class="{ 'animate-enter-x': isEnd }"></screen-face>
        <screen-car class="enter-left animate-delay-1" :class="{ 'animate-enter-x': isEnd }"></screen-car>
        <screen-video class="enter-left animate-delay-2" :class="{ 'animate-enter-x': isEnd }"></screen-video>
      </div>
      <div class="center-container center-wrapper">
        <screen-map></screen-map>
        <screen-table></screen-table>
        <!-- <screen-map></screen-map> -->
        <screen-map-cover></screen-map-cover>
        <screen-table class="enter-top" :class="{ 'animate-enter-y': isEnd }"></screen-table>
        <!-- <screen-detection></screen-detection> -->
      </div>
      <div class="right-container wrapper">
        <screen-examine></screen-examine>
        <screen-examine class="enter-right" :class="{ 'animate-enter-x': isEnd }"></screen-examine>
      </div>
    </div>
  </div>
@@ -30,7 +32,10 @@
import ScreenVideo from '../screen-video/index';
import ScreenCar from '../screen-car/index';
import ScreenMap from '../screen-map/index';
import ScreenMapCover from '../screen-map-cover/index';
import ScreenTable from '../screen-table/index';
import ScreenMapThree from '../screen-map-three/index.vue';
export default {
  name: 'ScreenWrapper',
  components: {
@@ -40,12 +45,33 @@
    ScreenVideo,
    ScreenCar,
    ScreenMap,
    ScreenTable
    ScreenTable,
    ScreenMapCover,
    ScreenMapThree
  },
  data() {
    return {
      isEnd: false
    }
  },
  methods: {
    returnPath() {
      this.$router.push('/index');
    },
    checkAnimationEnd(event) {
      if (this.isEnd) return;
      if (event.propertyName === 'transform') {
        this.isEnd = true;
      }
    }
  },
  mounted() {
    const container = document.querySelector('.screen-wrapper');
    container.addEventListener('transitionend', this.checkAnimationEnd);
  },
  destroyed() {
    const container = document.querySelector('.screen-wrapper');
    container.removeEventListener('transitionend', this.checkAnimationEnd);
  }
}
</script>
@@ -56,6 +82,7 @@
  right: 20px;
  top: 40px;
}
.wrapper-container {
  width: 100%;
  height: 100%;
@@ -78,7 +105,7 @@
}
.wrapper {
  width: 27%;
  width: 20%;
  height: 100%;
  box-sizing: border-box;
  padding: 0 10px;
@@ -94,8 +121,9 @@
    padding-right: 0;
  }
}
.center-wrapper {
  width: 46%;
  width: 60%;
  height: 100%;
  box-sizing: border-box;
  padding: 0 10px;
@@ -103,4 +131,61 @@
  flex-direction: column;
  justify-content: space-between;
}
.animate-enter-x {
  animation: enter-x 0.4s ease forwards;
}
.animate-enter-y {
  animation: enter-y 0.4s ease forwards;
}
.enter-left {
  transform: translateX(-100px);
  opacity: 0;
}
.enter-right {
  transform: translateX(100px);
  opacity: 0;
}
.enter-top {
  transform: translateY(100px);
  opacity: 0;
}
.animate-delay-1 {
  animation-delay: 0.1s;
}
.animate-delay-2 {
  animation-delay: 0.3s;
}
.animate-delay-3 {
  animation-delay: 0.5s;
}
@keyframes enter-x {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes enter-y {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
</style>