var S=Object.defineProperty,T=Object.defineProperties;var V=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable;var v=(o,t,e)=>t in o?S(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,B=(o,t)=>{for(var e in t||(t={}))I.call(t,e)&&v(o,e,t[e]);if(g)for(var e of g(t))L.call(t,e)&&v(o,e,t[e]);return o},_=(o,t)=>T(o,V(t));var w=(o,t,e)=>new Promise((i,m)=>{var c=s=>{try{p(e.next(s))}catch(n){m(n)}},a=s=>{try{p(e.throw(s))}catch(n){m(n)}},p=s=>s.done?i(s.value):Promise.resolve(s.value).then(c,a);p((e=e.apply(o,t)).next())});import{d as P,f as l,e as A,u as G,U,a2 as N,ad as j,af as q,k as x}from"./vue-vendor-CxLCUzY4.js";import{u as z,B as E}from"./index-BjHivc1K.js";import"./index-ByX9XNkE.js";import{b as H}from"./user.api-DAu0nuTv.js";import{t as J}from"./tenant.data-Byz3LKFo.js";import{s as K}from"./tenant.api-BupkcWMH.js";import{u as M,B as Q}from"./useForm-Dx3lJ3DG.js";import{_ as W}from"./index-CLZzJyTP.js";import"./antd-vue-vendor-CahNzUUa.js";import"./index-DvqyyN77.js";import"./index-DS3utcig.js";import"./index-BZbg0EjM.js";import"./index-CrdW4fN1.js";import"./useTimeout-KpZCXEcl.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./componentMap-DpsJvoqz.js";import"./useFormItem-IOFWTdED.js";import"./index-XZKTTfG1.js";import"./BasicModal-B8XmAOm7.js";import"./ModalHeader-DIFQSP_0.js";import"./useWindowSizeFn-D9PllI8g.js";import"./download-DopMSmFN.js";import"./base64Conver-24EVOS6V.js";import"./index-CDa2_aYE.js";import"./index-D0jTtUNS.js";import"./useCountdown-BpP55PQ2.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-CfAGgHjD.js";import"./props-BtZrRNiI.js";import"./JSelectBiz-CLnJTMe2.js";import"./JAddInput-B36c3B5x.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-C7yPiS0L.js";import"./index-44tRnyoF.js";import"./bem-DT3DdmOs.js";import"./props-CG-jAkbI.js";import"./useContextMenu-BGU2vdqV.js";import"./depart.api-DHG2p2Yd.js";import"./JImageUpload-BFwNYdm5.js";import"./JDictSelectTag-CfF54ALX.js";import"./JSelectDept-CaEHrQp6.js";import"./JPopup-BvqhHpPl.js";import"./JEllipsis-C_gT_vEQ.js";import"./JUpload-DgDEmizw.js";import"./index-Bn2zmO2L.js";import"./index-CEznvAVZ.js";import"./index-CfAukas3.js";import"./JAreaLinkage-M9TGy8nY.js";import"./JCodeEditor-CR57XeIe.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CWOTSpxK.js";import"./renderUtils-BgFeePLc.js";import"./validator-Dx9kcZ5e.js";const X=P({name:"TenantUserDrawer",components:{BasicDrawer:E,BasicForm:Q},emits:["success","register"],setup(o,{emit:t}){const e=l(""),i=l(!1),m=A(()=>i.value?"编辑人员":"添加人员"),[c,{setFieldsValue:a,resetFields:p,validate:s,setProps:n,clearValidate:C}]=M({schemas:J,showActionButtonGroup:!1,labelCol:{span:24},wrapperCol:{span:24}}),d=l(!0),[b,{closeDrawer:k,setDrawerProps:O}]=z(r=>w(this,null,function*(){var D;if(i.value=r.isUpdate,yield p(),d.value=(D=r==null?void 0:r.showFooter)!=null?D:!0,O({showFooter:d.value}),G(i)){const f=yield H({userId:r.record.id});let F="";f&&f.length>0&&(F=f.map(y=>y.value));let $=_(B({},r.record),{selecteddeparts:F,selectedroles:r.record.selectedroles});e.value=r.status,yield a($)}n({disabled:!(r!=null&&r.showFooter)}),r!=null&&r.showFooter||(yield C())})),u=l(!1);function R(){return w(this,null,function*(){const r=yield s();r.username||(r.username=r.phone),r.password="123456",u.value=!0,yield K(r,i.value),u.value=!1,t("success"),h()})}function h(){k()}return{isUpdate:i,title:m,registerForm:c,registerDrawer:b,handleSubmit:R,handleClose:h,status:e,confirmLoading:u}}});function Y(o,t,e,i,m,c){const a=U("BasicForm"),p=U("BasicDrawer");return N(),j(p,{onRegister:o.registerDrawer,title:o.title,width:580,destroyOnClose:"",onOk:o.handleSubmit},{default:q(()=>[x(a,{onRegister:o.registerForm},null,8,["onRegister"])]),_:1},8,["onRegister","title","onOk"])}const te=W(X,[["render",Y]]);export{te as default};
