You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
8.7 KiB
1 lines
8.7 KiB
import{d as T,v as A,r as p,l as D,M as J,k as e,h as c,c as b,a as i,t as f,u as d,e as t,w as o,F as w,O as P,m as v,i as x,_ as M,$ as N,G as O,D as $,H as W,K as z,E as G}from"./index-4c331f20.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{h as H,a as K,b as Q,c as X,e as Y,d as Z}from"./physical_test-ee073749.js";const ee={class:"main-container"},le={class:"detail-head"},ae=i("span",{class:"iconfont iconxiangzuojiantou !text-xs"},null,-1),te={class:"ml-[1px]"},re=i("span",{class:"adorn"},"|",-1),de={class:"right"},oe={class:"fixed-footer-wrap"},se={class:"fixed-footer"},Ie=T({__name:"physical_test_edit",setup(ue){const y=A(),V=parseInt(y.query.id),_=p(!1),S=y.meta.title,U={id:0,resource_id:"",student_id:"",height:"",weight:"",coach_id:"",created_at:"",updated_at:"",seated_forward_bend:"",sit_ups:"",push_ups:"",flamingo_balance:"",thirty_sec_jump:"",standing_long_jump:"",agility_run:"",balance_beam:"",tennis_throw:"",ten_meter_shuttle_run:""},r=D({...U});V&&(async(m=0)=>{Object.assign(r,U);const l=await(await H(m)).data;Object.keys(r).forEach(n=>{l[n]!=null&&(r[n]=l[n])})})(V);const I=p();p([]);const q=p([]);(async()=>{q.value=await(await K({})).data})();const L=p([]);(async()=>{L.value=await(await Q({})).data})();const B=p([]);(async()=>{B.value=await(await X({})).data})();const j=J(()=>({resource_id:[{required:!0,message:e("resourceIdPlaceholder"),trigger:"blur"}],student_id:[{required:!0,message:e("studentIdPlaceholder"),trigger:"blur"}],height:[{required:!0,message:e("heightPlaceholder"),trigger:"blur"}],weight:[{required:!0,message:e("weightPlaceholder"),trigger:"blur"}],coach_id:[{required:!0,message:e("coachIdPlaceholder"),trigger:"blur"}],created_at:[{required:!0,message:e("createdAtPlaceholder"),trigger:"blur"}],updated_at:[{required:!0,message:e("updatedAtPlaceholder"),trigger:"blur"}],seated_forward_bend:[{required:!0,message:e("seatedForwardBendPlaceholder"),trigger:"blur"}],sit_ups:[{required:!0,message:e("sitUpsPlaceholder"),trigger:"blur"}],push_ups:[{required:!0,message:e("pushUpsPlaceholder"),trigger:"blur"}],flamingo_balance:[{required:!0,message:e("flamingoBalancePlaceholder"),trigger:"blur"}],thirty_sec_jump:[{required:!0,message:e("thirtySecJumpPlaceholder"),trigger:"blur"}],standing_long_jump:[{required:!0,message:e("standingLongJumpPlaceholder"),trigger:"blur"}],agility_run:[{required:!0,message:e("agilityRunPlaceholder"),trigger:"blur"}],balance_beam:[{required:!0,message:e("balanceBeamPlaceholder"),trigger:"blur"}],tennis_throw:[{required:!0,message:e("tennisThrowPlaceholder"),trigger:"blur"}],ten_meter_shuttle_run:[{required:!0,message:e("tenMeterShuttleRunPlaceholder"),trigger:"blur"}]})),F=async m=>{_.value||!m||await m.validate(async l=>{l&&(_.value=!0,(V?Y:Z)(r).then(s=>{_.value=!1,history.back()}).catch(s=>{_.value=!1}))})},k=()=>{history.back()};return(m,l)=>{const n=M,g=N,s=O,u=$,C=W,E=z,R=G;return c(),b("div",ee,[i("div",le,[i("div",{class:"left",onClick:l[0]||(l[0]=a=>k())},[ae,i("span",te,f(d(e)("returnToPreviousPage")),1)]),re,i("span",de,f(d(S)),1)]),t(E,{class:"box-card !border-none",shadow:"never"},{default:o(()=>[t(C,{model:r,"label-width":"90px",ref_key:"formRef",ref:I,rules:d(j),class:"page-form"},{default:o(()=>[t(s,{label:d(e)("resourceId"),prop:"resource_id"},{default:o(()=>[t(g,{class:"input-width",modelValue:r.resource_id,"onUpdate:modelValue":l[1]||(l[1]=a=>r.resource_id=a),clearable:"",placeholder:d(e)("resourceIdPlaceholder")},{default:o(()=>[t(n,{label:"请选择",value:""}),(c(!0),b(w,null,P(q.value,(a,h)=>(c(),v(n,{key:h,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("studentId"),prop:"student_id"},{default:o(()=>[t(g,{class:"input-width",modelValue:r.student_id,"onUpdate:modelValue":l[2]||(l[2]=a=>r.student_id=a),clearable:"",placeholder:d(e)("studentIdPlaceholder")},{default:o(()=>[t(n,{label:"请选择",value:""}),(c(!0),b(w,null,P(L.value,(a,h)=>(c(),v(n,{key:h,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("height"),prop:"height"},{default:o(()=>[t(u,{modelValue:r.height,"onUpdate:modelValue":l[3]||(l[3]=a=>r.height=a),clearable:"",placeholder:d(e)("heightPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("weight"),prop:"weight"},{default:o(()=>[t(u,{modelValue:r.weight,"onUpdate:modelValue":l[4]||(l[4]=a=>r.weight=a),clearable:"",placeholder:d(e)("weightPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("coachId"),prop:"coach_id"},{default:o(()=>[t(g,{class:"input-width",modelValue:r.coach_id,"onUpdate:modelValue":l[5]||(l[5]=a=>r.coach_id=a),clearable:"",placeholder:d(e)("coachIdPlaceholder")},{default:o(()=>[t(n,{label:"请选择",value:""}),(c(!0),b(w,null,P(B.value,(a,h)=>(c(),v(n,{key:h,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("createdAt")},{default:o(()=>[t(u,{modelValue:r.created_at,"onUpdate:modelValue":l[6]||(l[6]=a=>r.created_at=a),clearable:"",placeholder:d(e)("createdAtPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("updatedAt")},{default:o(()=>[t(u,{modelValue:r.updated_at,"onUpdate:modelValue":l[7]||(l[7]=a=>r.updated_at=a),clearable:"",placeholder:d(e)("updatedAtPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("seatedForwardBend")},{default:o(()=>[t(u,{modelValue:r.seated_forward_bend,"onUpdate:modelValue":l[8]||(l[8]=a=>r.seated_forward_bend=a),clearable:"",placeholder:d(e)("seatedForwardBendPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("sitUps")},{default:o(()=>[t(u,{modelValue:r.sit_ups,"onUpdate:modelValue":l[9]||(l[9]=a=>r.sit_ups=a),clearable:"",placeholder:d(e)("sitUpsPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("pushUps")},{default:o(()=>[t(u,{modelValue:r.push_ups,"onUpdate:modelValue":l[10]||(l[10]=a=>r.push_ups=a),clearable:"",placeholder:d(e)("pushUpsPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("flamingoBalance")},{default:o(()=>[t(u,{modelValue:r.flamingo_balance,"onUpdate:modelValue":l[11]||(l[11]=a=>r.flamingo_balance=a),clearable:"",placeholder:d(e)("flamingoBalancePlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("thirtySecJump")},{default:o(()=>[t(u,{modelValue:r.thirty_sec_jump,"onUpdate:modelValue":l[12]||(l[12]=a=>r.thirty_sec_jump=a),clearable:"",placeholder:d(e)("thirtySecJumpPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("standingLongJump")},{default:o(()=>[t(u,{modelValue:r.standing_long_jump,"onUpdate:modelValue":l[13]||(l[13]=a=>r.standing_long_jump=a),clearable:"",placeholder:d(e)("standingLongJumpPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("agilityRun")},{default:o(()=>[t(u,{modelValue:r.agility_run,"onUpdate:modelValue":l[14]||(l[14]=a=>r.agility_run=a),clearable:"",placeholder:d(e)("agilityRunPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("balanceBeam")},{default:o(()=>[t(u,{modelValue:r.balance_beam,"onUpdate:modelValue":l[15]||(l[15]=a=>r.balance_beam=a),clearable:"",placeholder:d(e)("balanceBeamPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("tennisThrow")},{default:o(()=>[t(u,{modelValue:r.tennis_throw,"onUpdate:modelValue":l[16]||(l[16]=a=>r.tennis_throw=a),clearable:"",placeholder:d(e)("tennisThrowPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(s,{label:d(e)("tenMeterShuttleRun")},{default:o(()=>[t(u,{modelValue:r.ten_meter_shuttle_run,"onUpdate:modelValue":l[17]||(l[17]=a=>r.ten_meter_shuttle_run=a),clearable:"",placeholder:d(e)("tenMeterShuttleRunPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","rules"])]),_:1}),i("div",oe,[i("div",se,[t(R,{type:"primary",onClick:l[18]||(l[18]=a=>F(I.value))},{default:o(()=>[x(f(d(e)("save")),1)]),_:1}),t(R,{onClick:l[19]||(l[19]=a=>k())},{default:o(()=>[x(f(d(e)("cancel")),1)]),_:1})])])])}}});export{Ie as default};
|
|
|