Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template lang="pug">
  2. w-app
  3. TopNav(@on-open='openDrawer = !openDrawer')
  4. w-drawer(v-model='openDrawer')
  5. SideBar(:pid='profile.id.value' @updatePid='setPid')
  6. RouterView(@updatePid='setPid')
  7. </template>
  8. <script>
  9. import 'wave-ui/dist/wave-ui.css'
  10. import SideBar from './components/SideBar.vue'
  11. import TopNav from './components/TopNav.vue'
  12. import { currentProfile } from './services'
  13. import { surveyFactory } from './utils'
  14. const DEV_MODE = import.meta.env.VITE_DEV == 'true'
  15. const DEV_PID = 46
  16. export default {
  17. components: { TopNav, SideBar },
  18. data: () => ({
  19. sliderVal: 1,
  20. openDrawer: false,
  21. }),
  22. computed: {
  23. profile: () => {
  24. return currentProfile
  25. },
  26. },
  27. async created() {
  28. /** Get questions so we can compare against profile responses */
  29. await surveyFactory.getQuestions()
  30. /**
  31. * Development mode turns router guards off so
  32. * we hard set the profile id instead of
  33. * using the login form
  34. */
  35. if (DEV_MODE) {
  36. console.info('===============================================')
  37. console.info('- SIIMEE -')
  38. console.info('-----------------------------------------------')
  39. console.info('[Siimee App]: You are in development mode:', DEV_MODE)
  40. console.info('[Siimee App]: Starting application...')
  41. console.info('-----------------------------------------------')
  42. await this.setPid(DEV_PID)
  43. }
  44. },
  45. methods: {
  46. /**
  47. * Sync up this components state with
  48. * the currentProfile handler
  49. */
  50. async setPid(profileId) {
  51. if (currentProfile.isLoggedIn) {
  52. currentProfile.logout()
  53. }
  54. await currentProfile.login(profileId, this.$waveui.notify)
  55. console.log('---')
  56. /**
  57. * Default to the HomeView and alter as needed (side-effects!)
  58. */
  59. const toRoute = { name: 'HomeView' }
  60. this.$router.push(toRoute)
  61. },
  62. },
  63. }
  64. </script>
  65. <style lang="sass">
  66. #app > .w-app > main
  67. position: relative
  68. top: 50px
  69. </style>