import{d as V,r as u,a4 as P,a as S,l as c,u as y,c as B,o as x,w as t,j as n,W as F,i as w,H as C,B as I,p,X as M,v as R}from"./index-9PRMimni.js";import{B as U}from"./BasicForm-dL_oCSPM.js";import{u as T}from"./useVerificate-D9xvUzmi.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";const q={class:"BasicForm"},j=V({__name:"basic",setup(D){const a=u(),l=u(!0),{isMobile:m}=T(),d=P(()=>l.value),s=S([{field:"id",defaultValue:128,hidden:!0},{field:"identity",defaultValue:"我是一个隐藏字段内容",hidden:!0},{field:"info.name",component:"NInput",label:"姓名",labelMessage:"这是一个提示",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)}},rules:[{key:"mobile",required:!0,validator:m,trigger:["input","blur"]}]},{field:"type",component:"NSelect",label:"类型",componentProps:{placeholder:"请选择类型",options:[{label:"舒适性",value:1},{label:"经济性",value:2}],onUpdateValue:e=>{console.log(e)}}},{field:"makeDate",component:"NDatePicker",label:"预约时间",defaultValue:118313526e4,componentProps:{type:"date",onUpdateValue:e=>{console.log(e)}},hidden:({model:e})=>!e.type,rules:[{required:!0,type:"number",message:"请选择预约时间",trigger:["change"]}]},{field:"makeTime",component:"NTimePicker",label:"停留时间",componentProps:{onUpdateValue:e=>{console.log(e)}}},{field:"makeProject",component:"NCheckbox",label:"预约项目",componentProps:{placeholder:"请选择预约项目",options:[{label:"种牙",value:1},{label:"补牙",value:2},{label:"根管",value:3}],onUpdateValue:e=>{l.value=e.includes(3),a.value.setSchema(b())}}},{field:"makeSource",component:"NRadioGroup",label:"来源",hidden:d.value,componentProps:{options:[{label:"网上",value:1},{label:"门店",value:2}],onUpdateValue:e=>{console.log(e)}}}]);function f(){a.value.setFieldsValue({"info.name":"我是啊俊"})}function _(){a.value.validate(["mobile"])}function b(){const e=c(s);return e.forEach(o=>{o.field==="makeSource"&&(o.hidden=!l.value)}),e}const r=y();function g(e){r.success(JSON.stringify(e))}function h(e){r.success(JSON.stringify(e))}return(e,o)=>{const v=F,i=I,k=C,N=M;return x(),B(N,{title:"基础表单",content:"基础表单，用于向用户收集表单信息，并展示业务逻辑交互使用示例",showFooter:""},{leftFooter:t(()=>[n(k,null,{default:t(()=>[n(i,{onClick:_},{default:t(()=>o[0]||(o[0]=[p("只验证手机号码")])),_:1}),n(i,{onClick:f},{default:t(()=>o[1]||(o[1]=[p("设置姓名")])),_:1})]),_:1})]),default:t(()=>[n(v,{bordered:!1,class:"mt-3 proCard"},{default:t(()=>[w("div",q,[n(c(U),{ref_key:"basicFormRef",ref:a,submitButtonText:"提交预约",layout:"horizontal",gridProps:{cols:1},schemas:s,onSubmit:g,onReset:h},null,8,["schemas"])])]),_:1})]),_:1})}}}),le=R(j,[["__scopeId","data-v-803df997"]]);export{le as default};
