1 |
- import{O as E}from"./index.120b6f0d.js";import{d as L,ag as h,r as y,$ as _,c as s,aj as S,q as o,ai as l,ak as I,B as C,m,g as d}from"./index.1c621181.js";import{O as N}from"./index.b491c24a.js";import{f as M}from"./index.38b203e1.js";import{f as a,w as G}from"./create.fa5d31e5.js";import{C as H}from"./index.2db9d877.js";import{C as p}from"./index.fd5ae97b.js";import{T as O}from"./index.4e64eb97.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=L({name:"train-content",setup(){const c=h(),t=y({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 _(()=>{T()}),()=>s("div",{class:t.contentList.length<=0&&"emptyRootContainer"},[s(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(I,{btnStatus:!1,tips:"\u6682\u65E0\u8BAD\u7EC3\u5185\u5BB9"},null),s(N,{position:"bottom"},{default:()=>[s("div",{class:"btnGroup"},[s(C,{round:!0,type:"primary",block:!0,onClick:f},{default:()=>[o("\u4E0B\u4E00\u6B65")]})])]}),s(E,{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};
|