index.5d20f595.js 3.2 KB

1
  1. import{d as g,ag as L,r as h,$ as y,c as s,q as o,ah as l,ai as _,B as S,m,f as d}from"./index.ffe80dbe.js";import{O as I}from"./index.d745568a.js";import{O as C}from"./index.a0ef77e4.js";import{O as N}from"./index.4ddd16f0.js";import{f as M}from"./index.931cf0b8.js";import{f as a,w as G}from"./create.790bcfe9.js";import{C as H}from"./index.914765a1.js";import{C as p}from"./index.ea031708.js";import{T as O}from"./index.55ba7429.js";import"./index.1d5c6f70.js";const v="_cellGroup_ju50i_1",D="_classType_ju50i_7",R="_classNum_ju50i_15",k="_classTime_ju50i_18",w="_orchestra_ju50i_24",Y="_name_ju50i_28";var r={cellGroup:v,classType:D,classNum:R,classTime:k,orchestra:w,name:Y},z=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}),f=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(n=>{u.push({orchestraId:n.orchestraId,classGroupIdList:n.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[n.deliveryType][n.classType]})});const E={week:a.week,schoolId:d.user.data.school.id,skipHoliday:!!a.skipHoliday,type:"STANDARD",startDate:l(a.trainStartDate).format("YYYY-MM-DD"),trainingPlanClassList:u},i=await m.post("/api-school/orchestra/trainingPlanList",{hideLoading:!1,data:{...E}});if(i.code===999){t.dialogStatus=!0,t.dialogMessage=i.message;return}a.selectOrchestraId=null,a.selectClassGroupId=null,console.log(i.data,"date"),c.push({path:"/course-preview",query:{cacheId:i.data}})}catch{}};return y(()=>{f()}),()=>s("div",{class:t.contentList.length<=0&&"emptyRootContainer"},[s(C,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(_,{btnStatus:!1,tips:"\u6682\u65E0\u8BAD\u7EC3\u5185\u5BB9"},null),s(N,{position:"bottom"},{default:()=>[s("div",{class:"btnGroup"},[s(S,{round:!0,type:"primary",block:!0,onClick:T},{default:()=>[o("\u4E0B\u4E00\u6B65")]})])]}),s(I,{title:"\u63D0\u793A",show:t.dialogStatus,"onUpdate:show":e=>t.dialogStatus=e,message:t.dialogMessage,confirmButtonText:"\u786E\u5B9A",onConfirm:()=>{c.back()}},null)])}});export{z as default};