Demo03CourseForm-fc64903d.js 2.5 KB

1
  1. import{d as D,r as m,g as $,O as q,o as g,c as U,D as F,a as d,k as j,w as a,i as e,l as h,F as z,K as J,Y as K,I as L,s as M,L as O,J as P,p as R,M as Y,_ as A,__tla as B}from"./index-2f799233.js";import{a as E,__tla as G}from"./index-7c244241.js";let x,H=Promise.all([(()=>{try{return B}catch{}})(),(()=>{try{return G}catch{}})()]).then(async()=>{x=A(D({__name:"Demo03CourseForm",props:{studentId:{type:null,required:!0}},setup(b,{expose:w}){const c=b,n=m(!1),l=m([]),i=$({studentId:[{required:!0,message:"\u5B66\u751F\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],name:[{required:!0,message:"\u540D\u5B57\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],score:[{required:!0,message:"\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),p=m();q(()=>c.studentId,async t=>{if(l.value=[],t)try{n.value=!0,l.value=await E(t)}finally{n.value=!1}},{immediate:!0});const y=()=>{const t={id:void 0,studentId:void 0,name:void 0,score:void 0};t.studentId=c.studentId,l.value.push(t)};return w({validate:()=>p.value.validate(),getData:()=>l.value}),(t,N)=>{const u=J,_=K,f=L,v=M,V=O,I=P,k=R,C=Y;return g(),U(z,null,[F((g(),j(I,{ref_key:"formRef",ref:p,model:d(l),rules:d(i),"label-width":"0px","inline-message":!0},{default:a(()=>[e(V,{data:d(l),class:"-mt-10px"},{default:a(()=>[e(u,{label:"\u5E8F\u53F7",type:"index",width:"100"}),e(u,{label:"\u540D\u5B57","min-width":"150"},{default:a(({row:s,$index:o})=>[e(f,{prop:`${o}.name`,rules:d(i).name,class:"mb-0px!"},{default:a(()=>[e(_,{modelValue:s.name,"onUpdate:modelValue":r=>s.name=r,placeholder:"\u8BF7\u8F93\u5165\u540D\u5B57"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:1}),e(u,{label:"\u5206\u6570","min-width":"150"},{default:a(({row:s,$index:o})=>[e(f,{prop:`${o}.score`,rules:d(i).score,class:"mb-0px!"},{default:a(()=>[e(_,{modelValue:s.score,"onUpdate:modelValue":r=>s.score=r,placeholder:"\u8BF7\u8F93\u5165\u5206\u6570"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:1}),e(u,{align:"center",fixed:"right",label:"\u64CD\u4F5C",width:"60"},{default:a(({$index:s})=>[e(v,{onClick:o=>{return r=s,void l.value.splice(r,1);var r},link:""},{default:a(()=>[h("\u2014")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1},8,["model","rules"])),[[C,d(n)]]),e(k,{justify:"center",class:"mt-3"},{default:a(()=>[e(v,{onClick:y,round:""},{default:a(()=>[h("+ \u6DFB\u52A0\u5B66\u751F\u8BFE\u7A0B")]),_:1})]),_:1})],64)}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/infra/demo/demo03/normal/components/Demo03CourseForm.vue"]])});export{H as __tla,x as default};