Index.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <!-- TODO注:可优化,对标 vben 版本 -->
  3. <div class="flex">
  4. <el-card class="user w-1/3" shadow="hover">
  5. <template #header>
  6. <div class="card-header">
  7. <span>{{ t('profile.user.title') }}</span>
  8. </div>
  9. </template>
  10. <ProfileUser ref="profileUserRef" />
  11. </el-card>
  12. <el-card class="user ml-3 w-2/3" shadow="hover">
  13. <div>
  14. <el-tabs v-model="activeName" class="profile-tabs" style="height: 400px" tab-position="top">
  15. <el-tab-pane :label="t('profile.info.basicInfo')" name="basicInfo">
  16. <BasicInfo @success="handleBasicInfoSuccess" />
  17. </el-tab-pane>
  18. <el-tab-pane :label="t('profile.info.resetPwd')" name="resetPwd">
  19. <ResetPwd />
  20. </el-tab-pane>
  21. <!-- <el-tab-pane :label="t('profile.info.userSocial')" name="userSocial">-->
  22. <!-- <UserSocial v-model:activeName="activeName" />-->
  23. <!-- </el-tab-pane>-->
  24. </el-tabs>
  25. </div>
  26. </el-card>
  27. </div>
  28. </template>
  29. <script lang="ts" setup>
  30. import { BasicInfo, ProfileUser, ResetPwd, UserSocial } from './components'
  31. const { t } = useI18n()
  32. defineOptions({ name: 'Profile' })
  33. const activeName = ref('basicInfo')
  34. const profileUserRef = ref()
  35. // 处理基本信息更新成功
  36. const handleBasicInfoSuccess = async () => {
  37. await profileUserRef.value?.refresh()
  38. }
  39. </script>
  40. <style scoped>
  41. .user {
  42. max-height: 960px;
  43. padding: 15px 20px 20px;
  44. }
  45. .card-header {
  46. display: flex;
  47. justify-content: center;
  48. align-items: center;
  49. }
  50. :deep(.el-card .el-card__header, .el-card .el-card__body) {
  51. padding: 15px !important;
  52. }
  53. .profile-tabs > .el-tabs__content {
  54. padding: 32px;
  55. font-weight: 600;
  56. color: #6b778c;
  57. }
  58. .el-tabs--left .el-tabs__content {
  59. height: 100%;
  60. }
  61. </style>