import{d as E,ag as L,r as h,$ as y,c as s,aj as _,q as o,ai as l,ak as S,B as I,m,g as d}from"./index.28bb778f.js";import{O as C}from"./index.77b2a680.js";import{O as N}from"./index.82695db9.js";import{f as M}from"./index.b28db9f5.js";import{f as a,w as G}from"./create.f87696c1.js";import{C as H}from"./index.9e732f91.js";import{C as p}from"./index.49de14a4.js";import{T as O}from"./index.72bbb0ae.js";const k="_cellGroup_ju50i_1",v="_classType_ju50i_7",D="_classNum_ju50i_15",R="_classTime_ju50i_18",w="_orchestra_ju50i_24",Y="_name_ju50i_28";var r={cellGroup:k,classType:v,classNum:D,classTime:R,orchestra:w,name:Y},P=E({name:"train-content",setup(){const c=L(),t=h({dialogStatus:!1,dialogMessage:"",contentList:[],SINGLE_DELIVERY:{SINGLE:120,MUSIC_THEORY:120},MULTIPLE_DELIVERY:{SINGLE:45,MUSIC_THEORY:60,INSTRUMENTAL_ENSEMBLE:60},MULTIPLE_DELIVERY_SCHOOL:{SINGLE:60,MUSIC_THEORY:60,INSTRUMENTAL_ENSEMBLE:60},disabled:!1}),T=async()=>{try{const{data:e}=await m.get("/api-school/orchestra/trainingContent/"+d.user.data.school.id);t.contentList=e||[]}catch{}},f=async()=>{try{if(t.contentList.length<=0){t.dialogStatus=!0,t.dialogMessage="\u6682\u65E0\u53EF\u6392\u8BFE\u73ED\u7EA7";return}const e=t.contentList,u=[];console.log(a,"forms"),e.forEach(i=>{u.push({orchestraId:i.orchestraId,classGroupIdList:i.classGroupIdList,courseNum:a.times,startTime:l(a.trainStartTime).format("HH:mm:ss"),endTime:l(a.trainStartTime).add(120,"minute").format("HH:mm:ss"),singleCourseTime:t[i.deliveryType][i.classType]})});const g={week:a.week,schoolId:d.user.data.school.id,skipHoliday:!!a.skipHoliday,type:"STANDARD",startDate:l(a.trainStartDate).format("YYYY-MM-DD"),trainingPlanClassList:u},n=await m.post("/api-school/orchestra/trainingPlanList",{hideLoading:!1,data:{...g}});if(n.code===999){t.dialogStatus=!0,t.dialogMessage=n.message;return}a.selectOrchestraId=null,a.selectClassGroupId=null,console.log(n.data,"date"),c.push({path:"/course-preview",query:{cacheId:n.data}})}catch{}};return y(()=>{T()}),()=>s("div",{class:t.contentList.length<=0&&"emptyRootContainer"},[s(_,null,null),t.contentList.map(e=>s(H,{inset:!0,class:r.cellGroup},{default:()=>[s(p,{center:!0},{title:()=>s("div",{class:r.classType},[M[e.classType],s(O,{round:!0,type:"primary",size:"medium",class:r.classNum},{default:()=>[a.times,o("\u8BFE\u65F6")]})]),value:()=>s("span",{class:r.classTime},[o("\u6BCF"),G(a.week),o(" "),l(a.trainStartTime||"").format("HH:mm"),o("-"),l(a.trainStartTime||"").add(t[e.deliveryType][e.classType],"minute").format("HH:mm")])}),s(p,{center:!0},{title:()=>s("div",{class:r.orchestra},[s("p",{class:r.name},[e.orchestraName]),s("p",{class:r.class},[o("\u5171"),s("span",null,[e.classGroupIdList&&e.classGroupIdList.length]),o("\u4E2A\u73ED\u7EA7")])])})]})),t.contentList&&t.contentList.length<=0&&s(S,{btnStatus:!1,tips:"\u6682\u65E0\u8BAD\u7EC3\u5185\u5BB9"},null),s(N,{position:"bottom"},{default:()=>[s("div",{class:"btnGroup"},[s(I,{round:!0,type:"primary",block:!0,onClick:f},{default:()=>[o("\u4E0B\u4E00\u6B65")]})])]}),s(C,{title:"\u63D0\u793A",show:t.dialogStatus,"onUpdate:show":e=>t.dialogStatus=e,message:t.dialogMessage,confirmButtonText:"\u786E\u5B9A",onConfirm:()=>{c.back()}},null)])}});export{P as default};
