1 |
- import{d as A,X as S,J as q,r,k as z,v as B,a as s,o as c,q as y,w as t,f as l,c as C,n as E,F as H,Y as J,h as M,U as P,z as X,E as Y,i as G,x as K,y as L,C as N,H as O,__tla as Q}from"./index-2eab2d23.js";import{g as T,a as W,__tla as Z}from"./index-36e83085.js";import{g as $,__tla as aa}from"./index-7a06606e.js";import{u as ea,__tla as la}from"./useMessage-171aa63e.js";import{_ as sa}from"./_plugin-vue_export-helper-1b428a4d.js";let b,ta=Promise.all([(()=>{try{return Q}catch{}})(),(()=>{try{return Z}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return la}catch{}})()]).then(async()=>{b=sa(A({name:"SystemUserAssignRoleForm",__name:"UserAssignRoleForm",props:{isDetail:{type:Boolean,default:!1},obj:{default:void 0}},emits:["success"],setup(i,{expose:h,emit:ua}){const k=S(),w=q(()=>k.getMobile),{t:I}=M(),V=ea(),U=r(!1),n=r(!1),a=r({id:-1,nickname:"",username:"",roleIds:[]}),o=r(),f=r([]),g=i;z(()=>{(async e=>{U.value=!0,x(),a.value.id=e.id,a.value.username=e.username,a.value.nickname=e.nickname,n.value=!0;try{a.value.roleIds=await T(e.id)}finally{n.value=!1}f.value=await $()})(g.obj)}),h({submitForm:async()=>{const e=r(!1);if(o&&await o.value.validate()){n.value=!0;try{await W({userId:a.value.id,roleIds:a.value.roleIds}),V.success(I("common.updateSuccess")),e.value=!0}finally{n.value=!1}return e.value}}});const x=()=>{var e;a.value={id:-1,nickname:"",username:"",roleIds:[]},(e=o.value)==null||e.resetFields()};return(e,d)=>{const p=P,m=X,_=Y,v=G,F=K,D=L,j=N,R=O;return B((c(),y(j,{ref_key:"formRef",ref:o,model:s(a),"label-width":"120px",class:J({view:i.isDetail,"mobile-card":s(w)}),disabled:i.isDetail,style:{padding:"10px"}},{default:t(()=>[l(v,null,{default:t(()=>[l(_,{span:12},{default:t(()=>[l(m,{label:"\u7528\u6237\u540D\u79F0"},{default:t(()=>[l(p,{modelValue:s(a).username,"onUpdate:modelValue":d[0]||(d[0]=u=>s(a).username=u),disabled:!0},null,8,["modelValue"])]),_:1})]),_:1}),l(_,{span:12},{default:t(()=>[l(m,{label:"\u7528\u6237\u6635\u79F0"},{default:t(()=>[l(p,{modelValue:s(a).nickname,"onUpdate:modelValue":d[1]||(d[1]=u=>s(a).nickname=u),disabled:!0},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(v,null,{default:t(()=>[l(_,{span:24},{default:t(()=>[l(m,{label:"\u89D2\u8272"},{default:t(()=>[l(D,{style:{width:"150px"},modelValue:s(a).roleIds,"onUpdate:modelValue":d[2]||(d[2]=u=>s(a).roleIds=u),multiple:"",placeholder:"\u8BF7\u9009\u62E9\u89D2\u8272"},{default:t(()=>[(c(!0),C(H,null,E(s(f),u=>(c(),y(F,{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","class","disabled"])),[[R,s(n)]])}}}),[["__scopeId","data-v-fa7ad173"]])});export{ta as __tla,b as default};
|