element 菜單

<template>
    <div class='front-home-page'>
        <div class="header">
            <span class="font-title">圖書菜單管理</span>
            <el-button type="text" @click="toHomePge"></el-button>
        </div>
    </div>
</template>
<script>
export default {
    data() {},
    created () {
        this.items = this.get_access_info()
        this.setUpUrl(this.$route.query.appId, '')
    },
    computed: {
        splicingUrl() {
            let _appId = this.$route.appId ? `?appId=${this.$route.query.appId}` : ''
            let _themeColor = this.$route.themeColor ? `?appId=${this.$route.query.themeColor}` : ''
            let path = _appId + _themeColor
            return this.$route.path = pathUrl.launchdetail ? path.documentInitialApprove + path : this.$route.path + path
        },
        ...mapActions({
            collapse: 'personal/collapse'
        })
    },
    methods: {
        ...mapGetters({
            'get_access_info':'permission/get_access_info'
        }),
        updataMenu(){
            this.$store.dispatch('permission/get_access_info').then(()=>{
                this.items = this.get_access_info()
                this.setUpUrl(this.$route.query.appId, '')
            }).catch(err=>{
                commonApi.isTimeOut(err,location)
            })
        },
        setUpUrl(appId,themeColor){
            if (appId) {
                let _themeColor = themeColor ? `&themeColor=${themeColor}`: ''
                for (let k = 0; k < this.items.length; k++) {
                    if (this.items[k].children.length) {
                        for(let i = 0; i < this.items[k].children.length; i++) {
                            if (this.items[k].children[i].children.length) {
                                for (let y = 0; y < this.items[k].children[i].children.length; y++) {
                                    if (this.items[k].children[i].children[y].children.length) {
                                        for(let yy = 0; yy < this.items[k].children[i].children[y].children.length; yy++) {
                                            this.items[k].children[i].children[y].children[yy].url = `${this.items[k].children[i].children[y].children[yy].url}?appId=${appId}${_themeColor}`
                                        }
                                    } else {
                                        this.items[k].children[i].children[y].url = `${this.items[k].children[i].children[y].url}?appId=${appId}${_themeColor}`
                                    }
                                }
                            } else {
                                this.items[k].children[i].url = `${this.items[k].children[i].url}?appId=${appId}${_themeColor}`
                            }
                        }
                    } else {
                        this.items[k].url = `${this.items[k].url}?appId=${appId}${_themeColor}`
                    }
                }
            }
        },
        toHomePge(){
            window.open(location.origin)
        },
        collpapseChange() {
            this.setCollapse(!this.collapse)
        },
        ...mapActions({
            setCollapse: 'personal/setCollapse'
        })
    },
    watch: {
        collapse() {
            this.$emit('collapseChange', this.collapse)
        }
    }
}
</script>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章