Demo03StudentForm-3c9a28e8.js 4.4 KB

1
  1. import{d as j,n as I,r as s,f as J,o as _,l as y,w as d,i as t,a as e,j as h,C as K,c as T,F as Y,k as B,t as L,y as U,U as O,H as Q,ag as W,ah as Z,I as $,K as ee,z as ae,A as le,J as te,N as re,_ as de,__tla as ue}from"./index-af173888.js";import{_ as se,__tla as oe}from"./Dialog-987c90a1.js";import{_ as ie,__tla as me}from"./Editor-c9f3a63b.js";import{a as ne,D as _e,__tla as ce}from"./dict-093d1dfa.js";import{g as ve,c as fe,u as pe,__tla as ye}from"./index-0220ba82.js";import he,{__tla as be}from"./Demo03CourseForm-14a35e09.js";import Ve,{__tla as ge}from"./Demo03GradeForm-ead8ce6e.js";import{u as xe,__tla as we}from"./useMessage-170c1b43.js";let k,Ue=Promise.all([(()=>{try{return ue}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return ge}catch{}})(),(()=>{try{return we}catch{}})()]).then(async()=>{k=de(j({__name:"Demo03StudentForm",emits:["success"],setup(ke,{expose:C,emit:S}){const{t:c}=I(),b=xe(),o=s(!1),V=s(""),i=s(!1),g=s(""),r=s({id:void 0,name:void 0,sex:void 0,birthday:void 0,description:void 0}),D=J({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"}]}),v=s(),m=s("demo03Course"),f=s(),p=s();C({open:async(u,a)=>{if(o.value=!0,V.value=c("action."+u),g.value=u,q(),a){i.value=!0;try{r.value=await ve(a)}finally{i.value=!1}}}});const F=S,R=async()=>{await v.value.validate();try{await f.value.validate()}catch{return void(m.value="demo03Course")}try{await p.value.validate()}catch{return void(m.value="demo03Grade")}i.value=!0;try{const u=r.value;u.demo03Courses=f.value.getData(),u.demo03Grade=p.value.getData(),g.value==="create"?(await fe(u),b.success(c("common.createSuccess"))):(await pe(u),b.success(c("common.updateSuccess"))),o.value=!1,F("success")}finally{i.value=!1}},q=()=>{var u;r.value={id:void 0,name:void 0,sex:void 0,birthday:void 0,description:void 0},(u=v.value)==null||u.resetFields()};return(u,a)=>{const G=O,n=Q,E=W,H=Z,X=$,z=ie,A=ee,x=ae,M=le,w=te,N=se,P=re;return _(),y(N,{title:e(V),modelValue:e(o),"onUpdate:modelValue":a[6]||(a[6]=l=>U(o)?o.value=l:null)},{footer:d(()=>[t(w,{onClick:R,type:"primary",disabled:e(i)},{default:d(()=>[h("\u786E \u5B9A")]),_:1},8,["disabled"]),t(w,{onClick:a[5]||(a[5]=l=>o.value=!1)},{default:d(()=>[h("\u53D6 \u6D88")]),_:1})]),default:d(()=>[K((_(),y(A,{ref_key:"formRef",ref:v,model:e(r),rules:e(D),"label-width":"100px"},{default:d(()=>[t(n,{label:"\u540D\u5B57",prop:"name"},{default:d(()=>[t(G,{modelValue:e(r).name,"onUpdate:modelValue":a[0]||(a[0]=l=>e(r).name=l),placeholder:"\u8BF7\u8F93\u5165\u540D\u5B57"},null,8,["modelValue"])]),_:1}),t(n,{label:"\u6027\u522B",prop:"sex"},{default:d(()=>[t(H,{modelValue:e(r).sex,"onUpdate:modelValue":a[1]||(a[1]=l=>e(r).sex=l)},{default:d(()=>[(_(!0),T(Y,null,B(e(ne)(e(_e).SYSTEM_USER_SEX),l=>(_(),y(E,{key:l.value,label:l.value},{default:d(()=>[h(L(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(n,{label:"\u51FA\u751F\u65E5\u671F",prop:"birthday"},{default:d(()=>[t(X,{modelValue:e(r).birthday,"onUpdate:modelValue":a[2]||(a[2]=l=>e(r).birthday=l),type:"date","value-format":"x",placeholder:"\u9009\u62E9\u51FA\u751F\u65E5\u671F"},null,8,["modelValue"])]),_:1}),t(n,{label:"\u7B80\u4ECB",prop:"description"},{default:d(()=>[t(z,{modelValue:e(r).description,"onUpdate:modelValue":a[3]||(a[3]=l=>e(r).description=l),height:"150px"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[P,e(i)]]),t(M,{modelValue:e(m),"onUpdate:modelValue":a[4]||(a[4]=l=>U(m)?m.value=l:null)},{default:d(()=>[t(x,{label:"\u5B66\u751F\u8BFE\u7A0B",name:"demo03Course"},{default:d(()=>[t(he,{ref_key:"demo03CourseFormRef",ref:f,"student-id":e(r).id},null,8,["student-id"])]),_:1}),t(x,{label:"\u5B66\u751F\u73ED\u7EA7",name:"demo03Grade"},{default:d(()=>[t(Ve,{ref_key:"demo03GradeFormRef",ref:p,"student-id":e(r).id},null,8,["student-id"])]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["title","modelValue"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/infra/demo/demo03/normal/Demo03StudentForm.vue"]])});export{Ue as __tla,k as default};