import{d as G,n as H,r as o,o as i,l as c,w as l,i as s,a as t,j as k,C as S,c as z,F as E,k as J,y as K,U as N,H as P,E as X,s as q,D as B,G as L,K as M,J as O,N as Q,_ as T,__tla as W}from"./index-b2b3c6c4.js";import{_ as Y,__tla as Z}from"./Dialog-70b24cbf.js";import{c as $,d as ee,__tla as ae}from"./index-f119fff1.js";import{g as le,__tla as se}from"./index-b9a0b231.js";import{u as te,__tla as ue}from"./useMessage-a5edbb0f.js";let V,re=Promise.all([(()=>{try{return W}catch{}})(),(()=>{try{return Z}catch{}})(),(()=>{try{return ae}catch{}})(),(()=>{try{return se}catch{}})(),(()=>{try{return ue}catch{}})()]).then(async()=>{V=T(G({name:"SystemUserAssignRoleForm",__name:"UserAssignRoleForm",emits:["success"],setup(de,{expose:b,emit:h}){const{t:I}=H(),w=te(),d=o(!1),n=o(!1),e=o({id:-1,nickname:"",username:"",roleIds:[]}),m=o(),f=o([]);b({open:async r=>{d.value=!0,F(),e.value.id=r.id,e.value.username=r.username,e.value.nickname=r.nickname,n.value=!0;try{e.value.roleIds=await $(r.id)}finally{n.value=!1}f.value=await le()}});const U=h,g=async()=>{if(m&&await m.value.validate()){n.value=!0;try{await ee({userId:e.value.id,roleIds:e.value.roleIds}),w.success(I("common.updateSuccess")),d.value=!1,U("success",!0)}finally{n.value=!1}}},F=()=>{var r;e.value={id:-1,nickname:"",username:"",roleIds:[]},(r=m.value)==null||r.resetFields()};return(r,u)=>{const p=N,_=P,v=X,R=q,x=B,A=L,C=M,y=O,j=Y,D=Q;return i(),c(j,{modelValue:t(d),"onUpdate:modelValue":u[4]||(u[4]=a=>K(d)?d.value=a:null),title:"\u5206\u914D\u89D2\u8272"},{footer:l(()=>[s(y,{disabled:t(n),type:"primary",onClick:g},{default:l(()=>[k("\u786E \u5B9A")]),_:1},8,["disabled"]),s(y,{onClick:u[3]||(u[3]=a=>d.value=!1)},{default:l(()=>[k("\u53D6 \u6D88")]),_:1})]),default:l(()=>[S((i(),c(C,{ref_key:"formRef",ref:m,model:t(e),"label-width":"80px"},{default:l(()=>[s(R,{gutter:30},{default:l(()=>[s(v,{span:"12"},{default:l(()=>[s(_,{label:"\u7528\u6237\u540D\u79F0"},{default:l(()=>[s(p,{modelValue:t(e).username,"onUpdate:modelValue":u[0]||(u[0]=a=>t(e).username=a),disabled:!0},null,8,["modelValue"])]),_:1})]),_:1}),s(v,{span:"12"},{default:l(()=>[s(_,{label:"\u7528\u6237\u6635\u79F0"},{default:l(()=>[s(p,{modelValue:t(e).nickname,"onUpdate:modelValue":u[1]||(u[1]=a=>t(e).nickname=a),disabled:!0},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),s(_,{label:"\u89D2\u8272"},{default:l(()=>[s(A,{style:{width:"150px"},modelValue:t(e).roleIds,"onUpdate:modelValue":u[2]||(u[2]=a=>t(e).roleIds=a),multiple:"",placeholder:"\u8BF7\u9009\u62E9\u89D2\u8272"},{default:l(()=>[(i(!0),z(E,null,J(t(f),a=>(i(),c(x,{key:a.id,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])),[[D,t(n)]])]),_:1},8,["modelValue"])}}}),[["__scopeId","data-v-dc251bc8"],["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/system/user/UserAssignRoleForm.vue"]])});export{re as __tla,V as default};
