123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <template>
- <div class="box" :class="{mini: isMini}">
- <div class="list d-flex flex-column">
- <div style="flex: 1; height: 0; overflow: auto;">
- <v-list color="rgba(0,0,0,0)" subheader>
- <slot></slot>
- <side-list :items="list" :mini-menu="isMini" />
- </v-list>
- </div>
- <!-- <div class="list-bottom white">
- <v-divider></v-divider>
- <div class="pa-3">
- <div class="d-flex mb-1">
- <div class="list-bottom-label mr-3">今日访问</div>
- <div>{{ dayTotal }}</div>
- </div>
- <div class="d-flex">
- <div class="list-bottom-label mr-3">总访问量</div>
- <div>{{ total }}</div>
- </div>
- </div>
- </div> -->
- </div>
- <!-- <div class="tools"> -->
- <!-- 判断是否有权限 -->
- <!-- <v-btn depressed color="blue-grey" class="white--text">
- <v-icon
- left
- dark
- >
- mdi-cog
- </v-icon>
- 菜单设置
- </v-btn> -->
- <!-- </div> -->
- </div>
- </template>
- <script>
- import SideList from '@/components/Side/sideList.vue'
- import { mapGetters } from 'vuex'
- // import { getBurialPointStatistics } from '@/api/system'
- export default {
- name: 'side-index',
- components: { SideList },
- props: {
- isMini: {
- type: Boolean,
- default: false
- }
- },
- data () {
- return {
- active: false,
- dayTotal: 0,
- total: 0
- }
- },
- computed: {
- ...mapGetters(['roles']),
- list () {
- return this.getList(this.roles)
- }
- },
- // created () {
- // this.handleGetBurialPointStatistics()
- // },
- methods: {
- getList (arr, obj = []) {
- arr.sort((a, b) => a - b).forEach(element => {
- if (element.hidden) return
- const data = {}
- data.title = element.meta.title
- data.target = element.meta.target
- data.enName = element.enName
- data.name = element.name
- data.path = element.path
- data.icon = element.icon
- data.active = false
- data.children = []
- if (element?.children) {
- this.getList(element.children, data.children)
- }
- obj.push(data)
- })
- return obj
- }
- // async handleGetBurialPointStatistics () {
- // try {
- // const { data } = await getBurialPointStatistics()
- // this.dayTotal = data.dayTotal ?? 0
- // this.total = data.total ?? 0
- // } catch (error) {
- // this.$snackbar.error(error)
- // }
- // }
- }
- }
- </script>
- <style lang="scss" scoped>
- .box {
- width: 230px;
- &.mini {
- width: 60px;
- }
- .card {
- // background: var(--v-info-lighten2);
- display: flex;
- flex-direction: column;
- }
- .list {
- height: 100%;
- &-bottom {
- // position: sticky;
- // bottom: 0;
- }
- }
- .tools {
- width: 100%;
- height: 60px;
- // position: absolute;
- display: flex;
- align-items: center;
- padding: 10px;
- box-sizing: border-box;
- }
- }
- </style>
|