You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spring-boot-online-exam/frontend/src/views/account/settings/Index.vue

145 lines
3.7 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<div class="page-header-index-wide">
<!-- 卡片组件用于展示内容 -->
<a-card :bordered="false" :bodyStyle="{ padding: '16px 0', height: '100%' }" :style="{ height: '100%' }">
<!-- 账户设置信息主容器 -->
<div class="account-settings-info-main" :class="device">
<!-- 账户设置信息左侧 -->
<div class="account-settings-info-left">
<!-- 菜单组件用于展示导航 -->
<a-menu
:mode="device == 'mobile' ? 'horizontal' : 'inline'"
:style="{ border: '0', width: device == 'mobile' ? '560px' : 'auto'}"
:defaultSelectedKeys="defaultSelectedKeys"
type="inner"
@openChange="onOpenChange"
>
<!-- 菜单项用于展示导航链接 -->
<a-menu-item key="/account/settings/base">
<!-- 路由链接用于跳转到基本设置页面 -->
<router-link :to="{ name: 'BaseSettings' }">
基本设置
</router-link>
</a-menu-item>
<a-menu-item key="/account/settings/custom">
<!-- 路由链接用于跳转到个性化设置页面 -->
<router-link :to="{ name: 'CustomSettings' }">
个性化
</router-link>
</a-menu-item>
</a-menu>
</div>
<!-- 账户设置信息右侧 -->
<div class="account-settings-info-right">
<!-- 账户设置信息标题 -->
<div class="account-settings-info-title">
<span>{{ $route.meta.title }}</span>
</div>
<!-- 路由视图用于展示当前路由对应的组件 -->
<route-view></route-view>
</div>
</div>
</a-card>
</div>
</template>
<script>
import { PageView, RouteView } from '../../../layouts'
import { mixinDevice } from '../../../utils/mixin.js'
export default {
components: {
RouteView,
PageView
},
mixins: [mixinDevice],
data () {
return {
// horizontal inline
mode: 'inline',
openKeys: [],
defaultSelectedKeys: [],
// cropper
preview: {},
option: {
img: '/avatar2.jpg',
info: true,
size: 1,
outputType: 'jpeg',
canScale: false,
autoCrop: true,
// 只有自动截图开启 宽度高度才生效
autoCropWidth: 180,
autoCropHeight: 180,
fixedBox: true,
// 开启宽度和高度比例
fixed: true,
fixedNumber: [1, 1]
},
pageTitle: ''
}
},
created () {
this.updateMenu()
},
methods: {
onOpenChange (openKeys) {
this.openKeys = openKeys
},
updateMenu () {
const routes = this.$route.matched.concat()
this.defaultSelectedKeys = [ routes.pop().path ]
}
}
}
</script>
<style lang="less" scoped>
.account-settings-info-main {
width: 100%;
display: flex;
height: 100%;
overflow: auto;
&.mobile {
display: block;
.account-settings-info-left {
border-right: unset;
border-bottom: 1px solid #e8e8e8;
width: 100%;
height: 50px;
overflow-x: auto;
overflow-y: scroll;
}
.account-settings-info-right {
padding: 20px 40px;
}
}
.account-settings-info-left {
border-right: 1px solid #e8e8e8;
width: 224px;
}
.account-settings-info-right {
flex: 1 1;
padding: 8px 40px;
.account-settings-info-title {
color: rgba(0,0,0,.85);
font-size: 20px;
font-weight: 500;
line-height: 28px;
margin-bottom: 12px;
}
.account-settings-info-view {
padding-top: 12px;
}
}
}
</style>