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