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-CJ4Xt1FM.js";import"./index-BN26Feep.js";import{b as H}from"./user.api-CoaMxYm2.js";import{t as J}from"./tenant.data-BTTBgNSE.js";import{s as K}from"./tenant.api-C9mls3Ap.js";import{u as M,B as Q}from"./useForm-DfoT2G6J.js";import{_ as W}from"./index-Cy4uayzW.js";import"./antd-vue-vendor-CahNzUUa.js";import"./index-Bdn0r8CG.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useTimeout-gJpgadD6.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./componentMap-0iK4HQBq.js";import"./useFormItem-IOFWTdED.js";import"./index-zKZnG1QC.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./download-Bn4f3tzD.js";import"./base64Conver-24EVOS6V.js";import"./index-D6H6KsT6.js";import"./index-CLxBW_h0.js";import"./useCountdown-2P9HvnfJ.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-B98pRPrS.js";import"./props-CtlWAg-s.js";import"./JSelectBiz-vYDBA0SK.js";import"./JAddInput-DP4caUmw.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-tDBMxW9-.js";import"./index-CNQBnF3P.js";import"./bem-IZKqD41e.js";import"./props-CG-jAkbI.js";import"./useContextMenu-Q6J5bB_u.js";import"./depart.api-B8q8MC-j.js";import"./JImageUpload-C5OCTlCG.js";import"./JDictSelectTag-CalJXNVe.js";import"./JSelectDept-D-TUaHvK.js";import"./JPopup-CVHkQZFq.js";import"./JEllipsis-TuDc52fh.js";import"./JUpload-DSWoDwh2.js";import"./index-B4vNk56t.js";import"./index-Dc7Jr5-j.js";import"./index-Dm1rPBfc.js";import"./JAreaLinkage-CTMEfTuh.js";import"./JCodeEditor-U9QIstNN.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CZdChTcP.js";import"./renderUtils-BcsccCoe.js";import"./validator-CyHCj96y.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};
