4f413b1d1708f77fae80d9032d9abb17011d03a9.svn-base 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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" :style=" 'min-height:'+ mainInfoHeight ">
  5. <div class="account-settings-info-left">
  6. <a-menu
  7. :mode="device == 'mobile' ? 'horizontal' : 'inline'"
  8. :default-selected-keys="['settings']"
  9. :style="{ border: '0', width: device == 'mobile' ? '560px' : 'auto'}"
  10. type="inner"
  11. @openChange="onOpenChange"
  12. >
  13. <a-menu-item key="settings">
  14. <a @click="settingsClick()">
  15. 基本设置
  16. </a>
  17. </a-menu-item>
  18. <a-menu-item key="security">
  19. <a @click="securityClick()">安全设置</a>
  20. </a-menu-item>
  21. <a-menu-item key="custom">
  22. <a @click="customClick()"> 个性化</a>
  23. </a-menu-item>
  24. <a-menu-item key="binding">
  25. <a @click="bindingClick()">账户绑定</a>
  26. </a-menu-item>
  27. <a-menu-item key="notification">
  28. <a @click="notificationClick()">新消息通知</a>
  29. </a-menu-item>
  30. </a-menu>
  31. </div>
  32. <div class="account-settings-info-right">
  33. <div class="account-settings-info-title">
  34. <span>{{ title }}</span>
  35. </div>
  36. <security ref="security" v-if="security"></security>
  37. <base-setting ref="baseSetting" v-if="baseSetting"></base-setting>
  38. <custom ref="custom" v-if="custom"></custom>
  39. <notification ref="notification" v-if="notification"></notification>
  40. <binding ref="binding" v-if="binding"></binding>
  41. </div>
  42. </div>
  43. </a-card>
  44. </div>
  45. </template>
  46. <script>
  47. import PageLayout from '@/components/page/PageLayout'
  48. import RouteView from "@/components/layouts/RouteView"
  49. import { mixinDevice } from '@/utils/mixin.js'
  50. import security from './Security'
  51. import baseSetting from './BaseSetting'
  52. import custom from './Custom'
  53. import notification from './Notification'
  54. import binding from './Binding'
  55. export default {
  56. components: {
  57. RouteView,
  58. PageLayout,
  59. security,
  60. baseSetting,
  61. custom,
  62. notification,
  63. binding
  64. },
  65. mixins: [mixinDevice],
  66. data () {
  67. return {
  68. // horizontal inline
  69. mode: 'inline',
  70. mainInfoHeight:"100%",
  71. openKeys: [],
  72. defaultSelectedKeys: [],
  73. // cropper
  74. preview: {},
  75. option: {
  76. img: '/avatar2.jpg',
  77. info: true,
  78. size: 1,
  79. outputType: 'jpeg',
  80. canScale: false,
  81. autoCrop: true,
  82. // 只有自动截图开启 宽度高度才生效
  83. autoCropWidth: 180,
  84. autoCropHeight: 180,
  85. fixedBox: true,
  86. // 开启宽度和高度比例
  87. fixed: true,
  88. fixedNumber: [1, 1]
  89. },
  90. pageTitle: '',
  91. title:"基本设置",
  92. security:false,
  93. baseSetting:true,
  94. custom:false,
  95. notification:false,
  96. binding:false
  97. }
  98. },
  99. created () {
  100. this.updateMenu()
  101. },
  102. mounted(){
  103. this.mainInfoHeight = (window.innerHeight-285)+"px";
  104. },
  105. methods: {
  106. onOpenChange (openKeys) {
  107. this.openKeys = openKeys
  108. },
  109. updateMenu () {
  110. let routes = this.$route.matched.concat()
  111. this.defaultSelectedKeys = [ routes.pop().path ]
  112. },
  113. //update-begin--Author:wangshuai Date:20200729 for:聚合路由错误 issues#1441--------------------
  114. settingsClick(){
  115. this.security=false
  116. this.custom=false
  117. this.notification=false
  118. this.binding=false
  119. this.baseSetting=true
  120. this.title="基本设置"
  121. },
  122. securityClick(){
  123. this.baseSetting=false
  124. this.custom=false;
  125. this.notification=false
  126. this.binding=false
  127. this.security=true
  128. this.title="安全设置"
  129. },
  130. notificationClick(){
  131. this.security=false
  132. this.custom=false
  133. this.baseSetting=false
  134. this.binding=false
  135. this.notification=true
  136. this.title="新消息通知"
  137. },
  138. bindingClick(){
  139. this.security=false
  140. this.baseSetting=false
  141. this.notification=false;
  142. this.custom=false;
  143. this.binding=true
  144. this.title="账号绑定"
  145. },
  146. customClick(){
  147. this.security=false
  148. this.baseSetting=false
  149. this.notification=false;
  150. this.binding=false
  151. this.custom=true;
  152. this.title="个性化"
  153. }
  154. //update-end--Author:wangshuai Date:20200729 for:聚合路由错误 issues#1441--------------------
  155. },
  156. }
  157. </script>
  158. <style lang="less" scoped>
  159. .account-settings-info-main {
  160. width: 100%;
  161. display: flex;
  162. height: 100%;
  163. overflow: auto;
  164. &.mobile {
  165. display: block;
  166. .account-settings-info-left {
  167. border-right: unset;
  168. border-bottom: 1px solid #e8e8e8;
  169. width: 100%;
  170. height: 50px;
  171. overflow-x: auto;
  172. overflow-y: scroll;
  173. }
  174. .account-settings-info-right {
  175. padding: 20px 40px;
  176. }
  177. }
  178. .account-settings-info-left {
  179. border-right: 1px solid #e8e8e8;
  180. width: 224px;
  181. }
  182. .account-settings-info-right {
  183. flex: 1 1;
  184. padding: 8px 40px;
  185. .account-settings-info-title {
  186. color: rgba(0,0,0,.85);
  187. font-size: 20px;
  188. font-weight: 500;
  189. line-height: 28px;
  190. margin-bottom: 12px;
  191. }
  192. .account-settings-info-view {
  193. padding-top: 12px;
  194. }
  195. }
  196. }
  197. </style>