var q=Object.defineProperty;var p=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var g=(o,s,e)=>s in o?q(o,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[s]=e,i=(o,s)=>{for(var e in s||(s={}))h.call(s,e)&&g(o,e,s[e]);if(p)for(var e of p(s))v.call(s,e)&&g(o,e,s[e]);return o};var w=(o,s)=>{var e={};for(var l in o)h.call(o,l)&&s.indexOf(l)<0&&(e[l]=o[l]);if(o!=null&&p)for(var l of p(o))s.indexOf(l)<0&&v.call(o,l)&&(e[l]=o[l]);return e};var f=(o,s,e)=>new Promise((l,c)=>{var u=r=>{try{n(e.next(r))}catch(m){c(m)}},d=r=>{try{n(e.throw(r))}catch(m){c(m)}},n=r=>r.done?l(r.value):Promise.resolve(r.value).then(u,d);n((e=e.apply(o,s)).next())});import{a as x,B as F}from"./index-8e6298d7.js";import{u as M,B as k}from"./useForm-8562f570.js";import{d as R,f as P,c as W,u as t,Z as H,a4 as L,a5 as X,k as Y,a9 as O}from"./vue-72a104e4.js";import{_ as S}from"./index.js";import"./antd-835b28bf.js";import"./useWindowSizeFn-7c45a656.js";import"./copyTextToClipboard-07d7f4c6.js";const U=R({__name:"modal",emits:["success","register"],setup(o,{emit:s}){const e=P(),l=P(!0),c=s,u=W(()=>t(l)?"编辑":"新增"),[d,{closeModal:n,setModalProps:r}]=x(a=>f(this,null,function*(){yield y(),r({confirmLoading:!1}),l.value=!!(a!=null&&a.isUpdate),e.value=a==null?void 0:a.record,yield C(i({},a.record))})),m=[{colProps:{span:24},field:"code",label:"预埋件编号",componentProps:{allowClear:!1,placeholder:"预埋件编号"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入预埋件编号！"}]},{colProps:{span:24},field:"type",label:"类型",componentProps:{allowClear:!1,placeholder:"类型"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入类型！"}]},{colProps:{span:24},field:"x",label:"X(mm)",componentProps:{allowClear:!1,placeholder:"X(mm)"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入X(mm)！"}]},{colProps:{span:24},field:"y",label:"Y(mm)",componentProps:{allowClear:!1,placeholder:"Y(mm)"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入Y(mm)！"}]},{colProps:{span:24},field:"w",label:"W(mm)",componentProps:{allowClear:!1,placeholder:"W(mm)"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入W(mm)！"}]},{colProps:{span:24},field:"h",label:"H(mm)",componentProps:{allowClear:!1,placeholder:"H(mm)"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入H(mm)！"}]}],[b,{resetFields:y,setFieldsValue:C,validate:I}]=M({labelWidth:90,schemas:m,showActionButtonGroup:!1});function V(){return f(this,null,function*(){try{const a=yield I();r({confirmLoading:!0});const _=w(a,[]);n();const B=Object.assign({},i(i({},t(e)),_));c("success",B)}catch(a){}finally{r({confirmLoading:!1})}})}return(a,_)=>(H(),L(t(F),O(a.$attrs,{onRegister:t(d),closable:!1,showFooter:"",title:u.value,width:"400px",onOk:V}),{default:X(()=>[Y(t(k),{onRegister:t(b)},null,8,["onRegister"])]),_:1},16,["onRegister","title"]))}});const D=S(U,[["__scopeId","data-v-df60aa36"]]);export{D as default};
