index.1c60757e.js 15 KB

1
  1. import{d as A,ag as x,$ as v,c as e,a5 as B,q as u,ai as h,o as m,B as I,P as _,a_ as R,r as $,Z as z,aj as G,ak as O,m as g,ah as j,a$ as H,g as E,R as b}from"./index.1c621181.js";import{O as V}from"./index.b491c24a.js";import{f as t,w as M,a as T,r as q}from"./create.fa5d31e5.js";import{C as Y}from"./index.2db9d877.js";import{C as k}from"./index.fd5ae97b.js";import{C as W}from"./index.9813a8ae.js";import{T as f}from"./index.4e64eb97.js";import{C as D}from"./index.3e68170a.js";import{F}from"./index.c7a20c76.js";import{R as P,a as C}from"./index.523820fb.js";import{P as L}from"./index.53518914.js";import{D as Z}from"./index.d270485b.js";import{O as w}from"./index.be2c3766.js";import{C as J,T as K}from"./index.52647906.js";import{T as Q}from"./teacher-list.25410826.js";import{S as X}from"./index.d5b73933.js";import{T as tt,a as U}from"./index.88a00aa9.js";import"./Checker.6bb59ec3.js";import"./Picker.9bc4331c.js";import"./utils.3d9f83cd.js";import"./index.339fc024.js";import"./isSameOrBefore.691e15de.js";import"./index.36db2313.js";import"./index.c4f0d694.js";import"./icon_teacher.df08d662.js";import"./index.944c4ba2.js";import"./index.d5ee0b18.js";import"./use-tab-status.40058c51.js";import"./index.4c221cbe.js";import"./index.78a302c3.js";const et="_tips_ehifr_1",at="_icon_ehifr_11",st="_informationBottom_ehifr_15",ot="_cellGroup_ehifr_18",lt="_classType_ehifr_23",rt="_radioSection_ehifr_37",it="_radioItem_ehifr_42";var r={tips:et,icon:at,informationBottom:st,cellGroup:ot,classType:lt,radioSection:rt,radioItem:it},nt=A({name:"practice",props:{address:{type:String,default:""}},setup(d){const p=x(),n=()=>{if(t.classList.length>0){t.status=!0;return}if(t.classType.length<=0){m("\u8BF7\u9009\u62E9\u8BFE\u7A0B\u7C7B\u578B");return}if(!t.trainStartDate){m("\u8BF7\u9009\u62E9\u8BFE\u7A0B\u5F00\u59CB\u65E5\u671F");return}if(!t.week){m("\u8BF7\u9009\u62E9\u5468\u6B21");return}if(!d.address){m("\u60A8\u6240\u5728\u7684\u5B66\u6821\u6682\u672A\u8BBE\u7F6E\u5730\u5740");return}const o=[];t.classType.forEach(s=>{o.push({classType:s,startTime:null,endTime:null,trainTimer:null,times:null,classIdList:[]})}),t.classPracticeList=o,p.push("/practice-detail")};return v(()=>{}),()=>e("div",{class:r.practice,style:{minHeight:"calc(100vh - var(--header-height) - var(--van-tabs-line-height))",overflow:"hidden"}},[e("div",{class:r.tips},[e(B,{name:"warning",class:r.icon},null),u("\u81EA\u5B9A\u4E49\u8BAD\u7EC3\u53EF\u5BF9\u4EFB\u610F\u73ED\u7EA7\u8FDB\u884C\u6392\u8BFE\uFF0C\u8BFE\u7A0B\u7C7B\u578B\u53EF\u591A\u9009")]),e(Y,{inset:!0,class:r.cellGroup},{default:()=>[e(k,{title:"\u8BFE\u7A0B\u7C7B\u578B",titleClass:r.classType},{value:()=>e(W,{"checked-color":"#FF8057",modelValue:t.classType,"onUpdate:modelValue":o=>t.classType=o,direction:"horizontal"},{default:()=>[e(f,{size:"large",type:"primary",color:t.classType.includes("SINGLE")?"#FF8057":"#EAEAEA",textColor:t.classType.includes("SINGLE")?"#FFF":"#AAA",class:r.radioSection},{default:()=>[e(D,{class:r.radioItem,name:"SINGLE"},null),u("\u58F0\u90E8\u8BFE")]}),e(f,{size:"large",type:"primary",color:t.classType.includes("MUSIC_THEORY")?"#FF8057":"#EAEAEA",textColor:t.classType.includes("MUSIC_THEORY")?"#FFF":"#AAA",class:r.radioSection},{default:()=>[e(D,{class:r.radioItem,name:"MUSIC_THEORY"},null),u("\u4E50\u7406\u8BFE")]}),e(f,{size:"large",type:"primary",color:t.classType.includes("INSTRUMENTAL_ENSEMBLE")?"#FF8057":"#EAEAEA",textColor:t.classType.includes("INSTRUMENTAL_ENSEMBLE")?"#FFF":"#AAA",class:r.radioSection},{default:()=>[e(D,{class:r.radioItem,name:"INSTRUMENTAL_ENSEMBLE"},null),u("\u5408\u594F\u8BFE")]})]})}),e(F,{label:"\u8BFE\u7A0B\u5F00\u59CB\u65E5\u671F",inputAlign:"right",placeholder:"\u8BF7\u9009\u62E9\u8BFE\u7A0B\u5F00\u59CB\u65E5\u671F",readonly:!0,isLink:!0,modelValue:t.trainStartDate?h(t.trainStartDate).format("YYYY\u5E74MM\u6708DD\u65E5"):"",onClick:()=>t.calendarTimeStatus=!0},null),e(F,{label:"\u8BFE\u7A0B\u5468\u6B21",inputAlign:"right",placeholder:"\u8BF7\u9009\u62E9\u8BFE\u7A0B\u5468\u6B21",readonly:!0,modelValue:M(t.week),onClick:()=>{if(!t.trainStartDate){m("\u8BF7\u9009\u62E9\u8BFE\u7A0B\u5F00\u59CB\u65E5\u671F");return}}},null),e(k,{title:"\u8DF3\u8FC7\u8282\u5047\u65E5"},{value:()=>e(P,{"checked-color":"#FF8057",modelValue:t.skipHoliday,"onUpdate:modelValue":o=>t.skipHoliday=o,direction:"horizontal"},{default:()=>[e(f,{size:"large",type:"primary",color:t.skipHoliday!==1?"#EAEAEA":"#FF8057",textColor:t.skipHoliday!==1?"#AAA":"#FFF",class:r.radioSection,round:!0},{default:()=>[e(C,{class:r.radioItem,name:1},null),u("\u662F")]}),e(f,{size:"large",type:"primary",color:t.skipHoliday!==0?"#EAEAEA":"#FF8057",textColor:t.skipHoliday!==0?"#AAA":"#FFF",class:r.radioSection,round:!0},{default:()=>[e(C,{class:r.radioItem,name:0},null),u("\u5426")]})]})})]}),e(V,{position:"bottom",class:r.informationBottom},{default:()=>[e("div",{class:"btnGroup",style:{marginTop:"24px"}},[e(I,{type:"primary",block:!0,round:!0,onClick:n},{default:()=>[u("\u4E0B\u4E00\u6B65")]})])]}),e(_,{show:t.weekStatus,"onUpdate:show":o=>t.weekStatus=o,position:"bottom",round:!0,class:"popupBottomSearch",teleport:"body"},{default:()=>[e(L,{columns:T,onCancel:()=>t.weekStatus=!1,onConfirm:o=>{t.week=o.selectedValues[0],t.weekStatus=!1}},null)]}),e(_,{show:t.calendarTimeStatus,"onUpdate:show":o=>t.calendarTimeStatus=o,position:"bottom",round:!0,class:"popupBottomSearch",teleport:"body"},{default:()=>[e(Z,{minDate:new Date,modelValue:t.classDate,"onUpdate:modelValue":o=>t.classDate=o,formatter:R,onCancel:()=>t.calendarTimeStatus=!1,onConfirm:o=>{t.calendarTimeStatus=!1,t.trainStartDate=o.selectedValues.join("-");const s=h(t.trainStartDate).day(),i=T[s===0?6:s-1];t.week=i.value}},null)]})])}});const ut="_classList_13nhk_1",ct="_cell_13nhk_1",dt="_content_13nhk_7",mt="_title_13nhk_7",pt="_name_13nhk_22",ht="_teacherName_13nhk_29";var S={classList:ut,cell:ct,content:dt,title:mt,name:pt,teacherName:ht},ft=A({name:"class-list",props:{classList:{type:Array,default:()=>[]}},emits:["close","confirm"],setup(d,{slots:p,attrs:n,emit:o}){const s=$({teacherStatus:!1,list:[],isClick:!1,selectItem:{}}),i=async()=>{try{const a=[];if(s.list.forEach(l=>{l.teacherId&&a.push({classGroupId:l.id,teacherId:l.teacherId})}),a.length<=0){o("close");return}s.isClick=!0,await g.post("/api-school/classGroup/updateTeacher",{data:a}),s.isClick=!1,o("confirm"),o("close")}catch{s.isClick=!1}};return z(()=>d.classList,()=>{s.list=[...d.classList]}),v(()=>{s.list=[...d.classList]}),()=>e("div",{class:[S.classList,s.list.length<=0&&"emptyRootContainer"]},[e(G,{title:"\u6307\u5B9A\u4F34\u5B66\u6307\u5BFC",desotry:!1},null),s.list.map(a=>e(k,{class:S.cell,center:!0,isLink:!0,onClick:()=>{s.selectItem=a,s.teacherStatus=!0},valueClass:[S.teacherName,"van-ellipsis"]},{title:()=>e("div",{class:S.content},[e("div",{class:S.title},[e("i",null,null),a.name]),e("div",{class:[S.name,"van-ellipsis"]},[a.orchestraName])]),value:()=>e("div",{style:{color:a.teacherName?"":"var(--van-primary)"}},[a.teacherName?a.teacherName:"\u53BB\u8BBE\u7F6E"])})),d.classList.length<=0&&e(O,{btnStatus:!1,tips:"\u6682\u65E0\u73ED\u7EA7"},null),e(X,{position:"bottom",style:{width:"100%"}},{default:()=>[e("div",{class:"btnGroup"},[e(I,{round:!0,block:!0,type:"primary",onClick:i,disabled:s.isClick},{default:()=>[u("\u5B8C\u6210")]})])]}),e(_,{show:s.teacherStatus,"onUpdate:show":a=>s.teacherStatus=a,position:"bottom",round:!0,style:{height:"80%"}},{default:()=>[e(Q,{header:!1,mode:"sticky",courseType:s.selectItem.courseType,onClose:()=>s.teacherStatus=!1,onSelect:a=>{s.selectItem.teacherId=a.id,s.selectItem.teacherName=a.nickname}},null)]})])}});const yt="_standard_8h5p6_1",St="_tips_8h5p6_4",kt="_icon_8h5p6_14",gt="_informationBottom_8h5p6_18",Ft="_cellGroup_8h5p6_21",_t="_radioSection_8h5p6_36",Et="_radioItem_8h5p6_41",Tt="_dialogTitle_8h5p6_52";var c={standard:yt,tips:St,icon:kt,informationBottom:gt,cellGroup:Ft,radioSection:_t,radioItem:Et,dialogTitle:Tt},Ct=A({name:"standard",props:{address:{type:String,default:""}},setup(d){j();const p=x(),n=async a=>{try{const{data:l}=await g.post("/api-school/orchestra/trainingPlanTime",{data:{schoolId:E.user.data.school.id,skipHoliday:!!t.skipHoliday,type:"STANDARD",calendarDate:h(a).format("YYYY-MM-DD")}});t.calendarList=l||[]}catch{}},o=async(a=!0)=>{try{const{data:l}=await g.post("/api-school/classGroup/page",{data:{page:1,rows:200,schoolId:E.user.data.school.id,hasTeacher:!1,orchestraType:"DELIVERY"}});t.classList=l.rows||[],t.classList.length>0&&a&&(t.status=!0)}catch{}},s=async()=>{try{const{data:a}=await g.get("/api-school/orchestra/semesterStandardCourseNum/"+E.user.data.school.id),l=Number(t.pickerNum-a);t.times=l;for(let y=0;y<l;y++)t.timerPickerList.push({text:y+1+"\u6B21",value:y+1});l<=0&&(t.numberDialogStatus=!0)}catch{}},i=()=>{if(t.times<=0){t.numberDialogStatus=!0;return}if(t.classList.length>0){t.status=!0;return}if(!t.trainStartDate){m("\u8BF7\u9009\u62E9\u8BAD\u7EC3\u5F00\u59CB\u65E5\u671F");return}if(!t.trainStartTime){m("\u8BF7\u9009\u62E9\u8BAD\u7EC3\u5F00\u59CB\u65F6\u95F4");return}if(!t.week){m("\u8BF7\u9009\u62E9\u5468\u6B21");return}if(!d.address){m("\u60A8\u6240\u5728\u7684\u5B66\u6821\u6682\u672A\u8BBE\u7F6E\u5730\u5740");return}p.push("/train-content")};return v(()=>{n(t.calendarDate||new Date),o(),s()}),()=>e("div",{class:c.standard,style:{minHeight:"calc(100vh - var(--header-height) - var(--van-tabs-line-height))",overflow:"hidden"}},[e("div",{class:c.tips},[e(B,{name:"warning",class:c.icon},null),u("\u6807\u51C6\u8BAD\u7EC3\u53EF\u5BF9\u4EA4\u4ED8\u56E2\u8FDB\u884C\u6574\u5B66\u671F\u6807\u51C6\u8BAD\u7EC3\u6392\u8BFE")]),e(Y,{inset:!0,class:c.cellGroup},{default:()=>[e(k,{title:"\u8DF3\u8FC7\u8282\u5047\u65E5"},{value:()=>e(P,{"checked-color":"#FF8057",modelValue:t.skipHoliday,"onUpdate:modelValue":a=>t.skipHoliday=a,direction:"horizontal",onChange:()=>{t.trainStartDate=null,t.trainStartTime=null,t.calendarDate=null,n()}},{default:()=>[e(f,{size:"large",type:"primary",color:t.skipHoliday!==1?"#EAEAEA":"#FF8057",textColor:t.skipHoliday!==1?"#AAA":"#FFF",class:c.radioSection,round:!0},{default:()=>[e(C,{class:c.radioItem,name:1},null),u("\u662F")]}),e(f,{size:"large",type:"primary",color:t.skipHoliday!==0?"#EAEAEA":"#FF8057",textColor:t.skipHoliday!==0?"#AAA":"#FFF",class:c.radioSection,round:!0},{default:()=>[e(C,{class:c.radioItem,name:0},null),u("\u5426")]})]})}),e(F,{label:"\u8BAD\u7EC3\u5F00\u59CB\u65E5\u671F",placeholder:"\u8BF7\u9009\u62E9\u8BAD\u7EC3\u5F00\u59CB\u65E5\u671F",isLink:!0,readonly:!0,inputAlign:"right",onClick:()=>t.calendarStatus=!0,modelValue:t.trainStartDate?h(t.trainStartDate).format("YYYY\u5E74MM\u6708DD\u65E5"):""},null),e(F,{label:"\u8BAD\u7EC3\u5F00\u59CB\u65F6\u95F4",isLink:!0,readonly:!0,placeholder:"\u8BF7\u9009\u62E9\u8BAD\u7EC3\u5F00\u59CB\u65E5\u671F",inputAlign:"right",modelValue:t.trainStartTime?h(t.trainStartTime).format("HH:mm"):"",onClick:()=>{if(!t.trainStartDate){m("\u8BF7\u9009\u62E9\u8BAD\u7EC3\u5F00\u59CB\u65E5\u671F");return}t.timerStatus=!0}},null),e(k,{title:"\u8BAD\u7EC3\u65F6\u957F",value:t.trainTimer+"\u5206\u949F"},{"right-icon":()=>e(B,{class:"van-cell__right-icon",name:"arrow",color:"#fff"},null)}),e(F,{label:"\u8BAD\u7EC3\u5468\u6B21",isLink:!0,clickable:!1,placeholder:"\u8BF7\u9009\u62E9\u8BAD\u7EC3\u5468\u6B21",modelValue:M(t.week),inputAlign:"right",class:"form-control-icon",readonly:!0},null),e(k,{title:"\u8BAD\u7EC3\u6B21\u6570",isLink:!(t.times<=0),value:t.times+"\u6B21",onClick:()=>{t.times<=0||(t.numberStatus=!0)}},null)]}),e(V,{position:"bottom",class:c.informationBottom},{default:()=>[e("div",{class:"btnGroup",style:{marginTop:"24px"}},[e(I,{type:"primary",block:!0,round:!0,onClick:i},{default:()=>[u("\u4E0B\u4E00\u6B65")]})])]}),e(_,{show:t.weekStatus,"onUpdate:show":a=>t.weekStatus=a,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(L,{columns:T,onCancel:()=>t.weekStatus=!1,onConfirm:a=>{t.week=a.selectedValues[0],t.weekStatus=!1}},null)]}),e(w,{modelValue:t.calendarStatus,"onUpdate:modelValue":a=>t.calendarStatus=a,position:"bottom",destroy:!0,teleport:"body"},{default:()=>[e(J,{list:t.calendarList,nextMonth:a=>n(a),prevMonth:a=>n(a),toDayMonth:a=>n(a),onSelect:a=>{t.calendarStatus=!1,t.trainStartDate=a,t.trainStartTime=null;const l=h(a).day(),y=T[l===0?6:l-1];t.week=y.value,t.calendarList.forEach(N=>{h(N.calendarDate).isSame(a)&&(t.timerList={...N},setTimeout(()=>{t.timerStatus=!0},100))})},onDestory:()=>{t.trainStartDate?n(t.trainStartDate):n()},calendarDate:t.calendarDate,"onUpdate:calendarDate":a=>t.calendarDate=a},null)]}),e(w,{modelValue:t.timerStatus,"onUpdate:modelValue":a=>t.timerStatus=a,position:"bottom",style:{background:"#F6F6F6"},destroy:!0,teleport:"body"},{default:()=>[t.timerStatus&&e(K,{timerList:t.timerList,times:t.trainTimer,onClose:()=>t.timerStatus=!1,onConfirm:a=>{t.trainStartTime=a}},null)]}),e(_,{show:t.numberStatus,"onUpdate:show":a=>t.numberStatus=a,position:"bottom",round:!0,class:"popupBottomSearch",teleport:"body"},{default:()=>[e(L,{columns:t.timerPickerList,onCancel:()=>t.numberStatus=!1,onConfirm:a=>{const l=a.selectedValues[0];t.times=l,t.numberStatus=!1}},null)]}),e(H,{show:t.status,"onUpdate:show":a=>t.status=a,message:`\u60A8\u6709<span style="color: #F44541;">${t.classList.length}\u4E2A</span>\u73ED\u7EA7\u5C1A\u672A\u6307\u5B9A\u4F34\u5B66\u6307\u5BFC\uFF0C\u8BF7\u5B8C\u6210\u6307\u5B9A\u540E\u518D\u8FDB\u884C\u8BAD\u7EC3\u89C4\u5212\u3002`,messageAlign:"left",allowHtml:!0,confirmButtonText:"\u53BB\u8BBE\u7F6E",cancelButtonText:"\u6682\u4E0D\u8BBE\u7F6E",teleport:"body",showCancelButton:!0,onConfirm:()=>{t.classStatus=!0}},{title:()=>e("div",{class:c.dialogTitle},[e("i",null,null),u("\u6307\u5B9A\u4F34\u5B66\u6307\u5BFC")])}),e(H,{show:t.numberDialogStatus,"onUpdate:show":a=>t.numberDialogStatus=a,message:"\u6682\u65E0\u53EF\u8BAD\u7EC3\u6B21\u6570",messageAlign:"center",confirmButtonText:"\u786E\u5B9A",teleport:"body"},{title:()=>e("div",{class:c.dialogTitle},[e("i",null,null),u("\u8BAD\u7EC3\u6B21\u6570")])}),e(w,{modelValue:t.classStatus,"onUpdate:modelValue":a=>t.classStatus=a,position:"bottom",style:{background:"#F6F6F6"},destroy:!0,teleport:"body"},{default:()=>[e(ft,{classList:t.classList,onClose:()=>t.classStatus=!1,onConfirm:()=>{o(!1)}},null)]})])}});const At="_train_r2wxa_1";var vt={train:At},se=A({name:"train-planning",setup(){const d=sessionStorage.getItem("trainType"),p=b(d||"standard"),n=b(""),o=async()=>{try{const{data:i}=await g.get(`/api-school/school/detail/${E.user.data.school.id}`);n.value=i.address||""}catch{}},s=b(0);return v(()=>{o()}),()=>e("div",{class:vt.train},[e(V,{position:"top",onGetHeight:i=>{console.log(i,"height"),s.value=i,document.documentElement.style.setProperty("--header-height",i+"px")}},{default:()=>[e(G,{border:!1},null)]}),e(tt,{sticky:!0,lineWidth:20,lineHeight:4,swipeable:!0,animated:!0,offsetTop:s.value,active:p.value,"onUpdate:active":i=>p.value=i,onChange:i=>{q(),sessionStorage.setItem("trainType",i)}},{default:()=>[e(U,{title:"\u6807\u51C6\u8BAD\u7EC3",name:"standard"},{default:()=>[p.value==="standard"&&e(Ct,{address:n.value},null)]}),e(U,{title:"\u81EA\u5B9A\u4E49\u8BAD\u7EC3",name:"practice"},{default:()=>[p.value==="practice"&&e(nt,{address:n.value},null)]})]})])}});export{se as default};