Merge pull request '2.5init' (#3) from lyc-dev into main

This commit is contained in:
lyc 2024-10-29 15:05:24 +08:00
commit c3c94132bf
1 changed files with 31 additions and 14 deletions

View File

@ -7,8 +7,11 @@
<el-image class="user-img" :src="dev_api + userStore.user.avatar" /> <el-image class="user-img" :src="dev_api + userStore.user.avatar" />
</template> </template>
<div class="head-aside"> <div class="head-aside">
<span>11</span> <ul>
<el-button type="primary" @click="logout">退出登录</el-button> <li @click="onUserTo('/profile')">个人中心</li>
<li @click="onUserTo('/class')">班级中心</li>
<li @click="logout">退出登录</li>
</ul>
</div> </div>
</el-popover> </el-popover>
</div> </div>
@ -50,6 +53,8 @@ const router = useRouter()
const currentRoute = ref('') const currentRoute = ref('')
const activeId = ref('/home') const activeId = ref('/home')
const headerMenus = [ const headerMenus = [
{ {
name: '教学大模型', name: '教学大模型',
@ -57,21 +62,15 @@ const headerMenus = [
icon: 'icon-shouye', icon: 'icon-shouye',
path: '/index' path: '/index'
}, },
{
name: '班级中心',
id: 2,
icon: 'icon-banji2',
path: '/class'
},
{ {
name: '教学工作台', name: '教学工作台',
id: 3, id: 2,
icon: 'icon-gongzuotai', icon: 'icon-gongzuotai',
path: '/home' path: '/home'
}, },
{ {
name: '资源中心', name: '资源中心',
id: 4, id: 3,
icon: 'icon-kechengziyuan1', icon: 'icon-kechengziyuan1',
path: '/resource' path: '/resource'
}, },
@ -80,19 +79,23 @@ const headerMenus = [
const sideBottomMenu = [ const sideBottomMenu = [
{ {
name: '设置', name: '设置',
id: 5, id: 4,
icon: 'icon-set', icon: 'icon-set',
path: '/setting' path: '/setting'
}, },
] ]
const clickMenu = ({ id, disabled, path }) => { const clickMenu = ({ id, disabled, path }) => {
if (disabled) return if (disabled) return
activeId.value = id activeId.value = id
router.push(path) router.push(path)
} }
const onUserTo = (path) =>{
router.push(path)
}
// //
watch( watch(
() => router.currentRoute.value, () => router.currentRoute.value,
@ -133,7 +136,8 @@ const logout = () => {
<style> <style>
.el-popover.popoverStyle{ .el-popover.popoverStyle{
min-width:120px min-width:120px;
padding: 0;
} }
.popoverStyle .head-aside{ .popoverStyle .head-aside{
width: 100%; width: 100%;
@ -141,6 +145,19 @@ const logout = () => {
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
ul{
width: 100%;
li{
width: 100%;
padding: 10px 0;
cursor: pointer;
text-align: center;
border-bottom: solid #d9dce2 1px;
&:hover{
background: #d9dce2;
}
}
}
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>