main.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <div class="main">
  3. <!-- <BannerVue></BannerVue> -->
  4. <CourseSelect></CourseSelect>
  5. <resource></resource>
  6. <Practice></Practice>
  7. <other v-if="isupdateCourse"></other>
  8. <Edu v-if="isupdateCourse"></Edu>
  9. </div>
  10. </template>
  11. <script setup>
  12. import { ref,watchEffect } from 'vue';
  13. import BannerVue from '@/components/main/banner.vue'
  14. import CourseSelect from '@/components/main/courseSelect.vue'
  15. import resource from '@/components/main/resource.vue';
  16. import Practice from '@/components/main/Practice.vue';
  17. import other from '@/components/main/other.vue';
  18. import Edu from '@/components/main/edu.vue';
  19. import { userInfoStore } from '../stores/counter'
  20. const user = userInfoStore()
  21. const isupdateCourse = ref(false)
  22. watchEffect(() => {
  23. if (JSON.stringify(user.user) != "{}") {
  24. isLogin.value = true
  25. userName.value = user.user.userName
  26. if (user.user.currentRole == "areaAdministrator" || user.user.currentRole == "userAdministrator" || user.user.currentRole == "securityAuditor" || user.user.currentRole == "schoolAdministrator" || user.user.currentRole == "schoolSecurityAuditor" || user.user.currentRole == "teacher"|| user.user.currentRole == "visitor") {
  27. isupdateCourse.value = true
  28. }
  29. }
  30. })
  31. </script>
  32. <style lang="scss" scoped>
  33. .main{
  34. background: #F0F2F5;
  35. padding: 20px 10%;
  36. min-height: calc(100% - 60px);
  37. }
  38. </style>