import{d as g,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.5f7ffb46.js";import{O as C}from"./index.95a99ca5.js";import{O as N}from"./index.7790de2a.js";import{f as M}from"./index.b28db9f5.js";import{f as a,w as G}from"./create.b465b523.js";import{C as H}from"./index.052b3caa.js";import{C as p}from"./index.abd668f7.js";import{T as B}from"./index.ab2541bb.js";const D="_cellGroup_ju50i_1",O="_classType_ju50i_7",k="_classNum_ju50i_15",v="_classTime_ju50i_18",R="_orchestra_ju50i_24",w="_name_ju50i_28";var r={cellGroup:D,classType:O,classNum:k,classTime:v,orchestra:R,name:w},P=g({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}),E=async()=>{try{const{data:e}=await m.get("/api-school/orchestra/trainingContent/"+d.user.data.school.id);t.contentList=e||[]}catch{}},T=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 f={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:{...f}});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(()=>{E()}),()=>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(B,{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:T},{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};