<template>
    <el-row >
        <el-col :span="3" >
            <el-menu   @select="handleSelect" :router=isRoute>
                <el-menu-item v-for="item in getMenus "  :index=item.routeUrl>{{item.title}} </el-menu-item>
            </el-menu>
        </el-col>
        <el-col :span="13" id="dfs">
            <router-view></router-view>
        </el-col>
    </el-row>
</template>
<script>
    import {mapGetters, mapActions} from 'vuex'
    export default {
        data () {
            return {
                isRoute:true,
                netVariables:{
                    moduleNo:"SK.MANAGER.PRIV"
                },
                defaultProps: {
                    children: 'subMenus',
                    label: 'title'
                }
            }
        },
        created: function () {
        },
        mounted: function () {
            this.getSysMenus (this.netVariables).then((requestData) => {
                if(requestData!=null&&requestData.code=="1") {
                    this.$message("获取菜单错误！");
                }
                else {
                    this.$message("获取菜单成功！"+requestData.code);
                    this.$router.replace(requestData.routeUrl);
                }
            });

        },
        computed: {
            ...mapGetters(
                    ["getMenus","getRouteUrl"])
        },
        methods: {
            ...mapActions(
                    ["getSysMenus"]),
            handleSelect(key, keyPath) {
                console.log(key, keyPath);
            }

        }
    }
</script>
<style>
    /*#dfs{*/
        /*padding-bottom: 500px;*/
        /*background-color: #00ffff;*/
    /*}*/
    /*#sp{*/
        /*padding-left: 30px;*/
        /*background-color: #00ffff;*/
    /*}*/
</style>