var Y=Object.defineProperty,j=Object.defineProperties;var L=Object.getOwnPropertyDescriptors;var u=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var g=(s,r,e)=>r in s?Y(s,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[r]=e,f=(s,r)=>{for(var e in r||(r={}))h.call(r,e)&&g(s,e,r[e]);if(u)for(var e of u(r))v.call(r,e)&&g(s,e,r[e]);return s},D=(s,r)=>j(s,L(r));var y=(s,r)=>{var e={};for(var t in s)h.call(s,t)&&r.indexOf(t)<0&&(e[t]=s[t]);if(s!=null&&u)for(var t of u(s))r.indexOf(t)<0&&v.call(s,t)&&(e[t]=s[t]);return e};var w=(s,r,e)=>new Promise((t,n)=>{var p=a=>{try{c(e.next(a))}catch(m){n(m)}},l=a=>{try{c(e.throw(a))}catch(m){n(m)}},c=a=>a.done?t(a.value):Promise.resolve(a.value).then(p,l);c((e=e.apply(s,r)).next())});import{u as C,B as H}from"./useForm-322569b9.js";import{f as I,b as M,u as O}from"./schema-fbe47475.js";import{a as P,B as S}from"./index-922f0b14.js";import{j as T}from"./antd-fb8ca017.js";import{d as U,f as B,c as V,u as i,Z as A,a4 as E,a5 as G,k as N,a9 as W}from"./vue-08ef39cb.js";import{_ as Z}from"./index.js";import"./index-9a268806.js";import"./useWindowSizeFn-40274562.js";import"./copyTextToClipboard-bf4926ca.js";import"./regionApi-ad45a6bd.js";const $=U({__name:"drawer",emits:["success","register"],setup(s,{emit:r}){const e=r,t=B(!0),n=B(),[p,{resetFields:l,setFieldsValue:c,validate:a}]=C({labelWidth:120,schemas:I,showActionButtonGroup:!1}),[m,{setDrawerProps:d,closeDrawer:F}]=P(o=>w(this,null,function*(){yield l(),d({confirmLoading:!1}),t.value=!!(o!=null&&o.isUpdate),n.value=o==null?void 0:o.record,i(t)&&(yield c(f({},o.record)))})),x=V(()=>i(t)?"编辑":"新增");function b(){return w(this,null,function*(){try{const o=yield a();d({confirmLoading:!0});const _=y(o,[]),k=i(t)?O:M,R=i(t)?Object.assign({},D(f(f({},i(n)),_),{updateTime:T().format("YYYY-MM-DD HH:mm:ss")})):f({},_);yield k(R),F(),e("success")}finally{d({confirmLoading:!1})}})}return(o,_)=>(A(),E(i(S),W(o.$attrs,{onRegister:i(m),showFooter:"",title:x.value,width:"600px",onOk:b}),{default:G(()=>[N(i(H),{onRegister:i(p),name:"EditForm"},null,8,["onRegister"])]),_:1},16,["onRegister","title"]))}});const ae=Z($,[["__scopeId","data-v-95439ffe"]]);export{ae as default};