import{B as V}from"./BasicForm-dL_oCSPM.js";import{u as T}from"./useForm-CKmgcynv.js";import{s as A}from"./schemas-CbDhWCxw.js";import{d as L,u as R,r,c as S,o as j,a7 as z,w as s,j as o,i as G,l as c,H,B as I,p as m,a8 as J,ac as M}from"./index-9PRMimni.js";const O={class:"mt-6"},E=L({__name:"CreateDrawer",props:{title:{type:String,default:"添加预约"},width:{type:Number,default:450},permissionList:{type:Array}},emits:["change"],setup(a,{expose:p,emit:f}){const _=f,d=R(),n=r(!1),g=r(!1),[w,{submit:h,getFieldsValue:y,setFieldsValue:k,resetFields:B}]=T({gridProps:{cols:1},layout:"horizontal",submitButtonText:"保存",showActionButtonGroup:!1,schemas:A});function b(e){if(e){e.makeDate=118313526e4,e.makeTime=118313326e4,e.type=1,e.mobile=18888888888,e.source="朋友介绍",x(e);return}n.value=!0}function i(){n.value=!1}async function v(){if(!await h())return;const t=y();d.success("提交成功："+JSON.stringify(t)),console.log("表单返回值：",t),_("change"),i()}function u(){B()}function x(e){n.value=!0,M(()=>{k(e)})}return p({openDrawer:b,closeDrawer:i}),(e,t)=>{const l=I,C=H,D=J,F=z;return j(),S(F,{show:n.value,"onUpdate:show":t[0]||(t[0]=N=>n.value=N),width:a.width,placement:"right","auto-focus":!1,onAfterLeave:u},{default:s(()=>[o(D,{title:a.title,closable:""},{footer:s(()=>[o(C,null,{default:s(()=>[o(l,{onClick:u},{default:s(()=>t[1]||(t[1]=[m("重置")])),_:1}),o(l,{type:"primary",loading:g.value,onClick:v},{default:s(()=>t[2]||(t[2]=[m("提交")])),_:1},8,["loading"])]),_:1})]),default:s(()=>[G("div",O,[o(c(V),{onRegister:c(w)},null,8,["onRegister"])])]),_:1},8,["title"])]),_:1},8,["show","width"])}}});export{E as _};
