zhangxiaoxu123
2022-07-15 37efa3e1a1a008f3c7312046c7826bb9a0a272b1
'菜单权限管理功能'
2个文件已修改
63 ■■■■■ 已修改文件
components/common/popup-menu/popup-menu.vue 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/jihua.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/common/popup-menu/popup-menu.vue
@@ -10,6 +10,7 @@
                   <image src="@/static/menuIcon/menu-home.png" slot="icon" size="32" name="search"/>
                </u-cell>
                <u-cell
                    v-if="shenqingMenu"
                    title="我的申请"
                    isLink
                    url="/pages/my-application/my-application"
@@ -31,6 +32,7 @@
                    <image src="@/static/menuIcon/menu-havedo.png" slot="icon" size="32" name="search"/>
                </u-cell>
                <u-cell
                   v-if="rijihuaMenu"
                    title="日发运计划"
                    isLink
                    url="/pages/jihua/jihua" style="color:blue"
@@ -61,16 +63,70 @@
    // },
    data() {
        return {
            menuShow:false
            menuShow:false,
            rijihuaMenu:false,
            shenqingMenu:false,
        };
    },
    onShow() {
        alert(111)
    },
    methods: {
        checkRijihua(data) {
            let labelArry = []
            let newObj = data.filter(e => e.label == '地销计量')
            newObj && newObj.forEach(e => {
                if(e.children.length > 0) {
                    e.children.forEach(item => {
                        labelArry.push(item.label)
                    })
                }else{
                    this.rijihuaMenu = false
                }
            })
            if(labelArry.indexOf('汽车日发运计划管理') > -1) {
                this.rijihuaMenu = true
            }else {
                this.rijihuaMenu = false
            }
        },
        checkShenqing(data) {
            let labelArry = []
            let newObj = data.filter(e => e.label == '工作审批')
            newObj && newObj.forEach(e => {
                if(e.children.length > 0) {
                    e.children.forEach(item => {
                        labelArry.push(item.label)
                    })
                }else{
                    this.shenqingMenu = false
                }
            })
            if(labelArry.indexOf('我的申请') > -1) {
                this.shenqingMenu = true
            }else {
                this.shenqingMenu = false
            }
        },
        menu() {
            // 权限判断
            this.$reqGet('menu').then(res => {
                if(res.data == null) {
                    this.rijihuaMenu = false
                    this.shenqingMenu = false
                }else {
                    this.checkRijihua(res.data)
                    this.checkShenqing(res.data)
                }
            })
        },
        menuClick(){
            this.menuShow = !this.menuShow
            this.$emit('menuShow',this.menuShow)
        },
        open() {
            console.log('open');
            this.menu()
        },
        close() {
            this.menuShow = false;
utils/jihua.js
@@ -23,4 +23,9 @@
        url: '/yunxiao/xscarshippingdayplan/setCarNums',
        method: 'POST'
    },
    // 菜单
    menu: {
        url: '/admin/menu',
        method: 'GET'
    }
}