import{v as G,w,x as S,_ as $}from"./index-5a47c360-1785478469326v=1.0.0.js";import{E as V}from"./eleVendor-bc05bc4d-1785478469326v=1.0.0.js";import{x as A,r as u,k as H,al as g,y as d,z as f,Q as v,I as p,L as C,u as s,A as D,P,a4 as R,H as L,l as J}from"./vendor-46662d77-1785478469326v=1.0.0.js";const z={key:0,class:"scoreDetailContainer"},M={class:"header"},Z={key:0,class:"table"},O=A({__name:"sportCourse",props:{tsId:{},searchParam:{default:{}}},emits:[],setup(x,{expose:I,emit:Q}){const b=x,y=u([]),E=u([]),c=u(0),N=async(a,e)=>{const t=m.value.find(r=>r.courseGradeId===a);await h(t.courseNo,t.courseType,t.classroomNo),F()},F=async()=>{try{const a=await G({tsId:b.tsId,courseGradeId:c.value});if(a.code===0){const e=a.data.listData.map(t=>t.gradeJson&&JSON.parse(t.gradeJson||"{}"))||[];e.value=e.filter(t=>t),console.warn({detailTableData:e.value})}}catch{}},h=async(a,e,t)=>{try{const r=await w({courseNo:a,courseType:e,classroomNo:t});r.code===0&&(r.data.forEach(o=>{o.prop=`${o.gradeNo}`,o.label=`${o.gradeName}${o.gradeRatio?`(${o.gradeRatio*100}%)`:""}`,o.childList&&o.childList.length>0&&(o.childList.forEach(n=>{n.prop=`${n.gradeNo}`,n.label=`${n.gradeName}${n.gradeRatio?`(${n.gradeRatio*100}%)`:""}`}),o._children=o.childList)}),E.value=r.data||[])}catch{}},T=u([{label:"\u8BFE\u7A0B\u540D\u79F0",prop:"courseIdCn"},{label:"\u4EFB\u8BFE\u8001\u5E08",prop:"tname"},{label:"\u5B66\u5206",prop:"credit"},{label:"\u6210\u7EE9",prop:"score"},{label:"\u72B6\u6001",prop:"courseGradeStatusCn"}]),m=u([]),l=u([]),_=u(!1),k=async()=>{try{_.value=!0;const a=await S({tsId:b.tsId,...b.searchParam,page:1,size:10});if(a.code===0){if(m.value=a.data.listData||[],l.value=a.data.listData.filter(e=>e.isCourseField),l.value.length===0)return;c.value=l.value[0].courseGradeId,await h(l.value[0].courseNo,l.value[0].courseType,l.value[0].classroomNo),F()}}catch(a){V.error(a)}finally{_.value=!1}},B=()=>{k()};return H(()=>{B()}),I({initData:B}),(a,e)=>{const t=g("HZProTable"),r=g("el-tab-pane"),o=g("el-tabs"),n=g("el-empty");return d(),f("div",null,[v(t,{columns:s(T),data:s(m),isFlex:!1,loading:s(_)},{tableHeader:p(()=>e[1]||(e[1]=[])),toolButton:p(()=>[C(' <el-button @click="handleExport"> \u5BFC\u51FA </el-button> ')]),_:1},8,["columns","data","loading"]),s(l).length&&s(l).length>0?(d(),f("div",z,[D("div",M,[e[2]||(e[2]=D("div",{class:"title"},"\u6210\u7EE9\u8BE6\u60C5\uFF1A",-1)),v(o,{onTabChange:N,modelValue:s(c),"onUpdate:modelValue":e[0]||(e[0]=i=>J(c)?c.value=i:null)},{default:p(()=>[(d(!0),f(P,null,R(s(l),i=>(d(),L(r,{key:i.courseGradeId,label:i.courseIdCn,name:i.courseGradeId},null,8,["label","name"]))),128))]),_:1},8,["modelValue"])]),s(y).length>0?(d(),f("div",Z,[v(t,{columns:s(E),data:s(y),isFlex:!1,loading:s(_)},{tableHeader:p(()=>e[3]||(e[3]=[])),toolButton:p(()=>[C(' <el-button @click="handleExport"> \u5BFC\u51FA </el-button> ')]),_:1},8,["columns","data","loading"])])):(d(),L(n,{key:1}))])):C("v-if",!0)])}}});const K=$(O,[["__scopeId","data-v-6e996358"]]);export{K as default};
