index.4bf54d1e.js 8.6 KB

1
  1. import{d as L,ah as D,ag as k,r as x,R as F,$ as O,c,aj as U,a5 as R,ai as g,q as f,B as b,F as M,al as Q,m as _,e as P}from"./index.332c7f08.js";import{O as y}from"./index.d7c1b6ac.js";import{i as H}from"./icon_teacher.df08d662.js";import{f as a}from"./create.c8105ce9.js";import{O as G}from"./index.a8f5f4b5.js";import{T as v,a as N}from"./index.7c580591.js";import{C as Y}from"./index.324108a5.js";import{C}from"./index.91135ff9.js";import{I as w}from"./index.96a8db5e.js";import{T as d}from"./index.98482791.js";import"./use-tab-status.9d769af8.js";import"./index.1e2dfe6e.js";import"./index.4aa8e076.js";const j="_dialogTitle_18ch9_1",q="_coursePreview_18ch9_18",z="_orchestraTabs_18ch9_21",Z="_courseTabsContainer_18ch9_33",J="_courseTabs_18ch9_33",W="_cellGroup_18ch9_54",K="_cellDatetime_18ch9_59",X="_cellTeacher_18ch9_62",$="_conflictGrouop_18ch9_68",ee="_cellDate_18ch9_59",se="_iconTimer_18ch9_79",ce="_cellTime_18ch9_83",ae="_img_18ch9_89",te="_cellTimeRange_18ch9_97",oe="_conflictType_18ch9_107",le="_conflict_18ch9_68",re="_teacherName_18ch9_117",ne="_btn_18ch9_123";var t={dialogTitle:j,coursePreview:q,orchestraTabs:z,courseTabsContainer:Z,courseTabs:J,cellGroup:W,cellDatetime:K,cellTeacher:X,conflictGrouop:$,cellDate:ee,iconTimer:se,cellTime:ce,img:ae,cellTimeRange:te,conflictType:oe,conflict:le,teacherName:re,btn:ne},ie="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAA65JREFUWEfNmE1oXFUUx3/nNTSoENtaUktcKIoLceeiYi1okWrBjSSZNxEK4seyUZQmNGjenUpb2mDFdOkHgouZ17S4EYouqsUPdOXGlVR0Ux2ltjFgIW3yTnnv3kwy8c28N2+wnbsb3j33/uac/zn33Cv02JBueNQ8N4jXfx/Lemeyzgb5h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QGJ+h9D5Yk+CwAAAABJRU5ErkJggg==";function E(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!Q(n)}var ye=L({name:"course-preview",setup(){const n=D(),h=k(),s=x({type:n.query.type,conflictStatus:!1,conflictMessage:"\u8BE5\u65F6\u95F4\u6BB5\u4F34\u5B66\u8001\u5E08\u5728\u5176\u4ED6\u5B66\u6821\u6709\u8BFE",tabValue:"",courseValue:"",selectClasses:[],selectCourse:[],choiceCourse:{},isClick:!1,dialogStatus:!1,dialogMessage:""}),S=F(),m=async(o=!0)=>{try{const l=await _.post("/api-school/orchestra/trainingPlanListCache",{requestType:"form",data:{cacheId:n.query.cacheId}});if(l.code===999){s.dialogStatus=!0,s.dialogMessage=l.message;return}if(V(l.data),a.planList.orchestra.length>0){const e=a.selectOrchestraId?{orchestraId:a.selectOrchestraId}:a.planList.orchestra[0];s.tabValue=e.orchestraId;const i=a.selectClassGroupId?{classGroupId:a.selectClassGroupId}:a.planList.classes[e.orchestraId]?a.planList.classes[e.orchestraId][0]:{};s.selectClasses=a.planList.classes[e.orchestraId]||[],s.selectCourse=a.planList.course[i.classGroupId],s.courseValue=i.classGroupId,a.selectOrchestraId=null,a.selectClassGroupId=null}}catch{}},V=async o=>{const l=[];o.forEach(r=>{l.findIndex(p=>p.orchestraId===r.orchestraId)===-1&&l.push({orchestraId:r.orchestraId,orchestraName:r.orchestraName})});const e={};l.forEach(r=>{o.forEach(u=>{if(r.orchestraId===u.orchestraId){const p=e[r.orchestraId];p?p.findIndex(T=>T.classGroupId===u.classGroupId)===-1&&e[r.orchestraId].push({classGroupId:u.classGroupId,className:u.className}):e[r.orchestraId]=[{classGroupId:u.classGroupId,className:u.className}]}})});const i={};for(const r in e)(e[r]||[]).forEach(p=>{const A=o.filter(T=>T.classGroupId===p.classGroupId);i[p.classGroupId]=A});a.planList={orchestra:l,classes:e,course:i}},I=o=>{a.selectOrchestraId=s.tabValue||null,a.selectClassGroupId=s.courseValue||null,h.push({path:"/course-adjust",query:{id:o.id,cacheId:n.query.cacheId}})},B=async()=>{try{s.isClick=!0;const o=await _.post("/api-school/orchestra/trainingPlan/"+n.query.cacheId,{hideLoading:!1});if(o.code===999){s.dialogStatus=!0,s.dialogMessage=o.message;return}s.isClick=!1,n.query.type==="unbind"?h.replace("/companion-teacher"):P({api:"back",content:{}})}catch{s.isClick=!1,m(!1)}};return O(()=>{m()}),()=>{let o,l;return c("div",{class:t.coursePreview},[c(y,{position:"top"},{default:()=>[c(U,{border:!1},null),c(v,{lineWidth:20,lineHeight:4,active:s.tabValue,"onUpdate:active":e=>s.tabValue=e,swipeThreshold:3,class:t.orchestraTabs,onChange:e=>{if(console.log(e,"val",s.tabValue),!a.selectClassGroupId){s.selectClasses=a.planList.classes[e]||[];const i=a.planList.classes[e]?a.planList.classes[e][0]:{};s.selectCourse=a.planList.course[i.classGroupId],s.courseValue=i.classGroupId}}},E(o=a.planList.orchestra.map(e=>c(N,{title:e.orchestraName,name:e.orchestraId},null)))?o:{default:()=>[o]}),c("div",{class:t.courseTabsContainer},[s.courseValue&&c(v,{swipeThreshold:3,class:t.courseTabs,active:s.courseValue,"onUpdate:active":e=>s.courseValue=e,lineHeight:0,shrink:!0,ref:S,onChange:e=>{s.selectCourse=a.planList.course[e]}},E(l=s.selectClasses.map(e=>c(N,{title:e.className,name:e.classGroupId},null)))?l:{default:()=>[l]})])]}),s.selectCourse.map(e=>c(Y,{inset:!0,class:t.cellGroup},{default:()=>[c(C,{center:!0,class:t.cellDatetime},{title:()=>c("div",{class:t.cellDate},[c(R,{name:ie,class:t.iconTimer},null),g(e.classDate).format("YYYY-MM-DD")]),value:()=>c("span",{class:t.cellTime},[e.singleCourseTime,f("\u5206\u949F")])}),c("div",{class:[t.cellTimeRange,e.conflictType&&e.conflictType.length>0&&t.conflictType]},[g(e.startTime).format("HH:mm"),f("-"),g(e.endTime).format("HH:mm")]),c(C,{center:!0,class:t.cellTeacher,border:!1},{icon:()=>c(w,{src:e.teacherAvatar||H,class:t.img,fit:"cover"},null),title:()=>c("div",{class:t.teacherInfo},[c("p",{class:[t.teacherName,"van-ellipsis"]},[e.teacherName]),c(d,{color:"#FFE3DA",textColor:"#F67146",style:{fontWeight:"500",padding:"2px 6px 1px"}},{default:()=>[e.className]})]),value:()=>c(b,{round:!0,plain:!0,type:"primary",class:t.btn,onClick:()=>I(e)},{default:()=>[f("\u8C03\u6574")]})}),c(C,{center:!0,border:!1,class:[t.cellTeacher,t.conflictGrouop]},{title:()=>c(M,null,[e.conflictType&&e.conflictType.includes("STUDENT")&&c(d,{class:t.conflict,color:"#F44541",size:"large",onClick:()=>{s.conflictMessage="\u5B66\u5458\u65F6\u95F4\u51B2\u7A81",s.conflictStatus=!0,s.choiceCourse=e}},{default:()=>[f("\u5B66\u5458\u51B2\u7A81")]}),e.conflictType&&e.conflictType.includes("DIFF_SCHOOL_TEACHER")&&c(d,{class:t.conflict,color:"#F44541",size:"large",onClick:()=>{s.conflictMessage="\u8BE5\u65F6\u95F4\u6BB5\u4F34\u5B66\u8001\u5E08\u5728\u5176\u4ED6\u5B66\u6821\u6709\u8BFE",s.conflictStatus=!0,s.choiceCourse=e}},{default:()=>[f("\u5B66\u6821\u51B2\u7A81")]}),e.conflictType&&e.conflictType.includes("SAME_SCHOOL_TEACHER")&&c(d,{class:t.conflict,color:"#ff8057",size:"large",onClick:()=>{s.conflictMessage="\u4F34\u5B66\u8001\u5E08\u5728\u672C\u5B66\u6821\u65F6\u95F4\u6709\u51B2\u7A81",s.conflictStatus=!0,s.choiceCourse=e}},{default:()=>[f("\u8001\u5E08\u51B2\u7A81")]}),e.conflictType&&e.conflictType.includes("LEAVE")&&c(d,{class:t.conflict,color:"#F44541",size:"large",onClick:()=>{s.conflictMessage="\u4F34\u5B66\u8001\u5E08\u8BF7\u5047\u51B2\u7A81",s.conflictStatus=!0,s.choiceCourse=e}},{default:()=>[f("\u8001\u5E08\u8BF7\u5047")]})])})]})),c(y,{position:"bottom"},{default:()=>[c("div",{class:"btnGroup"},[c(b,{round:!0,block:!0,type:"primary",onClick:B,disabled:s.isClick},{default:()=>[s.type==="change"||s.type==="native"?"\u786E\u8BA4\u8C03\u6574":"\u786E\u8BA4\u6392\u8BFE"]})])]}),c(G,{title:"\u8BFE\u7A0B\u51B2\u7A81",message:s.conflictMessage,show:s.conflictStatus,"onUpdate:show":e=>s.conflictStatus=e,messageAlign:"center",confirmButtonText:"\u53BB\u8C03\u6574",cancelButtonText:"\u77E5\u9053\u4E86",showCancelButton:!0,onConfirm:()=>{s.conflictStatus=!1,I(s.choiceCourse)}},null),c(G,{title:"\u63D0\u793A",show:s.dialogStatus,"onUpdate:show":e=>s.dialogStatus=e,message:s.dialogMessage,confirmButtonText:"\u786E\u5B9A",onConfirm:()=>{h.back()}},null)])}}});export{ye as default};