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.
 
 
 
 
 

58 lines
1.5 KiB

<template>
<div class="page system" style="padding: 0">
<div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a>
</div>
<staff v-if="active == 'staff'"></staff>
<pc-role v-if="active == 'pcRole'"></pc-role>
<mobile-role v-if="active == 'mobileRole'"></mobile-role>
</div>
</template>
<script>
import staff from "./staff";
import pcRole from "./pcRole";
import mobileRole from "./mobileRole";
export default {
data() {
return {
active: this.$route.query.type || 'staff',
tabs: {
staff: "账号管理",
pcRole: "pc角色权限",
mobileRole: "小程序角色权限"
}
};
},
components: {
staff,
pcRole,
mobileRole
},
created() {
// Setting.dynamicRoute && this.initTabs();
},
methods: {
tabChange(index) {
this.active = index
},
initTabs() {
const btns = this.$store.state.btns
const tab1 = btns.includes('/system:账号管理')
const tab2 = btns.includes('/system:角色权限')
tab1 || delete this.tabs.staff
const type = this.$route.query.type
const keys = Object.keys(this.tabs)
this.active = keys.includes(type) ? type : keys[0]
}
}
};
</script>
<style lang="scss" scoped>
.system {
min-height: calc(100vh - 170px);
}
</style>