index.vue 2.6 KB

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