Index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <div class="page-header-index-wide">
  3. <a-card :bordered="false" :bodyStyle="{ padding: '16px 0', height: '100%' }" :style="{ height: '100%' }">
  4. <div class="account-settings-info-main" :class="device">
  5. <div class="account-settings-info-left">
  6. <a-menu
  7. :mode="device == 'mobile' ? 'horizontal' : 'inline'"
  8. :style="{ border: '0', width: device == 'mobile' ? '560px' : 'auto'}"
  9. :defaultSelectedKeys="defaultSelectedKeys"
  10. type="inner"
  11. @openChange="onOpenChange"
  12. >
  13. <a-menu-item key="/account/settings/base">
  14. <router-link :to="{ name: 'BaseSettings' }">
  15. 基本设置
  16. </router-link>
  17. </a-menu-item>
  18. <a-menu-item key="/account/settings/security">
  19. <router-link :to="{ name: 'SecuritySettings' }">
  20. 安全设置
  21. </router-link>
  22. </a-menu-item>
  23. <a-menu-item key="/account/settings/custom">
  24. <router-link :to="{ name: 'CustomSettings' }">
  25. 个性化
  26. </router-link>
  27. </a-menu-item>
  28. <a-menu-item key="/account/settings/binding">
  29. <router-link :to="{ name: 'BindingSettings' }">
  30. 账户绑定
  31. </router-link>
  32. </a-menu-item>
  33. <a-menu-item key="/account/settings/notification">
  34. <router-link :to="{ name: 'NotificationSettings' }">
  35. 新消息通知
  36. </router-link>
  37. </a-menu-item>
  38. </a-menu>
  39. </div>
  40. <div class="account-settings-info-right">
  41. <div class="account-settings-info-title">
  42. <span>{{ $route.meta.title }}</span>
  43. </div>
  44. <route-view></route-view>
  45. </div>
  46. </div>
  47. </a-card>
  48. </div>
  49. </template>
  50. <script>
  51. import { PageView, RouteView } from '@/layouts'
  52. import { mixinDevice } from '@/utils/mixin.js'
  53. export default {
  54. components: {
  55. RouteView,
  56. PageView
  57. },
  58. mixins: [mixinDevice],
  59. data () {
  60. return {
  61. // horizontal inline
  62. mode: 'inline',
  63. openKeys: [],
  64. defaultSelectedKeys: [],
  65. // cropper
  66. preview: {},
  67. option: {
  68. img: '/avatar2.jpg',
  69. info: true,
  70. size: 1,
  71. outputType: 'jpeg',
  72. canScale: false,
  73. autoCrop: true,
  74. // 只有自动截图开启 宽度高度才生效
  75. autoCropWidth: 180,
  76. autoCropHeight: 180,
  77. fixedBox: true,
  78. // 开启宽度和高度比例
  79. fixed: true,
  80. fixedNumber: [1, 1]
  81. },
  82. pageTitle: ''
  83. }
  84. },
  85. created () {
  86. this.updateMenu()
  87. },
  88. methods: {
  89. onOpenChange (openKeys) {
  90. this.openKeys = openKeys
  91. },
  92. updateMenu () {
  93. const routes = this.$route.matched.concat()
  94. this.defaultSelectedKeys = [ routes.pop().path ]
  95. }
  96. }
  97. }
  98. </script>
  99. <style lang="less" scoped>
  100. .account-settings-info-main {
  101. width: 100%;
  102. display: flex;
  103. height: 100%;
  104. overflow: auto;
  105. &.mobile {
  106. display: block;
  107. .account-settings-info-left {
  108. border-right: unset;
  109. border-bottom: 1px solid #e8e8e8;
  110. width: 100%;
  111. height: 50px;
  112. overflow-x: auto;
  113. overflow-y: scroll;
  114. }
  115. .account-settings-info-right {
  116. padding: 20px 40px;
  117. }
  118. }
  119. .account-settings-info-left {
  120. border-right: 1px solid #e8e8e8;
  121. width: 224px;
  122. }
  123. .account-settings-info-right {
  124. flex: 1 1;
  125. padding: 8px 40px;
  126. .account-settings-info-title {
  127. color: rgba(0,0,0,.85);
  128. font-size: 20px;
  129. font-weight: 500;
  130. line-height: 28px;
  131. margin-bottom: 12px;
  132. }
  133. .account-settings-info-view {
  134. padding-top: 12px;
  135. }
  136. }
  137. }
  138. </style>