1 |
- import{d as X,n as j,r as i,f as z,o as n,l as p,w as s,i as r,a as e,j as v,C as I,c as J,F as K,k as N,t as T,y as Y,U as A,H as P,ag as Z,ah as B,I as G,K as L,J as O,N as Q,_ as W,__tla as $}from"./index-afaf388d.js";import{_ as ee,__tla as ae}from"./Dialog-82c2009c.js";import{_ as le,__tla as te}from"./Editor-7453cc9a.js";import{a as se,D as re,__tla as ue}from"./dict-0449a0a1.js";import{g as oe,c as de,u as ie,__tla as me}from"./index-2b7bd806.js";import{u as ne,__tla as _e}from"./useMessage-a290df31.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=W(X({__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=z({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=A,m=P,F=Z,C=B,E=G,R=le,D=L,h=O,H=ee,M=Q;return n(),p(H,{title:e(y),modelValue:e(o),"onUpdate:modelValue":a[5]||(a[5]=l=>Y(o)?o.value=l:null)},{footer:s(()=>[r(h,{onClick:U,type:"primary",disabled:e(d)},{default:s(()=>[v("\u786E \u5B9A")]),_:1},8,["disabled"]),r(h,{onClick:a[4]||(a[4]=l=>o.value=!1)},{default:s(()=>[v("\u53D6 \u6D88")]),_:1})]),default:s(()=>[I((n(),p(D,{ref_key:"formRef",ref:c,model:e(t),rules:e(S),"label-width":"100px"},{default:s(()=>[r(m,{label:"\u540D\u5B57",prop:"name"},{default:s(()=>[r(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}),r(m,{label:"\u6027\u522B",prop:"sex"},{default:s(()=>[r(C,{modelValue:e(t).sex,"onUpdate:modelValue":a[1]||(a[1]=l=>e(t).sex=l)},{default:s(()=>[(n(!0),J(K,null,N(e(se)(e(re).SYSTEM_USER_SEX),l=>(n(),p(F,{key:l.value,label:l.value},{default:s(()=>[v(T(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),r(m,{label:"\u51FA\u751F\u65E5\u671F",prop:"birthday"},{default:s(()=>[r(E,{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}),r(m,{label:"\u7B80\u4ECB",prop:"description"},{default:s(()=>[r(R,{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","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/infra/demo/demo03/erp/Demo03StudentForm.vue"]])});export{ce as __tla,g as default};
|