/*!
 *  build: vue-admin-beautiful 
 *  vue-admin-beautiful author: chuzhixin 1204505056@qq.com 
 *  vue-admin-beautiful QQ Group(QQ群): 972435319、1139183756 
 *  time: 2024-10-10 11:14:28
 */
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-64441951"],{"38ac":function(e,t,o){},"4ee8":function(e,t,o){"use strict";o("38ac")},"695d":function(e,t,o){"use strict";o.r(t);var n=o("f2bf");const a={class:"dialog-footer"};function r(e,t,o,r,l,d){const i=Object(n["resolveComponent"])("el-tree"),s=Object(n["resolveComponent"])("el-form-item"),c=Object(n["resolveComponent"])("el-form"),u=Object(n["resolveComponent"])("el-button"),f=Object(n["resolveComponent"])("el-dialog");return Object(n["openBlock"])(),Object(n["createBlock"])(f,{modelValue:l.dialogFormVisible,"onUpdate:modelValue":t[0]||(t[0]=e=>l.dialogFormVisible=e),title:e.title,width:"500px",onClose:d.close},{default:Object(n["withCtx"])(()=>[Object(n["createVNode"])(c,{ref:"form",model:l.form,rules:e.rules,"label-width":"80px"},{default:Object(n["withCtx"])(()=>[Object(n["createVNode"])(s,{label:"角色授权",prop:"menuIds"},{default:Object(n["withCtx"])(()=>[Object(n["createVNode"])(i,{ref:"tree","empty-text":"暂无数据","expand-on-click-node":!1,props:l.defaultProps,"default-checked-keys":l.node,"node-key":"value",data:l.parentData,"show-checkbox":"","default-expand-all":"",onCheck:d.currentChecked},null,8,["props","default-checked-keys","data","onCheck"])]),_:1})]),_:1},8,["model","rules"]),Object(n["createElementVNode"])("div",a,[Object(n["createVNode"])(u,{type:"primary",size:"small",onClick:d.save},{default:Object(n["withCtx"])(()=>t[1]||(t[1]=[Object(n["createTextVNode"])("确 定")])),_:1},8,["onClick"]),Object(n["createVNode"])(u,{size:"small",onClick:d.close},{default:Object(n["withCtx"])(()=>t[2]||(t[2]=[Object(n["createTextVNode"])("取 消")])),_:1},8,["onClick"])])]),_:1},8,["modelValue","title","onClose"])}o("14d9"),o("1e70"),o("79a4"),o("c1a1"),o("8b00"),o("a4e7"),o("1e5a"),o("72c3");var l=o("cc5e"),d=o("1f27"),i={name:"RoleGrant",data(){return{form:{roleId:"",menuIds:""},defaultProps:{id:"value",label:"label",children:"children"},node:[],menuIds:"",clearable:!0,parentData:[],dialogFormVisible:!1,parentIdData:[]}},created(){},methods:{async getParentData(){const{data:e}=await Object(d["getCustom"])();this.parentData=e},async getNodeData(){const{data:e}=await Object(l["getMenuIdsByRoleId"])({roleId:this.form.roleId});this.parentData.forEach((function(t){e.includes(t.value)&&e.splice(e.indexOf(t.value),1)})),this.$refs.tree.setCheckedKeys(e)},currentChecked(){const e=this.$refs.tree.getCheckedNodes(!1,!0),t=[];e.forEach(e=>{t.push(e.value,e.value)}),this.form.menuIds=Array.from(new Set(t))},roleGrant(e){this.title="角色授权",this.form=Object.assign({},e),this.form.roleId=e.id,this.dialogFormVisible=!0,this.getNodeData(),this.getParentData()},close(){this.$refs["form"].resetFields(),this.form=this.$options.data().form,this.dialogFormVisible=!1,this.$emit("fetch-data")},save(){this.$refs["form"].validate(async e=>{if(!e)return!1;{const{msg:e}=await Object(l["assignMenu"])({menuIds:this.form.menuIds,roleId:this.form.roleId});this.$notify({title:e,type:"success"}),this.dialogFormVisible=!1}})}}},s=(o("4ee8"),o("d959")),c=o.n(s);const u=c()(i,[["render",r]]);t["default"]=u},cc5e:function(e,t,o){"use strict";o.r(t),o.d(t,"getList",(function(){return a})),o.d(t,"doEdit",(function(){return r})),o.d(t,"doDelete",(function(){return l})),o.d(t,"doAdd",(function(){return d})),o.d(t,"getMenuIdsByRoleId",(function(){return i})),o.d(t,"assignMenu",(function(){return s})),o.d(t,"miniRoleSelect",(function(){return c})),o.d(t,"miniRoleInsert",(function(){return u})),o.d(t,"miniRoleUpdate",(function(){return f})),o.d(t,"miniRoleRemove",(function(){return m})),o.d(t,"miniRoleAssignMenu",(function(){return h})),o.d(t,"getMiniRoleMenuIdsByRoleId",(function(){return b}));var n=o("b775");function a(e){let t="?page="+e.page+"&size="+e.size;return e.name&&(t+="&name="+e.name),Object(n["default"])({url:"/sysRole/select"+t,method:"get",data:e})}function r(e){return Object(n["default"])({url:"/sysRole/update",method:"post",data:e})}function l(e){return Object(n["default"])({url:"/sysRole/remove",method:"post",data:e})}function d(e){return Object(n["default"])({url:"/sysRole/insert",method:"post",data:e})}function i(e){return Object(n["default"])({url:"/sysRole/getMenuIdsByRoleId?roleId="+e.roleId,method:"get",data:e})}function s(e){return Object(n["default"])({url:"/sysRole/assignMenu",method:"post",data:e})}function c(e){let t="?page="+e.page+"&size="+e.size;return void 0!=e.name&&(t+="&name="+e.name),Object(n["default"])({url:"/miniRole/select"+t,method:"get",data:e})}function u(e){return Object(n["default"])({url:"/miniRole/insert",method:"post",data:e})}function f(e){return Object(n["default"])({url:"/miniRole/update",method:"post",data:e})}function m(e){return Object(n["default"])({url:"/miniRole/remove?roleId="+e.roleId,method:"post",data:e})}function h(e){return Object(n["default"])({url:"/miniRole/assignMenu",method:"post",data:e})}function b(e){return Object(n["default"])({url:"/miniRole/getMenuIdsByRoleId?roleId="+e.roleId,method:"get",data:e})}}}]);