35.da1b817fa53e774d5c01.js 2.0 KB

12
  1. webpackJsonp([35],{lfyr:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("c/Tr"),a=n.n(r),i=n("lHA8"),l=n.n(i),s=n("bUp0"),o=n("STSY"),c={name:"allocMenu",data:function(){return{menuTreeList:[],defaultProps:{children:"children",label:"title"},roleId:null}},created:function(){this.roleId=this.$route.query.roleId,this.treeList(),this.getRoleMenu(this.roleId)},methods:{treeList:function(){var e=this;Object(s.d)().then(function(t){e.menuTreeList=t.data})},getRoleMenu:function(e){var t=this;Object(o.g)(e).then(function(e){var n=e.data,r=[];if(null!=n&&n.length>0)for(var a=0;a<n.length;a++){var i=n[a];0!==i.parentId&&r.push(i.id)}t.$refs.tree.setCheckedKeys(r)})},handleSave:function(){var e=this,t=this.$refs.tree.getCheckedNodes(),n=new l.a;if(null!=t&&t.length>0)for(var r=0;r<t.length;r++){var i=t[r];n.add(i.id),0!==i.parentId&&n.add(i.parentId)}this.$confirm("是否分配菜单?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var t={menuIds:a()(n).join(","),roleId:e.roleId};Object(o.a)(t).then(function(t){e.$message({message:"分配成功",type:"success",duration:1e3}),e.$router.back()})})},handleClear:function(){this.$refs.tree.setCheckedKeys([])}}},d={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-card",{staticClass:"form-container",attrs:{shadow:"never"}},[n("el-tree",{ref:"tree",attrs:{data:e.menuTreeList,"show-checkbox":"","default-expand-all":"","node-key":"id","highlight-current":"",props:e.defaultProps}}),e._v(" "),n("div",{staticStyle:{"margin-top":"20px"},attrs:{align:"center"}},[n("el-button",{attrs:{type:"primary"},on:{click:function(t){e.handleSave()}}},[e._v("保存")]),e._v(" "),n("el-button",{on:{click:function(t){e.handleClear()}}},[e._v("清空")])],1)],1)},staticRenderFns:[]};var u=n("VU/8")(c,d,!1,function(e){n("tIY4")},"data-v-649b799d",null);t.default=u.exports},tIY4:function(e,t){}});
  2. //# sourceMappingURL=35.da1b817fa53e774d5c01.js.map