<template>
  <div class="body-box">
    <SidevarItem></SidevarItem>
    <div class="content">
      <Navbar></Navbar>
      <router-view v-slot="{ Component }">
        <!-- <transition name="fade"> 使用动画会出现bug-->
        <component :is="Component" />
        <!-- </transition> -->
      </router-view>
    </div>
  </div>
</template>

<script setup>
import { ref, reactive, onBeforeMount, onMounted, watch } from "vue";
import Navbar from "./sidebar/Navbar.vue";
import { ElMessage, ElMessageBox } from "element-plus";
import SidevarItem from "./sidebar/SidevarItem.vue";
import { useStore } from "vuex";
import axios from "axios";
import { useRouter } from "vue-router";
const store = useStore();
const router = useRouter();
const api = ref("");
const flag = ref(true);
watch(
  () => router.currentRoute.value.fullPath,
  (newValue, oldValue) => {
    console.log(newValue);
    store.commit("indexUp", newValue);
    sessionStorage.setItem("sidevarItem", newValue);
  }
);

const tableData = reactive({
  list: [],
});
onMounted(() => {
  
});
onBeforeMount(async () => {
  api.value = store.state.user.api;
});
</script>

<style scoped lang="scss">
.body-box {
  display: flex;

  .content {
    // min-width: 1740px;
    // max-width: calc(100vw - 81px);
    min-width: calc(100vw - 220px);
    width: 100%;
    height: calc(100vh);
    background-color: rgba(238, 238, 238, 1);
    :deep(.el-dialog__header .el-dialog__headerbtn) {
      outline: none;
    }
    .router-view {
      position: absolute;
    }
  }
  .fade-enter-active {
    animation: bounce-in 0.3s;
  }
  .fade-leave-active {
    animation: bounce-out 0.3s;
  }
  @keyframes bounce-in {
    0% {
      transform: translate3d(-100%, 0, 0);
    }
    25% {
      transform: translate3d(-75%, 0, 0);
    }
    50% {
      transform: translate3d(-50%, 0, 0);
    }
    75% {
      transform: translate3d(-25%, 0, 0);
    }
    100% {
      transform: translate3d(0px, 0, 0);
    }
  }
  @keyframes bounce-out {
    0% {
      transform: translate3d(0, 0, 0);
    }
    25% {
      transform: translate3d(25%, 0, 0);
    }
    50% {
      transform: translate3d(50%, 0, 0);
    }
    75% {
      transform: translate3d(75%, 0, 0);
    }
    100% {
      transform: translate3d(100%, 0, 0);
    }
  }
}
</style>
<style lang="scss">
.is-message-box {
  .el-message-box__header {
    .el-message-box__headerbtn {
      outline: none;
    }
  }

  .el-message-box__btns {
    .el-button--primary {
      background-color: rgba(61, 81, 232, 1);
      border: 0.5px solid rgba(61, 81, 232, 1);
    }

    .el-button--primary:hover {
      background-color: rgb(119, 133, 239);
      border: 0.5px solid rgb(119, 133, 239);
    }
  }
}
.el-dialog {
  padding: 0;
  .el-dialog__header {
    height: 60px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    .el-dialog__headerbtn {
      top: 6px;
    }
  }
}
.el-dialog__body {
  .el-input {
    .el-input__suffix-inner {
      color: rgba(61, 81, 232, 1);
    }
  }
}
.pw {
  .el-dialog__body {
    .el-form {
      .el-form-item {
        .queding {
          background-color: rgba(61, 81, 232, 1);
          border: 0.5px solid rgba(61, 81, 232, 1);
        }

        .queding:hover {
          background-color: rgb(119, 133, 239);
          border: 0.5px solid rgb(119, 133, 239);
        }
      }
    }
  }
}

.el-button:focus {
  outline: none;
}

.tangram-suggestion-main {
  z-index: 999999;

  .tangram-suggestion {
    height: 150px;
    overflow: auto;
  }
}

#notification_1 {
  .el-notification__group {
    .el-notification__title {
      color: red;
    }
  }
}

*::-webkit-scrollbar-track {
  background-color: #fff;
}

*::-webkit-scrollbar {
  background-color: #57b2ff;
  height: 0;
  width: 0;
}

*::-webkit-scrollbar-thumb {
  background: #57b2ff;
  border-radius: 4px;
  height: 0;
  width: 0;
}
</style>
