import{B as N}from"./BasicForm-dL_oCSPM.js";import{u as S}from"./useForm-CKmgcynv.js";import{d as y,u as x,h as B,o as V,i as c,j as t,w as l,p as m,W as I,l as a,k as F,G as U,B as u,Z as s,v as C}from"./index-9PRMimni.js";import"./Render.vue_vue_type_script_lang-DKUYY0Zw.js";import"./SingleImageUpload-CNx4b9eC.js";import"./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";import"./componentSetting-DVhNDBTO.js";import"./ImageUpload-DUsnro3W.js";import"./vuedraggable.umd-Co2xEC3p.js";import"./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";import"./tabsView-BXskTdVh.js";import"./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";import"./propTypes-CebMRUpe.js";import"./BasicSelect-C_uwzMkE.js";import"./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";import"./dictionary-BRse4lkf.js";import"./index-DkvzUEqh.js";import"./index-kKnqLkWM.js";import"./AutoComplete-Dv1Bqed4.js";import"./TreeSelect-BZh2DeCh.js";import"./usePageCache-DluHn7Yy.js";const R={class:"n-layout-page-header"},w={class:"BasicForm"},T=y({__name:"useForm",setup(j){const d=[{field:"name",component:"NInput",label:"姓名",labelMessage:"这是一个提示",giProps:{span:1},componentProps:{placeholder:"请输入姓名",onInput:e=>{console.log(e)}},componentSlots:{suffix:({model:e})=>{let o="NInput的suffix插槽";return e.makeSource&&(o=e.makeSource===1?"网上":"门店"),s("span",o)}},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:{},componentSlots:{header:({model:e})=>s(u,{type:"primary",size:"small",onClick:()=>e.type=1},"选择第一项")},componentProps:{block:!0,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)}},componentSlots:{footer:()=>s("div","NDatePicker的footer插槽")}},{field:"makeTime",component:"NTimePicker",label:"停留时间",giProps:{},componentSlots:{icon:()=>s("div","12")},componentProps:{clearable:!0,onUpdateValue:e=>{console.log(e)}}},{field:"makeProject",component:"NCheckbox",label:"预约项目",giProps:{},componentProps:({formAction:e})=>{const{setFieldsValue:o}=e;return{placeholder:"请选择预约项目",options:[{label:"种牙",value:1},{label:"补牙",value:2},{label:"根管",value:3}],onUpdateValue:n=>{console.log(n),o({mobile:Number(n.join(""))})}}}},{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"}],r=x(),[g,{setSchema:_}]=S({gridProps:{cols:1},collapsedRows:3,labelWidth:120,layout:"horizontal",submitButtonText:"提交预约",schemas:d});function f(){_([{field:"name",component:"NInput",label:"姓名",labelMessage:"这是一个提示",giProps:{span:1},componentProps:{onInput:e=>{console.log(e)}},rules:[{required:!0,message:"请输入姓名",trigger:["blur"]}]}])}function b(e){e?(console.log(e),r.success(JSON.stringify(e))):r.error("验证失败，请填写完整信息")}function P(e){console.log(e)}return(e,o)=>{const n=I,h=F,k=U;return V(),B("div",null,[c("div",R,[t(n,{bordered:!1,title:"基础表单"},{default:l(()=>o[0]||(o[0]=[m(" useForm 表单，用于向用户收集表单信息 ")])),_:1})]),t(n,{bordered:!1,class:"mt-3 proCard"},{default:l(()=>[c("div",w,[t(a(N),{onRegister:a(g),onSubmit:b,onReset:P},{statusSlot:l(({model:p,field:i})=>[t(h,{value:p[i],"onUpdate:value":v=>p[i]=v},null,8,["value","onUpdate:value"])]),_:1},8,["onRegister"]),t(k),t(a(u),{strong:"",secondary:"",type:"tertiary",onClick:f,block:""},{default:l(()=>o[1]||(o[1]=[m("改变 Schemas")])),_:1})])]),_:1})])}}}),ne=C(T,[["__scopeId","data-v-8acaf365"]]);export{ne as default};
