header.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <script setup lang="ts">
  2. import { computed } from 'vue';
  3. import { SvgArrowRightIcon } from '@vben/icons';
  4. import useAvatar from '@/assets/image/user.png';
  5. import { $t } from '@/locales';
  6. import Logo from '#/assets/image/logo.png';
  7. // import { useLoginModalStore } from '#/store';
  8. import SelectLang from '../select-lang.vue';
  9. import Avatar from './avatar.vue';
  10. // const loginModalStore = useLoginModalStore();
  11. const token = localStorage.getItem('token_a');
  12. const menus = computed(() => [
  13. { title: $t('homeMenu.toolDownloads'), path: '/Views/Tools/Index.html' },
  14. {
  15. title: $t('homeMenu.aIGeneratedApps'),
  16. path: '/Views/Designer/AIGenerateApp.html',
  17. },
  18. {
  19. title: $t('homeMenu.aIAssistants'),
  20. path: '/Views/Designer/AIAssistant.html',
  21. },
  22. {
  23. title: $t('homeMenu.shaluAcademy'),
  24. path: `/Views/Account/SSOIndex.html?system=design&token=${token}`,
  25. },
  26. {
  27. title: $t('homeMenu.applicationMarket'),
  28. path: '/Views/Designer/systemAppStore.html?tab=application',
  29. },
  30. ]);
  31. function openLogin() {}
  32. function handleClick(path: string) {
  33. window.open(path, '_blank');
  34. }
  35. </script>
  36. <template>
  37. <div class="mb-[32px] flex items-center justify-between">
  38. <img :src="Logo" alt="logo" class="logo" height="30px" width="138px" />
  39. <ul class="menu flex gap-[60px] text-xs">
  40. <li
  41. v-for="menuItem in menus"
  42. :key="menuItem.title"
  43. class="flex items-center gap-2"
  44. @click="handleClick(menuItem.path)"
  45. >
  46. <span>{{ menuItem.title }}</span>
  47. <SvgArrowRightIcon class="arrow size-2" />
  48. </li>
  49. </ul>
  50. <div class="flex gap-2">
  51. <SelectLang />
  52. <Avatar :avatar="useAvatar" class="cursor-pointer" @click="openLogin" />
  53. </div>
  54. </div>
  55. </template>
  56. <style lang="scss" scoped>
  57. .logo {
  58. cursor: pointer;
  59. }
  60. .menu li {
  61. color: #462424;
  62. cursor: pointer;
  63. &:hover {
  64. color: #7a003d;
  65. :deep(path) {
  66. fill: #7a003d;
  67. }
  68. }
  69. }
  70. </style>