1 |
- import{d as J,B as O,r as u,g as P,o as _,k as y,w as d,i as t,a as e,l as b,D as T,c as X,F as $,C as A,t as H,R as C,Y as K,I as L,aj as N,ak as Q,q as W,J as ee,Z as ae,$ as le,s as te,M as re,_ as de,__tla as se}from"./index-2f799233.js";import{_ as ue,__tla as oe}from"./Dialog-6fd39e06.js";import{_ as ie,__tla as me}from"./Editor-3a97a075.js";import{a as ne,D as _e,__tla as ce}from"./dict-20c916e2.js";import{g as ve,c as fe,u as pe,__tla as ye}from"./index-7c244241.js";import be,{__tla as he}from"./Demo03CourseForm-fc64903d.js";import Ve,{__tla as ge}from"./Demo03GradeForm-636547ee.js";import{u as xe,__tla as we}from"./useMessage-e567ad40.js";let k,Ce=Promise.all([(()=>{try{return se}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return he}catch{}})(),(()=>{try{return ge}catch{}})(),(()=>{try{return we}catch{}})()]).then(async()=>{k=de(J({__name:"Demo03StudentForm",emits:["success"],setup(ke,{expose:S,emit:D}){const{t:c}=O(),h=xe(),o=u(!1),V=u(""),i=u(!1),g=u(""),r=u({id:void 0,name:void 0,sex:void 0,birthday:void 0,description:void 0}),U=P({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=u(),m=u("demo03Course"),f=u(),p=u();S({open:async(s,a)=>{if(o.value=!0,V.value=c("action."+s),g.value=s,R(),a){i.value=!0;try{r.value=await ve(a)}finally{i.value=!1}}}});const q=D,F=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 s=r.value;s.demo03Courses=f.value.getData(),s.demo03Grade=p.value.getData(),g.value==="create"?(await fe(s),h.success(c("common.createSuccess"))):(await pe(s),h.success(c("common.updateSuccess"))),o.value=!1,q("success")}finally{i.value=!1}},R=()=>{var s;r.value={id:void 0,name:void 0,sex:void 0,birthday:void 0,description:void 0},(s=v.value)==null||s.resetFields()};return(s,a)=>{const G=K,n=L,z=N,E=Q,Y=W,B=ie,I=ee,x=ae,M=le,w=te,Z=ue,j=re;return _(),y(Z,{title:e(V),modelValue:e(o),"onUpdate:modelValue":a[6]||(a[6]=l=>C(o)?o.value=l:null)},{footer:d(()=>[t(w,{onClick:F,type:"primary",disabled:e(i)},{default:d(()=>[b("\u786E \u5B9A")]),_:1},8,["disabled"]),t(w,{onClick:a[5]||(a[5]=l=>o.value=!1)},{default:d(()=>[b("\u53D6 \u6D88")]),_:1})]),default:d(()=>[T((_(),y(I,{ref_key:"formRef",ref:v,model:e(r),rules:e(U),"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(E,{modelValue:e(r).sex,"onUpdate:modelValue":a[1]||(a[1]=l=>e(r).sex=l)},{default:d(()=>[(_(!0),X($,null,A(e(ne)(e(_e).SYSTEM_USER_SEX),l=>(_(),y(z,{key:l.value,label:l.value},{default:d(()=>[b(H(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(n,{label:"\u51FA\u751F\u65E5\u671F",prop:"birthday"},{default:d(()=>[t(Y,{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(B,{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"])),[[j,e(i)]]),t(M,{modelValue:e(m),"onUpdate:modelValue":a[4]||(a[4]=l=>C(m)?m.value=l:null)},{default:d(()=>[t(x,{label:"\u5B66\u751F\u8BFE\u7A0B",name:"demo03Course"},{default:d(()=>[t(be,{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","D:/zx/mall-newfeifan-zx-business/src/views/infra/demo/demo03/normal/Demo03StudentForm.vue"]])});export{Ce as __tla,k as default};
|