update 增加用户个人信息管理的功能
This commit is contained in:
@@ -35,7 +35,13 @@
|
||||
>关闭右侧标签页</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
<component :is="pane.component" :key="pane.key" :param="pane.param" v-if="pane.loaded" />
|
||||
<component
|
||||
:is="pane.component"
|
||||
:key="pane.key"
|
||||
:param="pane.param"
|
||||
ref="panes"
|
||||
v-if="pane.loaded"
|
||||
/>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-layout-content>
|
||||
@@ -75,6 +81,14 @@ export default {
|
||||
onLoadContentWindow(key) {
|
||||
NProgress.start();
|
||||
const pane = this.panes.find((p) => p.key === key);
|
||||
|
||||
// 打开之前先销毁
|
||||
const index = this.panes.indexOf(pane);
|
||||
const component = this.$refs.panes && this.$refs.panes[index];
|
||||
if (component) {
|
||||
component.$destroy();
|
||||
}
|
||||
|
||||
const i = import(`@/pages${pane.path}`);
|
||||
pane.component = () => i;
|
||||
pane.loaded = false;
|
||||
|
||||
@@ -34,6 +34,15 @@ export default {
|
||||
}, 300)
|
||||
},
|
||||
|
||||
onAccountSetting() {
|
||||
this.openContentWindow({
|
||||
key: 'account-home',
|
||||
title: '个人中心',
|
||||
icon: 'user',
|
||||
path: '/account'
|
||||
})
|
||||
},
|
||||
|
||||
onLogout() {
|
||||
this.$confirm({
|
||||
title: '提示',
|
||||
@@ -64,6 +73,10 @@ export default {
|
||||
</div>
|
||||
<div class="user--dropdown" ref="dropdown" style={{ height: `${this.dropdownHeight}px` }}>
|
||||
<ul class="ant-dropdown-menu ant-dropdown-menu-vertical">
|
||||
<li class="ant-dropdown-menu-item" onClick={this.onAccountSetting}>
|
||||
<a-icon type="user" />
|
||||
个人中心
|
||||
</li>
|
||||
<li class="ant-dropdown-menu-item-divider"></li>
|
||||
<li class="ant-dropdown-menu-item" onClick={this.onLogout}>
|
||||
<a-icon type="logout" />
|
||||
|
||||
@@ -35,9 +35,7 @@ import Content from './_layout/content';
|
||||
|
||||
import Setting from './setting';
|
||||
|
||||
import { setGlobal } from '@/common/login';
|
||||
|
||||
import { EMPTY_ID } from '@/util/global';
|
||||
import { EMPTY_ID, setGlobal } from '@/util/global';
|
||||
|
||||
const getNewID = () => {
|
||||
return Math.random().toString(16).slice(2);
|
||||
|
||||
Reference in New Issue
Block a user