<script setup>
import QvSimulationMain from "../components/QvSimulation/QvSimulationMain.vue";
import CarSimulationMain from "../components/CarSimulation/CarSimulationMain.vue";
import Index from "../components/Main/Index.vue";
import QvLoading from "./components/Qv/QvLoading.vue";
import { computed, onMounted, onUnmounted, watch, ref } from "vue";
import { useRouter } from 'vue-router';
const router = useRouter();


// 加载百分比是否展示
let qvLoadingLook = ref(true);

// 地下车是否可以展示
let CarSimulationMainLook = ref(true);

// QV检测是否可以展示
let QvSimulationMainLook = ref(false);

/**
 * 当前加载百分比页面是否展示
 * open
 */
const callbackLookEvent = (open) => {
    // console.log("当前加载百分比页面是否展示", open);
    qvLoadingLook.value = open;
}


/**
 * 穿完工作服回调
 * bool
 */
const callbackChuanGongZuoFuEvent = (bool) => {

    // console.log( "穿完工作服回调 callbackChuanGongZuoFuEvent ===> ", bool );

    if (bool == true) {
        QvSimulationMainLook.value = true;
        CarSimulationMainLook.value = false;
        return;
    }

    QvSimulationMainLook.value = false;
    CarSimulationMainLook.value = true;

}


</script>

<template>
    <div class="Qv">

        <QvLoading v-show="qvLoadingLook == true" @callbackLook="callbackLookEvent"></QvLoading>

        <Index></Index>

        <QvSimulationMain
        v-show="QvSimulationMainLook == true"
        ></QvSimulationMain>

        <CarSimulationMain
        v-show="CarSimulationMainLook == true"
        @callbackChuanGongZuoFu="callbackChuanGongZuoFuEvent"
        ></CarSimulationMain>

        <!-- 单独调试 -->
        <!-- <QvSimulationMain></QvSimulationMain> -->
        
    </div>
</template>

<style lang="scss" scoped>

.Qv * {

    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -khtml-user-select: none;
    user-select: none;
}

.Qv {

    position: fixed;
    z-index: 0;
    width: 0px;
    height: 0px;
    top: 0px;
    left: 0px;

}

</style>