import{d as O,n as W,r as o,f as $,o as C,l as b,w as a,i as t,a as u,j as m,C as q,t as w,y as h,ak as D,H as Z,E as z,s as B,b$ as L,dW as Q,K as T,J as X,N as Y,_ as ee,__tla as ae}from"./index-2c56227b.js";import{_ as le,__tla as te}from"./Dialog-1050d437.js";import{E as se,__tla as ue}from"./el-card-9c148b4f.js";import{d as de,h as oe}from"./tree-0af4953a.js";import{g as ne,__tla as re}from"./index-645ae202.js";import{g as _e,a as ie,__tla as me}from"./index-09238600.js";import{u as ce,__tla as fe}from"./useMessage-96878a4a.js";let V,ve=Promise.all([(()=>{try{return ae}catch{}})(),(()=>{try{return te}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return fe}catch{}})()]).then(async()=>{V=ee(O({name:"SystemRoleAssignMenuForm",__name:"RoleAssignMenuForm",emits:["success"],setup(pe,{expose:I,emit:R}){const{t:A}=W(),E=ce(),n=o(!1),r=o(!1),s=$({id:0,name:"",code:"",menuIds:[]}),v=o(),p=o([]),_=o(!1),d=o(),c=o(!1);I({open:async l=>{n.value=!0,M(),p.value=oe(await ne()),s.id=l.id,s.name=l.name,s.code=l.code,r.value=!0;try{s.value.menuIds=await _e(l.id),s.value.menuIds.forEach(e=>{d.value.setChecked(e,!0,!1)})}finally{r.value=!1}}});const F=R,H=async()=>{if(v&&await v.value.validate()){r.value=!0;try{const l={roleId:s.id,menuIds:[...d.value.getCheckedKeys(!1),...d.value.getHalfCheckedKeys()]};await ie(l),E.success(A("common.updateSuccess")),n.value=!1,F("success")}finally{r.value=!1}}},M=()=>{var l,e;c.value=!1,_.value=!1,s.value={id:0,name:"",code:"",menuIds:[]},(l=d.value)==null||l.setCheckedNodes([]),(e=v.value)==null||e.resetFields()},K=()=>{d.value.setCheckedNodes(c.value?p.value:[])},N=()=>{var e;const l=(e=d.value)==null?void 0:e.store.nodesMap;for(let f in l)l[f].expanded!==_.value&&(l[f].expanded=_.value)};return(l,e)=>{const f=D,y=Z,k=z,U=B,g=L,j=Q,P=se,S=T,x=X,G=le,J=Y;return C(),b(G,{modelValue:u(n),"onUpdate:modelValue":e[3]||(e[3]=i=>h(n)?n.value=i:null),title:"\u83DC\u5355\u6743\u9650"},{footer:a(()=>[t(x,{disabled:u(r),type:"primary",onClick:H},{default:a(()=>[m("\u786E \u5B9A")]),_:1},8,["disabled"]),t(x,{onClick:e[2]||(e[2]=i=>n.value=!1)},{default:a(()=>[m("\u53D6 \u6D88")]),_:1})]),default:a(()=>[q((C(),b(S,{ref_key:"formRef",ref:v,model:u(s),"label-width":"80px"},{default:a(()=>[t(U,{gutter:30},{default:a(()=>[t(k,{span:"12"},{default:a(()=>[t(y,{label:"\u89D2\u8272\u540D\u79F0"},{default:a(()=>[t(f,null,{default:a(()=>[m(w(u(s).name),1)]),_:1})]),_:1})]),_:1}),t(k,{span:"12"},{default:a(()=>[t(y,{label:"\u89D2\u8272\u6807\u8BC6"},{default:a(()=>[t(f,null,{default:a(()=>[m(w(u(s).code),1)]),_:1})]),_:1})]),_:1})]),_:1}),t(y,{label:"\u83DC\u5355\u6743\u9650"},{default:a(()=>[t(P,{class:"cardHeight"},{header:a(()=>[m(" \u5168\u9009/\u5168\u4E0D\u9009: "),t(g,{modelValue:u(c),"onUpdate:modelValue":e[0]||(e[0]=i=>h(c)?c.value=i:null),"active-text":"\u662F","inactive-text":"\u5426","inline-prompt":"",onChange:K},null,8,["modelValue"]),m(" \u5168\u90E8\u5C55\u5F00/\u6298\u53E0: "),t(g,{modelValue:u(_),"onUpdate:modelValue":e[1]||(e[1]=i=>h(_)?_.value=i:null),"active-text":"\u5C55\u5F00","inactive-text":"\u6298\u53E0","inline-prompt":"",onChange:N},null,8,["modelValue"])]),default:a(()=>[t(j,{ref_key:"treeRef",ref:d,data:u(p),props:u(de),"empty-text":"\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u5019","node-key":"id","show-checkbox":""},null,8,["data","props"])]),_:1})]),_:1})]),_:1},8,["model"])),[[J,u(r)]])]),_:1},8,["modelValue"])}}}),[["__scopeId","data-v-4316139b"],["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/system/role/RoleAssignMenuForm.vue"]])});export{ve as __tla,V as default};
