webpackJsonp([33],{"6Kt+":function(e,t){},fils:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("Dd8w"),s=n.n(r),u={name:"SysMenu",props:{menu:{type:Object,required:!0}},data:function(){return{}},methods:{click:function(e){console.log(e)}},computed:{isLeaf:function(){return!(this.menu.children instanceof Array)}}},a={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isLeaf?n("el-menu-item",{attrs:{index:e.menu.id,route:{path:e.menu.extra.href}}},[e._v("\n    "+e._s(e.menu.label)+"\n")]):n("el-submenu",{attrs:{index:e.menu.id}},[n("template",{slot:"title"},[e.menu.extra.icon?n("i",{staticClass:"fa-fw",class:e.menu.extra.icon}):e._e(),e._v("\n        "+e._s(e.menu.label)+"\n    ")]),e._v(" "),e._l(e.menu.children,function(e){return n("sys-menu",{key:e.id,attrs:{menu:e}})})],2)},staticRenderFns:[]},i=n("VU/8")(u,a,!1,null,null,null).exports,o=n("NYxO"),c={name:"App",created:function(){this.getMenus()},data:function(){return{rawMenus:[],menus:[],activeMenu:""}},computed:s()({},Object(o.b)(["userInfo"])),methods:{findActiveMenu:function(){var e=this,t=this.$route.path,n=function n(r){r.forEach(function(r){r.extra.href===t?e.activeMenu=r.id:r.children&&n(r.children)})};n(this.rawMenus)},getMenus:function(){var e=this;this.$http.get({url:"/sysMenu/userMenuTree",data:{userId:this.userInfo.id}}).then(function(t){if(t.success){e.rawMenus=t.data,e.menus=function e(t){return t.sort(function(e,t){return e.extra.sort-t.extra.sort}),t.map(function(t){var n={id:t.id,label:t.name,parentId:t.parentId,extra:t.extra};return t.children instanceof Array&&(n.children=e(t.children)),n})}(t.data),e.findActiveMenu()}})},onCommand:function(e){var t=this;"logout"===e&&this.$http.post({url:"/userInfo/logout"}).then(function(e){e.success&&(t.$store.commit("updateUserInfo",null),t.$router.replace("/login"))})}},watch:{$route:function(){this.findActiveMenu(this.rawMenus)}},components:{SysMenu:i}},d={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-container",{attrs:{id:"app"}},[n("el-header",{staticClass:"header"},[n("div",{staticStyle:{"flex-grow":"1"}},[e._v("享居屋的后台管理")]),e._v(" "),n("el-dropdown",{on:{command:e.onCommand}},[n("img",{staticClass:"avatar",attrs:{src:e.userInfo&&e.userInfo.icon||""}}),e._v(" "),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("el-dropdown-item",{attrs:{command:"logout"}},[e._v("退出登录")])],1)],1)],1),e._v(" "),n("el-container",[n("el-aside",{staticClass:"aside",attrs:{width:"200px"}},[n("el-menu",{staticStyle:{"border-right":"1px solid #545c64"},attrs:{"background-color":"#324157","text-color":"#BFCBD9","active-text-color":"#20A0FF","unique-opened":!0,router:!0,"default-active":e.activeMenu}},e._l(e.menus,function(e){return n("sys-menu",{key:e.id,attrs:{menu:e}})}))],1),e._v(" "),n("el-main",[n("router-view")],1)],1)],1)},staticRenderFns:[]};var l=n("VU/8")(c,d,!1,function(e){n("6Kt+")},"data-v-6edbad56",null);t.default=l.exports}});
//# sourceMappingURL=33.40f8849e955dedc6bbad.js.map