import{d as P,n as j,r as i,f as A,o as n,l as p,w as r,i as s,a as e,j as v,C as G,c as I,F as J,k as K,t as N,y as O,U as T,H as X,ag as Y,ah as z,I as B,K as L,J as Q,N as W,_ as Z,__tla as $}from"./index-2c56227b.js";import{_ as ee,__tla as ae}from"./Dialog-1050d437.js";import{_ as le,__tla as te}from"./Editor-d05caa83.js";import{a as re,D as se,__tla as ue}from"./dict-763dd292.js";import{g as oe,c as de,u as ie,__tla as me}from"./index-e52e4373.js";import{u as ne,__tla as _e}from"./useMessage-96878a4a.js";let g,ce=Promise.all([(()=>{try{return $}catch{}})(),(()=>{try{return ae}catch{}})(),(()=>{try{return te}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return _e}catch{}})()]).then(async()=>{g=Z(P({__name:"Demo03StudentForm",emits:["success"],setup(pe,{expose:V,emit:x}){const{t:_}=j(),f=ne(),o=i(!1),y=i(""),d=i(!1),b=i(""),t=i({id:void 0,name:void 0,sex:void 0,birthday:void 0,description:void 0}),S=A({name:[{required:!0,message:"\u540D\u5B57\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],sex:[{required:!0,message:"\u6027\u522B\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],birthday:[{required:!0,message:"\u51FA\u751F\u65E5\u671F\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],description:[{required:!0,message:"\u7B80\u4ECB\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),c=i();V({open:async(u,a)=>{if(o.value=!0,y.value=_("action."+u),b.value=u,k(),a){d.value=!0;try{t.value=await oe(a)}finally{d.value=!1}}}});const w=x,U=async()=>{await c.value.validate(),d.value=!0;try{const u=t.value;b.value==="create"?(await de(u),f.success(_("common.createSuccess"))):(await ie(u),f.success(_("common.updateSuccess"))),o.value=!1,w("success")}finally{d.value=!1}},k=()=>{var u;t.value={id:void 0,name:void 0,sex:void 0,birthday:void 0,description:void 0},(u=c.value)==null||u.resetFields()};return(u,a)=>{const q=T,m=X,F=Y,C=z,D=B,E=le,H=L,h=Q,R=ee,M=W;return n(),p(R,{title:e(y),modelValue:e(o),"onUpdate:modelValue":a[5]||(a[5]=l=>O(o)?o.value=l:null)},{footer:r(()=>[s(h,{onClick:U,type:"primary",disabled:e(d)},{default:r(()=>[v("\u786E \u5B9A")]),_:1},8,["disabled"]),s(h,{onClick:a[4]||(a[4]=l=>o.value=!1)},{default:r(()=>[v("\u53D6 \u6D88")]),_:1})]),default:r(()=>[G((n(),p(H,{ref_key:"formRef",ref:c,model:e(t),rules:e(S),"label-width":"100px"},{default:r(()=>[s(m,{label:"\u540D\u5B57",prop:"name"},{default:r(()=>[s(q,{modelValue:e(t).name,"onUpdate:modelValue":a[0]||(a[0]=l=>e(t).name=l),placeholder:"\u8BF7\u8F93\u5165\u540D\u5B57"},null,8,["modelValue"])]),_:1}),s(m,{label:"\u6027\u522B",prop:"sex"},{default:r(()=>[s(C,{modelValue:e(t).sex,"onUpdate:modelValue":a[1]||(a[1]=l=>e(t).sex=l)},{default:r(()=>[(n(!0),I(J,null,K(e(re)(e(se).SYSTEM_USER_SEX),l=>(n(),p(F,{key:l.value,label:l.value},{default:r(()=>[v(N(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),s(m,{label:"\u51FA\u751F\u65E5\u671F",prop:"birthday"},{default:r(()=>[s(D,{modelValue:e(t).birthday,"onUpdate:modelValue":a[2]||(a[2]=l=>e(t).birthday=l),type:"date","value-format":"x",placeholder:"\u9009\u62E9\u51FA\u751F\u65E5\u671F"},null,8,["modelValue"])]),_:1}),s(m,{label:"\u7B80\u4ECB",prop:"description"},{default:r(()=>[s(E,{modelValue:e(t).description,"onUpdate:modelValue":a[3]||(a[3]=l=>e(t).description=l),height:"150px"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[M,e(d)]])]),_:1},8,["title","modelValue"])}}}),[["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/infra/demo/demo03/erp/Demo03StudentForm.vue"]])});export{ce as __tla,g as default};
