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