| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <template>
- <div v-if="loading" class="app-loading">
- <div id="loader-wrapper" class="app-loading">
- <div class="app-loading-wrap">
- <div class="app-loading-dots">
- <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
- </div>
- </div>
- </div>
- </div>
- <div id="micro-vent-3dModal"></div>
- </template>
- <script lang="ts">
- import { ref, onMounted, onBeforeUnmount, defineComponent } from 'vue';
- import { unmountMicroApps, mountMicroApp } from '/@/qiankun';
- import { resetMicroContentWH } from '/@/utils/domUtils';
- import { getActions } from '/@/qiankun/state';
- export default defineComponent({
- name: 'VentModel',
- setup() {
- let actions: any;
- const loading = ref(true);
- onMounted(() => {
- mountMicroApp('/micro-vent-3dModal');
- resetMicroContentWH('micro-vent-3dModal');
- actions = getActions();
- actions.onGlobalStateChange((newState, prev) => {
- debugger;
- for (const key in newState) {
- if (key === 'isMounted') {
- if (newState[key] !== prev[key] && newState[key] === true) {
- loading.value = false;
- console.log('首页已经渲染完毕');
- }
- }
- }
- });
- });
- onBeforeUnmount(async () => {
- unmountMicroApps(['/micro-vent-3dModal']);
- });
- return { loading };
- },
- });
- </script>
- <style lang="less" scoped>
- @import '/@/design/vent/color.less';
- .app-loading {
- position: absolute;
- display: flex;
- width: 100%;
- height: 100%;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- // background-color: #f4f7f900;
- background-image: url('/@/assets/images/vent/loading-bg.png');
- background-size: cover;
- background-repeat: no-repeat;
- background-color: var(--vent-base-color);
- }
- .app-loading .app-loading-wrap {
- position: absolute;
- top: 50%;
- left: 50%;
- display: flex;
- -webkit-transform: translate3d(-50%, -50%, 0);
- transform: translate3d(-50%, -50%, 0);
- justify-content: center;
- align-items: center;
- flex-direction: column;
- }
- .app-loading .dots {
- display: flex;
- padding: 98px;
- justify-content: center;
- align-items: center;
- }
- .app-loading .app-loading-title {
- display: flex;
- margin-top: 30px;
- font-size: 30px;
- color: rgba(0, 0, 0, 0.85);
- justify-content: center;
- align-items: center;
- }
- .dot {
- position: relative;
- display: inline-block;
- width: 32px;
- height: 32px;
- margin-top: 30px;
- font-size: 32px;
- transform: rotate(45deg);
- box-sizing: border-box;
- animation: antRotate 1.2s infinite linear;
- }
- .dot i {
- position: absolute;
- display: block;
- width: 14px;
- height: 14px;
- background-color: #0065cc;
- // background-color: #d1d1d1;
- border-radius: 100%;
- opacity: 0.3;
- transform: scale(0.75);
- animation: antSpinMove 1s infinite linear alternate;
- transform-origin: 50% 50%;
- }
- .dot i:nth-child(1) {
- top: 0;
- left: 0;
- }
- .dot i:nth-child(2) {
- top: 0;
- right: 0;
- -webkit-animation-delay: 0.4s;
- animation-delay: 0.4s;
- }
- .dot i:nth-child(3) {
- right: 0;
- bottom: 0;
- -webkit-animation-delay: 0.8s;
- animation-delay: 0.8s;
- }
- .dot i:nth-child(4) {
- bottom: 0;
- left: 0;
- -webkit-animation-delay: 1.2s;
- animation-delay: 1.2s;
- }
- @keyframes antRotate {
- to {
- -webkit-transform: rotate(405deg);
- transform: rotate(405deg);
- }
- }
- @-webkit-keyframes antRotate {
- to {
- -webkit-transform: rotate(405deg);
- transform: rotate(405deg);
- }
- }
- @keyframes antSpinMove {
- to {
- opacity: 1;
- }
- }
- @-webkit-keyframes antSpinMove {
- to {
- opacity: 1;
- }
- }
- </style>
|