1 |
- import{d as z,h as A,r as i,e as B,o as n,v as p,w as s,f as r,a as e,n as v,x as H,c as I,F as O,q as T,t as Y,O as j,V as G,A as J,ah as P,ai as K,B as L,D as N,C as Q,I as W,_ as Z,__tla as $}from"./index-11e4820e.js";import{_ as ee,__tla as ae}from"./Dialog-bbfaf85c.js";import{_ as le,__tla as te}from"./Editor-0f5cadc2.js";import{a as se,D as re,__tla as ue}from"./dict-4072dcec.js";import{g as oe,c as de,u as ie,__tla as me}from"./index-57def28e.js";import{u as ne,__tla as _e}from"./useMessage-06ddf735.js";let V,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()=>{V=Z(z({__name:"Demo03StudentForm",emits:["success"],setup(pe,{expose:g,emit:x}){const{t:_}=A(),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=B({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();g({open:async(u,a)=>{if(o.value=!0,y.value=_("action."+u),b.value=u,q(),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}},q=()=>{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 k=G,m=J,D=P,F=K,C=L,E=le,R=N,h=Q,X=ee,M=W;return n(),p(X,{title:e(y),modelValue:e(o),"onUpdate:modelValue":a[5]||(a[5]=l=>j(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(()=>[H((n(),p(R,{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(k,{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(F,{modelValue:e(t).sex,"onUpdate:modelValue":a[1]||(a[1]=l=>e(t).sex=l)},{default:s(()=>[(n(!0),I(O,null,T(e(se)(e(re).SYSTEM_USER_SEX),l=>(n(),p(D,{key:l.value,label:l.value},{default:s(()=>[v(Y(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),r(m,{label:"\u51FA\u751F\u65E5\u671F",prop:"birthday"},{default:s(()=>[r(C,{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(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","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/infra/demo/demo03/erp/Demo03StudentForm.vue"]])});export{ce as __tla,V as default};
|