course-adjust-legacy.9cce7991.js 9.5 KB

12
  1. !function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?e(Object(a),!0).forEach((function(e){n(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t,n,r,a,c,o){try{var i=e[c](o),u=i.value}catch(s){return void n(s)}i.done?t(u):Promise.resolve(u).then(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(a,c){var o=e.apply(t,n);function i(e){r(o,a,c,i,u,"next",e)}function u(e){r(o,a,c,i,u,"throw",e)}i(void 0)}))}}var c=document.createElement("style");c.innerHTML="._courseInfo_6hkyu_1{margin-top:.32rem}._courseInfo_6hkyu_1 .van-cell{padding:0 .32rem;font-size:.42667rem;font-weight:400;color:#333;line-height:1.54667rem;display:flex;flex-direction:row;align-items:center}._courseInfo_6hkyu_1 .van-cell .van-cell__value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.42667rem;font-weight:400;color:#333}\n",document.head.appendChild(c),System.register(["./index-legacy.48c8d62c.js","./index-legacy.f3037807.js","./index-legacy.8895675d.js","./index-legacy.d1078003.js","./index-legacy.de1a4bff.js","./teacher-list-legacy.c3dfc8db.js","./index-legacy.8cf5f94f.js","./index-legacy.5a3e4145.js","./index-legacy.269a0b91.js","./index-legacy.087e0425.js","./index-legacy.93204044.js","./index-legacy.55fe5b03.js","./index-legacy.ac553194.js","./index-legacy.c75fe8a2.js","./isSameOrBefore-legacy.e0108432.js","./index-legacy.ef66d7bb.js","./use-tab-status-legacy.6949b1de.js","./index-legacy.71047e87.js","./index-legacy.a2ac81dd.js","./utils-legacy.60f652b8.js","./index-legacy.384d768f.js","./index-legacy.ac2e8bc2.js","./icon_teacher-legacy.07765f44.js","./index-legacy.87ef53c1.js","./index-legacy.04f465c8.js","./index-legacy.0e0de364.js"],(function(e){"use strict";var n,r,c,o,i,u,s,l,d,f,m,h,p,g,v,y,T,D,b,w,x,j,I,k,P,C,S,O;return{setters:[function(e){n=e.d,r=e.ag,c=e.aV,o=e.r,i=e.R,u=e.$,s=e.ah,l=e.c,d=e.o,f=e.B,m=e.q,h=e.F,p=e.m,g=e.f,v=e.e,y=e.k},function(e){T=e.O},function(e){D=e.c},function(e){b=e.O},function(e){w=e.C,x=e.T},function(e){j=e.T},function(e){I=e.O},function(e){k=e.O},function(e){P=e.C},function(e){C=e.C},function(e){S=e.T},function(e){O=e.F},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var Y={courseInfo:"_courseInfo_6hkyu_1"};e("default",n({name:"course-adjust",setup:function(){var e=r(),n=c(),M=o({id:n.query.id,cacheId:n.query.cacheId,showPopoverTime:!1,showPopoverCourseTime:!1,showPopoverTeacher:!1,currentDate:[],currentCourseDate:[],teachers:[],calendarList:[],calendarDate:null,trainStartTime:null,timerList:{},trainTimer:0,selectItem:{},arrangeType:"STANDARD",isBack:n.query.isBack,dialogStatus:!1,dialogMessage:""}),L=o({classDate:"",teacherName:"",teacherId:"",courseScheduleId:"",startTime:"",endTime:""}),_=i({}),R=function(){var e=a(regeneratorRuntime.mark((function e(){var n,r,a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!M.cacheId){e.next=15;break}return e.next=3,p.get("/api-school/courseSchedule/detailCache",{params:{courseScheduleId:M.id,cacheId:M.cacheId}});case 3:return n=e.sent,r=n.data,_.value=t({},r),M.arrangeType=r.arrangeType||"STANDARD",L.classDate=r.classDate,L.teacherName=r.teacherName,L.teacherId=r.teacherId,L.courseScheduleId=r.id,L.startTime=r.startTime,L.endTime=r.endTime,M.calendarDate=r.classDate,e.abrupt("return");case 15:return e.next=17,p.get("/api-school/courseSchedule/detail/".concat(M.id),{});case 17:a=e.sent,c=a.data,_.value=t({},c),L.classDate=_.value.classDate,L.teacherId=_.value.teacherId,L.teacherName=_.value.teacherName,L.courseScheduleId=_.value.id,L.startTime=_.value.startTime,L.endTime=_.value.endTime,M.calendarDate=c.classDate;case 27:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=a(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,p.post("/api-school/orchestra/calendarDateQuery",{data:{teacherId:L.teacherId,schoolId:g.user.data.school.id,courseScheduleId:L.courseScheduleId,cacheId:M.cacheId,skipHoliday:!1,calendarDate:s(t).format("YYYY-MM-DD")}});case 3:n=e.sent,r=n.data,M.calendarList=r||[],e.next=10;break;case 8:e.prev=8,e.t0=e.catch(0);case 10:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}();u(a(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R();case 2:return e.next=4,N(L.classDate);case 4:M.calendarList.forEach((function(e){s(e.calendarDate).isSame(L.classDate)&&(M.timerList=t({},e))}));case 5:case"end":return e.stop()}}),e)}))));var V=function(){var t=a(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:v().isApp&&!M.cacheId&&"true"!=M.isBack?y({api:"back"}):e.back();case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),B=function(){var e=a(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log(L),e.prev=1,L.classDate){e.next=5;break}return d("请选择课程开始日期"),e.abrupt("return");case 5:if(L.startTime){e.next=8;break}return d("请选择课程开始时间"),e.abrupt("return");case 8:return e.next=10,p.post("/api-school/courseSchedule/adjust",{hideLoading:!1,data:t(t({},L),{},{cacheId:M.cacheId})});case 10:999===(n=e.sent).code?(M.dialogStatus=!0,M.dialogMessage=n.message):V(),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),d(e.t0.message);case 17:console.log("课程调整");case 18:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(){return e.apply(this,arguments)}}();return function(){return l(h,null,[l("div",{class:Y.courseWrap},[l(T,{border:!1},null),l("div",{class:Y.courseInfo},[l(P,{inset:!0,border:!1},{default:function(){return[l(C,{title:"乐团名称",value:_.value.orchestraName},null),l(C,{title:"课程类型"},{value:function(){return _.value.type?l(S,{type:"primary",size:"large"},{default:function(){return[D[_.value.type]]}}):""}}),l(C,{title:"授课老师",value:L.teacherName,onClick:function(){M.showPopoverTeacher=!0},"is-link":!0},null),l(O,{label:"上课日期",inputAlign:"right",readonly:!0,isLink:!0,placeholder:"请选择上课日期",onClick:function(){return M.showPopoverTime=!0},modelValue:L.classDate?s(L.classDate).format("YYYY-MM-DD"):""},null),l(O,{label:"上课时间",inputAlign:"right",readonly:!0,isLink:!0,placeholder:"请选择上课时间",modelValue:L.startTime?s(L.startTime).format("HH:mm"):"",onClick:function(){var e=0;(M.timerList.timeDetailList||[]).forEach((function(t){!0===t.enable&&(e+=1)})),e<=0?d("当前没有可排课时间段,请重新选择课程开始日期"):M.showPopoverCourseTime=!0}},null),l(C,{title:"课程时长",value:(_.value.singleCourseTime||0)+"分钟"},null)]}})]),l(I,{position:"bottom"},{default:function(){return[l("div",{class:["btnGroup btnMore"]},[l(f,{color:"#ccc",round:!0,class:Y.unpassBtn,onClick:function(){return V()}},{default:function(){return[m("取消")]}}),l(f,{color:"#FF8057",round:!0,class:Y.unpassBtn,onClick:function(){return B()}},{default:function(){return[m("确认调整")]}})])]}}),l(b,{modelValue:M.showPopoverTime,"onUpdate:modelValue":function(e){return M.showPopoverTime=e},position:"bottom",destroy:!0},{default:function(){return[l(w,{list:M.calendarList,nextMonth:function(e){return N(e)},prevMonth:function(e){return N(e)},toDayMonth:function(e){return N(e)},onSelect:function(e){M.showPopoverTime=!1,L.classDate=s(e).format("YYYY-MM-DD"),M.calendarList.forEach((function(n){s(n.calendarDate).isSame(e)&&(M.timerList=t({},n),setTimeout((function(){M.showPopoverCourseTime=!0}),100))})),L.startTime=""},onDestory:function(){L.classDate?N(L.classDate):N()},calendarDate:M.calendarDate,"onUpdate:calendarDate":function(e){return M.calendarDate=e}},null)]}}),l(b,{modelValue:M.showPopoverCourseTime,"onUpdate:modelValue":function(e){return M.showPopoverCourseTime=e},position:"bottom",style:{background:"#F6F6F6"},destroy:!0},{default:function(){return[l(x,{timerList:M.timerList,times:_.value.singleCourseTime||0,onClose:function(){return M.showPopoverCourseTime=!1},onConfirm:function(e){L.startTime=s(e).format("YYYY-MM-DD HH:mm:ss"),L.endTime=s(e).add(_.value.singleCourseTime,"minute").format("YYYY-MM-DD HH:mm:ss")}},null)]}}),l(b,{modelValue:M.showPopoverTeacher,"onUpdate:modelValue":function(e){return M.showPopoverTeacher=e},position:"bottom"},{default:function(){return[l(j,{courseType:_.value.type,removeTeacherId:L.teacherId,onClose:function(){return M.showPopoverTeacher=!1},onSelect:function(e){L.teacherId!==e.id&&(L.classDate="",L.startTime="",L.endTime="",L.teacherId=e.id,L.teacherName=e.nickname,M.calendarDate="",N())}},null)]}}),l(k,{title:"提示",show:M.dialogStatus,"onUpdate:show":function(e){return M.dialogStatus=e},message:M.dialogMessage,confirmButtonText:"确定",onConfirm:function(){V()}},null)])])}}}))}}}))}();