parent
e83aac6942
commit
f538b92d38
7 changed files with 110 additions and 22 deletions
@ -0,0 +1,62 @@ |
||||
<template> |
||||
<div class="page" style="padding: 0"> |
||||
<div class="tabs"> |
||||
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{ active: i == active }" @click="tabChange(i)">{{ item |
||||
}}</a> |
||||
</div> |
||||
|
||||
<Student v-if="active == 'tab1'" /> |
||||
<ExpSystem v-else-if="active == 'tab2'" /> |
||||
<System v-if="active == 'tab3'" /> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { mapState } from 'vuex' |
||||
import Setting from '@/setting' |
||||
import Student from '@/pages/student/list' |
||||
import ExpSystem from '@/pages/expSystem/list' |
||||
import System from '@/pages/system/list' |
||||
export default { |
||||
components: { |
||||
Student, |
||||
ExpSystem, |
||||
System |
||||
}, |
||||
data () { |
||||
return { |
||||
active: 'tab1', |
||||
tabs: { |
||||
tab1: '学生管理', |
||||
tab2: '实验系统管理', |
||||
// tab3: '教师管理', |
||||
tab3: '系统设置', |
||||
} |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapState('auth', [ |
||||
'btns' |
||||
]) |
||||
}, |
||||
created () { |
||||
Setting.dynamicRoute && this.initTabs() |
||||
}, |
||||
methods: { |
||||
tabChange (index) { |
||||
this.active = index |
||||
}, |
||||
initTabs () { |
||||
const { btns } = this |
||||
const tab1 = btns.includes('/student/list') |
||||
const tab2 = btns.includes('/expSystem/list') |
||||
const tab3 = btns.includes('/system/list') |
||||
tab1 || delete this.tabs.staff |
||||
tab2 || delete this.tabs.role |
||||
tab3 || delete this.tabs.logo |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -0,0 +1,23 @@ |
||||
import BasicLayout from "@/layouts/home"; |
||||
|
||||
const meta = {}; |
||||
|
||||
const pre = "backend-"; |
||||
|
||||
export default { |
||||
path: "/backend", |
||||
name: "backend", |
||||
redirect: { |
||||
name: `${pre}list` |
||||
}, |
||||
meta, |
||||
component: BasicLayout, |
||||
children: [ |
||||
{ |
||||
name: `${pre}list`, |
||||
path: `list`, |
||||
component: () => import("@/pages/backend/list"), |
||||
meta: { title: "管理后台" } |
||||
} |
||||
] |
||||
}; |
Loading…
Reference in new issue