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