index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <div :class="prefixCls">
  3. <a-row :class="`${prefixCls}-top`">
  4. <a-col :span="9" :class="`${prefixCls}-col`">
  5. <a-row>
  6. <a-col :span="8">
  7. <div :class="`${prefixCls}-top__avatar`">
  8. <img width="70" :src="avatar" />
  9. <span>Vben</span>
  10. <div>海纳百川,有容乃大</div>
  11. </div>
  12. </a-col>
  13. <a-col :span="16">
  14. <div :class="`${prefixCls}-top__detail`">
  15. <template v-for="detail in details" :key="detail.title">
  16. <p>
  17. <Icon :icon="detail.icon" />
  18. {{ detail.title }}
  19. </p>
  20. </template>
  21. </div>
  22. </a-col>
  23. </a-row>
  24. </a-col>
  25. <a-col :span="7" :class="`${prefixCls}-col`">
  26. <CollapseContainer title="标签" :canExpan="false">
  27. <template v-for="tag in tags" :key="tag">
  28. <Tag class="mb-2">
  29. {{ tag }}
  30. </Tag>
  31. </template>
  32. </CollapseContainer>
  33. </a-col>
  34. <a-col :span="8" :class="`${prefixCls}-col`">
  35. <CollapseContainer :class="`${prefixCls}-top__team`" title="团队" :canExpan="false">
  36. <div v-for="(team, index) in teams" :key="index" :class="`${prefixCls}-top__team-item`">
  37. <Icon :icon="team.icon" :color="team.color" />
  38. <span>{{ team.title }}</span>
  39. </div>
  40. </CollapseContainer>
  41. </a-col>
  42. </a-row>
  43. <div :class="`${prefixCls}-bottom`">
  44. <Tabs>
  45. <template v-for="item in achieveList" :key="item.key">
  46. <TabPane :tab="item.name">
  47. <component :is="item.component" />
  48. </TabPane>
  49. </template>
  50. </Tabs>
  51. </div>
  52. </div>
  53. </template>
  54. <script lang="ts">
  55. import { Tag, Tabs, Row, Col } from 'ant-design-vue';
  56. import { defineComponent, computed } from 'vue';
  57. import { CollapseContainer } from '@/components/Container';
  58. import Icon from '@/components/Icon/Icon.vue';
  59. import Article from './Article.vue';
  60. import Application from './Application.vue';
  61. import Project from './Project.vue';
  62. import headerImg from '@/assets/images/header.jpg';
  63. import { tags, teams, details, achieveList } from './data';
  64. import { useUserStore } from '@/store/modules/user';
  65. export default defineComponent({
  66. components: {
  67. CollapseContainer,
  68. Icon,
  69. Tag,
  70. Tabs,
  71. TabPane: Tabs.TabPane,
  72. Article,
  73. Application,
  74. Project,
  75. [Row.name]: Row,
  76. [Col.name]: Col,
  77. },
  78. setup() {
  79. const userStore = useUserStore();
  80. const avatar = computed(() => userStore.getUserInfo.avatar || headerImg);
  81. return {
  82. prefixCls: 'account-center',
  83. avatar,
  84. tags,
  85. teams,
  86. details,
  87. achieveList,
  88. };
  89. },
  90. });
  91. </script>
  92. <style lang="less" scoped>
  93. .account-center {
  94. &-col:not(:last-child) {
  95. padding: 0 10px;
  96. &:not(:last-child) {
  97. border-right: 1px dashed rgb(206 206 206 / 50%);
  98. }
  99. }
  100. &-top {
  101. margin: 16px 16px 12px;
  102. padding: 10px;
  103. border-radius: 3px;
  104. background-color: @component-background;
  105. &__avatar {
  106. text-align: center;
  107. img {
  108. margin: auto;
  109. border-radius: 50%;
  110. }
  111. span {
  112. display: block;
  113. font-size: 20px;
  114. font-weight: 500;
  115. }
  116. div {
  117. margin-top: 3px;
  118. font-size: 12px;
  119. }
  120. }
  121. &__detail {
  122. margin-top: 15px;
  123. padding-left: 20px;
  124. }
  125. &__team {
  126. &-item {
  127. display: inline-block;
  128. padding: 4px 24px;
  129. }
  130. span {
  131. margin-left: 3px;
  132. }
  133. }
  134. }
  135. &-bottom {
  136. margin: 0 16px 16px;
  137. padding: 10px;
  138. border-radius: 3px;
  139. background-color: @component-background;
  140. }
  141. }
  142. </style>