import{d as j,P as W,r as o,x as Z,o as C,C as I,A as l,f as t,a as u,D as m,k as B,E as V,a2 as h,aw as T,V as $,H as q,K as G,cJ as L,e2 as O,W as Q,J as X,Z as Y,_ as ee,__tla as ae}from"./index-286756b9.js";import{_ as le,__tla as te}from"./Dialog-4c2de357.js";import{E as se,__tla as ue}from"./el-card-d3d5a654.js";import{d as de,h as oe}from"./tree-0af4953a.js";import{g as ne,__tla as re}from"./index-1b0f5c8b.js";import{b as ce,c as _e,__tla as me}from"./index-e67b1afd.js";import{u as ie,__tla as fe}from"./useMessage-084b1e70.js";let b,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()=>{b=ee(j({name:"SystemRoleAssignMenuForm",__name:"RoleAssignMenuForm",emits:["success"],setup(pe,{expose:w,emit:R}){const{t:A}=W(),F=ie(),n=o(!1),r=o(!1),s=Z({id:0,name:"",code:"",menuIds:[]}),v=o(),p=o([]),c=o(!1),d=o(),i=o(!1);w({open:async a=>{n.value=!0,D(),p.value=oe(await ne({categoryId:a.categoryId})),s.id=a.id,s.name=a.name,s.code=a.code,r.value=!0;try{s.value.menuIds=await ce(a.id),s.value.menuIds.forEach(e=>{d.value.setChecked(e,!0,!1)})}finally{r.value=!1}}});const M=R,z=async()=>{if(v&&await v.value.validate()){r.value=!0;try{const a={roleId:s.id,menuIds:[...d.value.getCheckedKeys(!1),...d.value.getHalfCheckedKeys()]};await _e(a),F.success(A("common.updateSuccess")),n.value=!1,M("success")}finally{r.value=!1}}},D=()=>{var a,e;i.value=!1,c.value=!1,s.value={id:0,name:"",code:"",menuIds:[]},(a=d.value)==null||a.setCheckedNodes([]),(e=v.value)==null||e.resetFields()},E=()=>{d.value.setCheckedNodes(i.value?p.value:[])},H=()=>{var e;const a=(e=d.value)==null?void 0:e.store.nodesMap;for(let f in a)a[f].expanded!==c.value&&(a[f].expanded=c.value)};return(a,e)=>{const f=T,y=$,x=q,K=G,g=L,U=O,J=se,N=Q,k=X,P=le,S=Y;return C(),I(P,{modelValue:u(n),"onUpdate:modelValue":e[3]||(e[3]=_=>h(n)?n.value=_:null),title:"\u83DC\u5355\u6743\u9650"},{footer:l(()=>[t(k,{disabled:u(r),type:"primary",onClick:z},{default:l(()=>[m("\u786E \u5B9A")]),_:1},8,["disabled"]),t(k,{onClick:e[2]||(e[2]=_=>n.value=!1)},{default:l(()=>[m("\u53D6 \u6D88")]),_:1})]),default:l(()=>[B((C(),I(N,{ref_key:"formRef",ref:v,model:u(s),"label-width":"80px"},{default:l(()=>[t(K,{gutter:30},{default:l(()=>[t(x,{span:"12"},{default:l(()=>[t(y,{label:"\u89D2\u8272\u540D\u79F0"},{default:l(()=>[t(f,null,{default:l(()=>[m(V(u(s).name),1)]),_:1})]),_:1})]),_:1}),t(x,{span:"12"},{default:l(()=>[t(y,{label:"\u89D2\u8272\u6807\u8BC6"},{default:l(()=>[t(f,null,{default:l(()=>[m(V(u(s).code),1)]),_:1})]),_:1})]),_:1})]),_:1}),t(y,{label:"\u83DC\u5355\u6743\u9650"},{default:l(()=>[t(J,{class:"cardHeight"},{header:l(()=>[m(" \u5168\u9009/\u5168\u4E0D\u9009: "),t(g,{modelValue:u(i),"onUpdate:modelValue":e[0]||(e[0]=_=>h(i)?i.value=_:null),"active-text":"\u662F","inactive-text":"\u5426","inline-prompt":"",onChange:E},null,8,["modelValue"]),m(" \u5168\u90E8\u5C55\u5F00/\u6298\u53E0: "),t(g,{modelValue:u(c),"onUpdate:modelValue":e[1]||(e[1]=_=>h(c)?c.value=_:null),"active-text":"\u5C55\u5F00","inactive-text":"\u6298\u53E0","inline-prompt":"",onChange:H},null,8,["modelValue"])]),default:l(()=>[t(U,{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"])),[[S,u(r)]])]),_:1},8,["modelValue"])}}}),[["__scopeId","data-v-4316139b"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/role/RoleAssignMenuForm.vue"]])});export{ve as __tla,b as default};