3756520510bf3c26b04631731ebde8cfbf5d296b.svn-base 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <div class="page-header-index-wide page-header-wrapper-grid-content-main">
  3. <a-row :gutter="24">
  4. <a-col :md="24" :lg="7">
  5. <a-card :bordered="false">
  6. <div class="account-center-avatarHolder">
  7. <div class="avatar">
  8. <img :src="getAvatar()"/>
  9. </div>
  10. <div class="username">{{ nickname() }}</div>
  11. <div class="bio">海纳百川,有容乃大</div>
  12. </div>
  13. <div class="account-center-detail">
  14. <p>
  15. <i class="title"></i>交互专家
  16. </p>
  17. <p>
  18. <i class="group"></i>蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED
  19. </p>
  20. <p>
  21. <i class="address"></i><span>浙江省</span><span>杭州市</span>
  22. </p>
  23. </div>
  24. <a-divider />
  25. <div class="account-center-tags">
  26. <div class="tagsTitle">标签</div>
  27. <div>
  28. <template v-for="(tag, index) in tags">
  29. <a-tooltip v-if="tag.length > 20" :key="tag" :title="tag">
  30. <a-tag :key="tag" :closable="index !== 0" :afterClose="() => handleTagClose(tag)">
  31. {{ `${tag.slice(0, 20)}...` }}
  32. </a-tag>
  33. </a-tooltip>
  34. <a-tag v-else :key="tag" :closable="index !== 0" :afterClose="() => handleTagClose(tag)">{{ tag }}</a-tag>
  35. </template>
  36. <a-input
  37. v-if="tagInputVisible"
  38. ref="tagInput"
  39. type="text"
  40. size="small"
  41. :style="{ width: '78px' }"
  42. :value="tagInputValue"
  43. @change="handleInputChange"
  44. @blur="handleTagInputConfirm"
  45. @keyup.enter="handleTagInputConfirm"
  46. />
  47. <a-tag v-else @click="showTagInput" style="background: #fff; borderStyle: dashed;">
  48. <a-icon type="plus" /> New Tag
  49. </a-tag>
  50. </div>
  51. </div>
  52. <a-divider :dashed="true" />
  53. <div class="account-center-team">
  54. <div class="teamTitle">团队</div>
  55. <a-spin :spinning="teamSpinning">
  56. <div class="members">
  57. <a-row>
  58. <a-col :span="12" v-for="(item, index) in teams" :key="index">
  59. <a>
  60. <a-avatar size="small" :src="item.avatar" />
  61. <span class="member">{{ item.name }}</span>
  62. </a>
  63. </a-col>
  64. </a-row>
  65. </div>
  66. </a-spin>
  67. </div>
  68. </a-card>
  69. </a-col>
  70. <a-col :md="24" :lg="17">
  71. <a-card
  72. style="width:100%"
  73. :bordered="false"
  74. :tabList="tabListNoTitle"
  75. :activeTabKey="noTitleKey"
  76. @tabChange="key => handleTabChange(key, 'noTitleKey')"
  77. >
  78. <article-page v-if="noTitleKey === 'article'"></article-page>
  79. <app-page v-else-if="noTitleKey === 'app'"></app-page>
  80. <project-page v-else-if="noTitleKey === 'project'"></project-page>
  81. </a-card>
  82. </a-col>
  83. </a-row>
  84. </div>
  85. </template>
  86. <script>
  87. import PageLayout from '@/components/page/PageLayout'
  88. import RouteView from "@/components/layouts/RouteView"
  89. import { AppPage, ArticlePage, ProjectPage } from './page'
  90. import { mapGetters } from 'vuex'
  91. import { getFileAccessHttpUrl } from '@/api/manage';
  92. export default {
  93. components: {
  94. RouteView,
  95. PageLayout,
  96. AppPage,
  97. ArticlePage,
  98. ProjectPage
  99. },
  100. data() {
  101. return {
  102. tags: ['很有想法的', '专注设计', '辣~', '大长腿', '川妹子', '海纳百川'],
  103. tagInputVisible: false,
  104. tagInputValue: '',
  105. teams: [],
  106. teamSpinning: true,
  107. tabListNoTitle: [{
  108. key: 'article',
  109. tab: '文章(8)',
  110. }, {
  111. key: 'app',
  112. tab: '应用(8)',
  113. }, {
  114. key: 'project',
  115. tab: '项目(8)',
  116. }
  117. ],
  118. noTitleKey: 'app',
  119. }
  120. },
  121. mounted () {
  122. this.getTeams()
  123. },
  124. methods: {
  125. ...mapGetters(["nickname", "avatar"]),
  126. getAvatar(){
  127. return getFileAccessHttpUrl(this.avatar());
  128. },
  129. getTeams() {
  130. this.$http.get('/mock/api/workplace/teams')
  131. .then(res => {
  132. this.teams = res.result
  133. this.teamSpinning = false
  134. })
  135. },
  136. handleTabChange (key, type) {
  137. this[type] = key
  138. },
  139. handleTagClose (removeTag) {
  140. const tags = this.tags.filter(tag => tag != removeTag)
  141. this.tags = tags
  142. },
  143. showTagInput () {
  144. this.tagInputVisible = true
  145. this.$nextTick(() => {
  146. this.$refs.tagInput.focus()
  147. })
  148. },
  149. handleInputChange (e) {
  150. this.tagInputValue = e.target.value
  151. },
  152. handleTagInputConfirm () {
  153. const inputValue = this.tagInputValue
  154. let tags = this.tags
  155. if (inputValue && tags.indexOf(inputValue) === -1) {
  156. tags = [...tags, inputValue]
  157. }
  158. Object.assign(this, {
  159. tags,
  160. tagInputVisible: false,
  161. tagInputValue: ''
  162. })
  163. }
  164. },
  165. }
  166. </script>
  167. <style lang="less" scoped>
  168. .page-header-wrapper-grid-content-main {
  169. width: 100%;
  170. height: 100%;
  171. min-height: 100%;
  172. transition: .3s;
  173. .account-center-avatarHolder {
  174. text-align: center;
  175. margin-bottom: 24px;
  176. & > .avatar {
  177. margin: 0 auto;
  178. width: 104px;
  179. height: 104px;
  180. margin-bottom: 20px;
  181. border-radius: 50%;
  182. overflow: hidden;
  183. img {
  184. height: 100%;
  185. width: 100%;
  186. }
  187. }
  188. .username {
  189. color: rgba(0, 0, 0, 0.85);
  190. font-size: 20px;
  191. line-height: 28px;
  192. font-weight: 500;
  193. margin-bottom: 4px;
  194. }
  195. }
  196. .account-center-detail {
  197. p {
  198. margin-bottom: 8px;
  199. padding-left: 26px;
  200. position: relative;
  201. }
  202. i {
  203. position: absolute;
  204. height: 14px;
  205. width: 14px;
  206. left: 0;
  207. top: 4px;
  208. background: url(https://gw.alipayobjects.com/zos/rmsportal/pBjWzVAHnOOtAUvZmZfy.svg)
  209. }
  210. .title {
  211. background-position: 0 0;
  212. }
  213. .group {
  214. background-position: 0 -22px;
  215. }
  216. .address {
  217. background-position: 0 -44px;
  218. }
  219. }
  220. .account-center-tags {
  221. .ant-tag {
  222. margin-bottom: 8px;
  223. }
  224. }
  225. .account-center-team {
  226. .members {
  227. a {
  228. display: block;
  229. margin: 12px 0;
  230. line-height: 24px;
  231. height: 24px;
  232. .member {
  233. font-size: 14px;
  234. color: rgba(0, 0, 0, .65);
  235. line-height: 24px;
  236. max-width: 100px;
  237. vertical-align: top;
  238. margin-left: 12px;
  239. transition: all 0.3s;
  240. display: inline-block;
  241. }
  242. &:hover {
  243. span {
  244. color: #1890ff;
  245. }
  246. }
  247. }
  248. }
  249. }
  250. .tagsTitle, .teamTitle {
  251. font-weight: 500;
  252. color: rgba(0,0,0,.85);
  253. margin-bottom: 12px;
  254. }
  255. }
  256. </style>