import{B as U}from"./BasicForm-dL_oCSPM.js";import{u as x}from"./useForm-CKmgcynv.js";import{d as y,r as p,u as D,c as C,o as S,a7 as I,w as o,j as n,i as T,l as m,k as F,H as j,B as G,p as d,a8 as M}from"./index-9PRMimni.js";const q={class:"mt-6"},E=y({__name:"Drawer",setup(z,{expose:_}){const f=p(null),a=p(!1),t=p(!1),u=D(),g=[{field:"name",component:"NInput",label:"姓名",labelMessage:"这是一个提示",giProps:{span:1},componentProps:{placeholder:"请输入姓名",onInput:e=>{console.log(e)}},rules:[{required:!0,message:"请输入姓名",trigger:["blur"]}]},{field:"mobile",component:"NInputNumber",label:"手机",componentProps:{placeholder:"请输入手机号码",showButton:!1,onInput:e=>{console.log(e)}}},{field:"type",component:"NSelect",label:"类型",giProps:{},componentProps:{placeholder:"请选择类型",options:[{label:"舒适性",value:1},{label:"经济性",value:2}],onUpdateValue:e=>{console.log(e)}}},{field:"makeDate",component:"NDatePicker",label:"预约时间",giProps:{},defaultValue:118313526e4,componentProps:{type:"date",onUpdateValue:e=>{console.log(e)}}},{field:"makeTime",component:"NTimePicker",label:"停留时间",giProps:{},componentProps:{clearable:!0,onUpdateValue:e=>{console.log(e)}}},{field:"makeProject",component:"NCheckbox",label:"预约项目",giProps:{},componentProps:{placeholder:"请选择预约项目",options:[{label:"种牙",value:1},{label:"补牙",value:2},{label:"根管",value:3}],onUpdateValue:e=>{console.log(e)}}},{field:"makeSource",component:"NRadioGroup",label:"来源",giProps:{},componentProps:{options:[{label:"网上",value:1},{label:"门店",value:2}],onUpdateValue:e=>{console.log(e)}}},{field:"status",label:"状态",giProps:{},slot:"statusSlot"}],[b,{submit:v,getFieldsValue:w}]=x({gridProps:{cols:1},collapsedRows:3,layout:"horizontal",submitButtonText:"提交预约",showActionButtonGroup:!1,schemas:g});function P(){a.value=!0}function r(){a.value=!1}async function k(){t.value=!0,await v()?(console.log("formValues",w()),t.value=!1,r(),u.success("提交成功")):(t.value=!1,u.error("验证失败，请填写完整信息"))}return _({openDrawer:P,closeDrawer:r}),(e,l)=>{const h=F,c=G,N=j,V=M,B=I;return S(),C(B,{ref_key:"drawerRef",ref:f,show:a.value,"onUpdate:show":l[0]||(l[0]=s=>a.value=s),width:450,placement:"right"},{default:o(()=>[n(V,{title:"添加预约",closable:""},{footer:o(()=>[n(N,null,{default:o(()=>[n(c,{onClick:r},{default:o(()=>l[1]||(l[1]=[d("取消")])),_:1}),n(c,{type:"primary",loading:t.value,onClick:k},{default:o(()=>l[2]||(l[2]=[d("提交预约")])),_:1},8,["loading"])]),_:1})]),default:o(()=>[T("div",q,[n(m(U),{onRegister:m(b)},{statusSlot:o(({model:s,field:i})=>[n(h,{value:s[i],"onUpdate:value":R=>s[i]=R},null,8,["value","onUpdate:value"])]),_:1},8,["onRegister"])])]),_:1})]),_:1},8,["show"])}}});export{E as _};
