index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <HeadPanl v-bind="({class: 'personal-head'} as any)">
  3. <div class="user">
  4. <img :src="user.avatar" />
  5. <div class="info">
  6. <h4>{{ getGreet() }},{{ user.nickname }}</h4>
  7. <div class="account">
  8. <span>{{ user.phone }}</span>
  9. <span>{{ user.email }}</span>
  10. </div>
  11. <div class="account-manage">
  12. <a :href="userInfoLink">{{ $t('sys.updateInfo') }} ></a>
  13. <a :href="userInfoLink">{{ $t('sys.updatePwd') }} ></a>
  14. </div>
  15. </div>
  16. </div>
  17. <Simples :data="simples" />
  18. </HeadPanl>
  19. <BodyPanl :title="$t('sys.operLog')">
  20. <RecordList />
  21. </BodyPanl>
  22. </template>
  23. <script lang="ts" setup>
  24. import RecordList from '@/views/record/list.vue'
  25. import Simples from '@/components/simples/index.vue'
  26. import { HeadPanl, BodyPanl } from '@/layout/panl'
  27. import { toRefs } from 'vue'
  28. import { computed } from 'vue'
  29. import { useUserStore } from '@/store'
  30. import { userInfoLink } from '@/env'
  31. import { ui18n } from '@/lang'
  32. const { current: user, meta } = toRefs(useUserStore().$state)
  33. const simples = computed(() => [
  34. { label: ui18n.t('sys.projectCount'), value: meta.value.projectCount },
  35. {
  36. label: ui18n.t('sys.projectFileCount'),
  37. value: meta.value.projectFileCount
  38. },
  39. {
  40. label: ui18n.t('sys.projectSceneCount'),
  41. value: meta.value.projectSceneCount
  42. },
  43. { label: ui18n.t('sys.projectOverCount'), value: meta.value.projectOverCount }
  44. ])
  45. const getGreet = () => {
  46. const hours = new Date().getHours()
  47. return hours > 5 && hours < 11
  48. ? ui18n.t('sys.time[0]')
  49. : hours >= 11 && hours < 15
  50. ? ui18n.t('sys.time[1]')
  51. : hours >= 15 && hours <= 18
  52. ? ui18n.t('sys.time[2]')
  53. : ui18n.t('sys.time[3]')
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .personal-head {
  58. display: flex;
  59. align-items: center;
  60. justify-content: space-between;
  61. }
  62. .user {
  63. display: flex;
  64. img {
  65. width: 104px;
  66. height: 104px;
  67. border: 1px solid rgba(0, 0, 0, 0.05);
  68. flex: none;
  69. margin-right: var(--padding);
  70. display: block;
  71. object-fit: cover;
  72. border-radius: 50%;
  73. }
  74. }
  75. .info {
  76. flex: 1;
  77. h3 {
  78. font-size: 20px;
  79. margin-bottom: 10px;
  80. color: #323233;
  81. }
  82. }
  83. .account {
  84. margin-bottom: 20px;
  85. color: #666666;
  86. font-size: 14px;
  87. span {
  88. margin-right: 14px;
  89. }
  90. }
  91. .account-manage {
  92. a {
  93. font-size: 14px;
  94. color: #0076f6;
  95. margin-right: 30px;
  96. }
  97. }
  98. </style>