1 |
- import{d as w,ag as S,aV as Y,r as f,R as k,$ as L,ah as l,c as o,o as c,B as T,q as D,F as M,m as u,f as P,e as b,k as N}from"./index.ffe80dbe.js";import{O as V}from"./index.a0ef77e4.js";import{c as A}from"./index.931cf0b8.js";import{O as p}from"./index.1829b1b7.js";import{C as B,T as F}from"./index.7b6626c1.js";import{T as H}from"./teacher-list.2bd9bdc5.js";import{O}from"./index.4ddd16f0.js";import{O as q}from"./index.d745568a.js";import{C as E}from"./index.914765a1.js";import{C as n}from"./index.ea031708.js";import{T as R}from"./index.55ba7429.js";import{F as v}from"./index.92ec0bf4.js";import"./index.1d5c6f70.js";import"./index.339fc024.js";import"./isSameOrBefore.8aa1af28.js";import"./index.466e527a.js";import"./use-tab-status.5a3cd090.js";import"./index.b4b77b5a.js";import"./index.02edecb1.js";import"./utils.18cb7a73.js";import"./index.777c6c1a.js";import"./index.2ca0f455.js";import"./icon_teacher.df08d662.js";import"./index.c7af3af2.js";import"./index.cafcb8b5.js";import"./index.7e972106.js";const U="_courseInfo_6hkyu_1";var d={courseInfo:U},pe=w({name:"course-adjust",setup(){const g=S(),m=Y(),a=f({id:m.query.id,cacheId:m.query.cacheId,showPopoverTime:!1,showPopoverCourseTime:!1,showPopoverTeacher:!1,currentDate:[],currentCourseDate:[],teachers:[],calendarList:[],calendarDate:null,trainStartTime:null,timerList:{},trainTimer:0,selectItem:{},arrangeType:"STANDARD",isBack:m.query.isBack,dialogStatus:!1,dialogMessage:""}),t=f({classDate:"",teacherName:"",teacherId:"",courseScheduleId:"",startTime:"",endTime:""}),s=k({}),I=async()=>{if(a.cacheId){const{data:r}=await u.get("/api-school/courseSchedule/detailCache",{params:{courseScheduleId:a.id,cacheId:a.cacheId}});s.value={...r},a.arrangeType=r.arrangeType||"STANDARD",t.classDate=r.classDate,t.teacherName=r.teacherName,t.teacherId=r.teacherId,t.courseScheduleId=r.id,t.startTime=r.startTime,t.endTime=r.endTime,a.calendarDate=r.classDate;return}const{data:e}=await u.get(`/api-school/courseSchedule/detail/${a.id}`,{});s.value={...e},t.classDate=s.value.classDate,t.teacherId=s.value.teacherId,t.teacherName=s.value.teacherName,t.courseScheduleId=s.value.id,t.startTime=s.value.startTime,t.endTime=s.value.endTime,a.calendarDate=e.classDate},i=async e=>{try{const{data:r}=await u.post("/api-school/orchestra/calendarDateQuery",{data:{teacherId:t.teacherId,schoolId:P.user.data.school.id,courseScheduleId:t.courseScheduleId,cacheId:a.cacheId,skipHoliday:!1,calendarDate:l(e).format("YYYY-MM-DD")}});a.calendarList=r||[]}catch{}};L(async()=>{await I(),await i(t.classDate),a.calendarList.forEach(e=>{l(e.calendarDate).isSame(t.classDate)&&(a.timerList={...e})})});const h=async()=>{b().isApp&&!a.cacheId&&a.isBack!="true"?N({api:"back"}):g.back()},y=async()=>{console.log(t);try{if(!t.classDate){c("\u8BF7\u9009\u62E9\u8BFE\u7A0B\u5F00\u59CB\u65E5\u671F");return}if(!t.startTime){c("\u8BF7\u9009\u62E9\u8BFE\u7A0B\u5F00\u59CB\u65F6\u95F4");return}const e=await u.post("/api-school/courseSchedule/adjust",{hideLoading:!1,data:{...t,cacheId:a.cacheId}});e.code===999?(a.dialogStatus=!0,a.dialogMessage=e.message):h()}catch(e){c(e.message)}console.log("\u8BFE\u7A0B\u8C03\u6574")};return()=>o(M,null,[o("div",{class:d.courseWrap},[o(V,{border:!1},null),o("div",{class:d.courseInfo},[o(E,{inset:!0,border:!1},{default:()=>[o(n,{title:"\u4E50\u56E2\u540D\u79F0",value:s.value.orchestraName},null),o(n,{title:"\u8BFE\u7A0B\u7C7B\u578B"},{value:()=>s.value.type?o(R,{type:"primary",size:"large"},{default:()=>[A[s.value.type]]}):""}),o(n,{title:"\u6388\u8BFE\u8001\u5E08",value:t.teacherName,onClick:()=>{a.showPopoverTeacher=!0},"is-link":!0},null),o(v,{label:"\u4E0A\u8BFE\u65E5\u671F",inputAlign:"right",readonly:!0,isLink:!0,placeholder:"\u8BF7\u9009\u62E9\u4E0A\u8BFE\u65E5\u671F",onClick:()=>a.showPopoverTime=!0,modelValue:t.classDate?l(t.classDate).format("YYYY-MM-DD"):""},null),o(v,{label:"\u4E0A\u8BFE\u65F6\u95F4",inputAlign:"right",readonly:!0,isLink:!0,placeholder:"\u8BF7\u9009\u62E9\u4E0A\u8BFE\u65F6\u95F4",modelValue:t.startTime?l(t.startTime).format("HH:mm"):"",onClick:()=>{let e=0;if((a.timerList.timeDetailList||[]).forEach(C=>{C.enable===!0&&(e+=1)}),e<=0){c("\u5F53\u524D\u6CA1\u6709\u53EF\u6392\u8BFE\u65F6\u95F4\u6BB5\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u8BFE\u7A0B\u5F00\u59CB\u65E5\u671F");return}a.showPopoverCourseTime=!0}},null),o(n,{title:"\u8BFE\u7A0B\u65F6\u957F",value:(s.value.singleCourseTime||0)+"\u5206\u949F"},null)]})]),o(O,{position:"bottom"},{default:()=>[o("div",{class:["btnGroup btnMore"]},[o(T,{color:"#ccc",round:!0,class:d.unpassBtn,onClick:()=>h()},{default:()=>[D("\u53D6\u6D88")]}),o(T,{color:"#FF8057",round:!0,class:d.unpassBtn,onClick:()=>y()},{default:()=>[D("\u786E\u8BA4\u8C03\u6574")]})])]}),o(p,{modelValue:a.showPopoverTime,"onUpdate:modelValue":e=>a.showPopoverTime=e,position:"bottom",destroy:!0},{default:()=>[o(B,{list:a.calendarList,nextMonth:e=>i(e),prevMonth:e=>i(e),toDayMonth:e=>i(e),onSelect:e=>{a.showPopoverTime=!1,t.classDate=l(e).format("YYYY-MM-DD"),a.calendarList.forEach(r=>{l(r.calendarDate).isSame(e)&&(a.timerList={...r},setTimeout(()=>{a.showPopoverCourseTime=!0},100))}),t.startTime=""},onDestory:()=>{t.classDate?i(t.classDate):i()},calendarDate:a.calendarDate,"onUpdate:calendarDate":e=>a.calendarDate=e},null)]}),o(p,{modelValue:a.showPopoverCourseTime,"onUpdate:modelValue":e=>a.showPopoverCourseTime=e,position:"bottom",style:{background:"#F6F6F6"},destroy:!0},{default:()=>[o(F,{timerList:a.timerList,times:s.value.singleCourseTime||0,onClose:()=>a.showPopoverCourseTime=!1,onConfirm:e=>{t.startTime=l(e).format("YYYY-MM-DD HH:mm:ss"),t.endTime=l(e).add(s.value.singleCourseTime,"minute").format("YYYY-MM-DD HH:mm:ss")}},null)]}),o(p,{modelValue:a.showPopoverTeacher,"onUpdate:modelValue":e=>a.showPopoverTeacher=e,position:"bottom"},{default:()=>[o(H,{courseType:s.value.type,removeTeacherId:t.teacherId,onClose:()=>a.showPopoverTeacher=!1,onSelect:e=>{t.teacherId!==e.id&&(t.classDate="",t.startTime="",t.endTime="",t.teacherId=e.id,t.teacherName=e.nickname,a.calendarDate="",i())}},null)]}),o(q,{title:"\u63D0\u793A",show:a.dialogStatus,"onUpdate:show":e=>a.dialogStatus=e,message:a.dialogMessage,confirmButtonText:"\u786E\u5B9A",onConfirm:()=>{h()}},null)])])}});export{pe as default};
|