index.9a68ca92.js 12 KB

1
  1. var le=Object.defineProperty;var Y=Object.getOwnPropertySymbols;var se=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable;var q=(l,c,o)=>c in l?le(l,c,{enumerable:!0,configurable:!0,writable:!0,value:o}):l[c]=o,$=(l,c)=>{for(var o in c||(c={}))se.call(c,o)&&q(l,o,c[o]);if(Y)for(var o of Y(c))ae.call(c,o)&&q(l,o,c[o]);return l};import{d as T,V as d,h as M,a5 as O,a as e,S as oe,u as ne,a1 as ce,B as j,s as ie,j as a,P as E,as as G,F as re,m as C,a2 as S,q as w,z as de,O as me,T as b,a9 as R,aa as I,x as pe,J as z,g as y}from"./vendor.f57b7239.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{i as fe}from"./icon_tips.1c27519f.js";import{r as x,j as Fe}from"./index.4403075c.js";import{O as J}from"./organ-search.b6dc35b2.js";import{C as W}from"./index.41d6b3ce.js";import{C as ve}from"./index.3676e58d.js";import{C as be}from"./index.a8ae0738.js";/* empty css *//* empty css */import{S as he}from"./index.e2c6ca2d.js";import"./icon_student.bbb32387.js";const Be="_container_1c8qx_1",Ce="_tips_1c8qx_13",_e="_icon_1c8qx_20",Ee="_tipsContent_1c8qx_25",ye="_week_1c8qx_30",ge="_holdays_1c8qx_57",ke="_coursePopup_1c8qx_83",je="_tags_1c8qx_89",Se="_pickerTitle_1c8qx_106";var v={container:Be,tips:Ce,icon:_e,tipsContent:Ee,week:ye,holdays:ge,coursePopup:ke,tags:je,pickerTitle:Se};const we="_container_1df8b_1",xe="_label_1df8b_7",Ae="_btnGroup_1df8b_19",De="_check_1df8b_31";var g={container:we,label:xe,btnGroup:Ae,check:De},Ne=T({name:"SelectStudents",props:{subjectList:{type:Array,default:[]},onSetStudents:{type:Function,default:l=>{}}},setup(l,{expose:c}){const o=d(!1),m=d("\u5168\u90E8\u58F0\u90E8"),p=M({courseId:void 0,subjectId:void 0,userName:void 0}),t=d([]),i=async()=>{try{const{code:s,data:r}=await x.post("/api-teacher/courseSchedule/selectStudent",{data:$({},p)});s===200&&r.rows.length&&(r.rows.forEach(_=>_.checked=!1),t.value=r.rows,console.log(t.value))}catch{}};O(()=>{i()});const D=s=>{!s||(p.userName=s,i())},f=s=>{s.checked=!s.checked};return c({onDelete:s=>{t.value.forEach(r=>{r.userId===s.userId&&(r.checked=!1)})}}),()=>e("div",{class:g.container},[e(oe,{offsetTop:0},{default:()=>[e(W,{isBack:!0,title:"\u9009\u62E9\u5B66\u5458"},null),e(be,{placeholder:"\u8BF7\u8F93\u5165\u5B66\u5458\u540D\u79F0",onSearch:D},{left:()=>e("div",{class:g.label,onClick:()=>{o.value=!0}},[m.value,e(ne,{classPrefix:"iconfont",name:"down",size:12,color:"#333"},null)])})]}),t.value.map(s=>e("div",{onClick:()=>{f(s)}},[e(he,{item:s},{default:()=>[e("div",{class:g.check},[e(ce,{modelValue:s.checked,"onUpdate:modelValue":r=>s.checked=r,name:s.userId},null)])]})])),e("div",{class:g.btnGroup},[e(j,{block:!0,round:!0,class:g.confirmBtn,type:"primary",onClick:()=>{let s=ie(t.value.filter(r=>r.checked));l.onSetStudents(s)}},{default:()=>[a("\u786E\u8BA4")]})]),e(E,{show:o.value,"onUpdate:show":s=>o.value=s,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0},{default:()=>[e(J,{isReset:!0,subjectList:l.subjectList,modelValue:p.subjectId,"onUpdate:modelValue":s=>p.subjectId=s,subjectName:m.value,"onUpdate:subjectName":s=>m.value=s,onSort:()=>{o.value=!1,i()}},null)]})])}});const Te="_box_12gfu_1",Ie="_wrap_12gfu_5",Ve="_title_12gfu_9",Ue="_leftIcon_12gfu_19",Le="_stu_12gfu_26",He="_timeBox_12gfu_30",Pe="_timeTitle_12gfu_38",Ye="_timeItem_12gfu_42",qe="_footer_12gfu_46";var h={box:Te,wrap:Ie,title:Ve,leftIcon:Ue,stu:Le,timeBox:He,timeTitle:Pe,timeItem:Ye,footer:qe},$e=T({name:"CourseSchedule",props:{item:{type:Object,default:{}},students:{type:Array,default:[]},curriculum:{type:Array,default:[]},onClose:{type:Function,default:()=>{}},onComfirm:{type:Function,default:()=>{}}},setup(l){const c=G(()=>l.students.map(m=>m.realName).join("\u3001"));return()=>e("div",{class:h.box},[e("div",{class:h.title},[e("div",{class:h.leftIcon},null),a("\u8BFE\u7A0B\u9884\u89C8")]),e("div",{class:h.wrap},[e("div",{class:h.stu},[e("div",null,[a("\u60A8\u5C06\u4E3A\u5B66\u5458\uFF1A"),e("span",{style:{color:"var(--van-primary)"}},[c.value])]),e("div",null,[a("\u6392"),e("span",{style:{color:"#FF4E19",margin:"0 10px"}},[l.item.classNum,a("\u8282 "),l.item.singleClssTime,a("\u5206\u949F")]),a("\u8BFE\u7A0B")])]),e("div",{class:h.timeBox},[e("div",{class:h.timeTitle},[a("\u4E0A\u8BFE\u65F6\u95F4\uFF1A")]),l.curriculum.map(o=>e("div",{class:h.timeItem},[o]))]),e("div",{style:{color:"#999999"}},[a("\u4EE5\u4E0A\u8BFE\u7A0B\u9884\u8BA1\u5C06\u6D88\u8017\u7434\u623F\u65F6\u957F")," ",Math.ceil(l.students.length*l.item.classNum*l.item.singleClssTime),a(" \u5206\u949F")," ",e("br",null,null),a("\u786E\u8BA4\u6392\u8BFE\u540E\u65F6\u957F\u51BB\u7ED3 "),e("br",null,null),a("\u5B9E\u9645\u6D88\u8017\u65F6\u957F\u4EE5\u6263\u51CF\u7ED3\u679C\u4E3A\u51C6 "),e("br",null,null)])]),e("div",{class:h.footer},[e(j,{block:!0,round:!0,onClick:()=>l.onClose()},{default:()=>[a("\u91CD\u65B0\u9009\u62E9")]}),e(j,{block:!0,round:!0,type:"primary",onClick:()=>l.onComfirm()},{default:()=>[a("\u786E\u8BA4\u6392\u8BFE")]})])])}});function K(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!pe(l)}const A={"is-link":!0,readonly:!0,"arrow-direction":"down"};var iu=T({name:"ClassArrangement",setup(){const l=d(!1),c=d(!1),o=d(!1),m=d(!1),p=d(!1),t=M({courseName:"",classNum:1,singleClssTime:45,studentIds:[],timeList:[],date:"",time:"",subjectId:0,subjectName:"",week:"",isSkipHolidays:!0}),i=d("");d("");const D=G(()=>i.value),f=d([]),V=u=>{f.value=u,m.value=!1},s=u=>{const n=f.value.splice(u,1)[0];r==null||r.value.onDelete(n)},r=d(""),_=d([]),Q=async()=>{try{const u=await x.get("/api-teacher/subject/subjectSelect");_.value=u.data||[]}catch{}};O(()=>{Q()});const U=d(""),X=async u=>{var n;try{let F=await x.get("/api-teacher/courseSchedule/selectHoliday",{params:{year:u}});U.value=((n=F==null?void 0:F.data)==null?void 0:n.holidaysFestivalsJson)||""}catch{}},Z=()=>{const u=[],n=[];let F=0,P=0;const te=H[t.week],k=y().set("hour",Number(i.value.split(":")[0])).set("minute",Number(i.value.split(":")[1])).add(t.singleClssTime,"minute").format("HH:mm");for(;F<t.classNum;){const N=y(t.date).add(P,"day");if(P++,N.get("day")!==te)continue;const B=N.format("YYYY-MM-DD");t.isSkipHolidays?![6,0].includes(N.get("day"))&&!U.value.includes(B)&&(F++,u.push({startTime:B+` ${i.value}`,endTime:B+` ${k}`}),n.push(B+` ${i.value} ~ ${k}`)):(F++,u.push({startTime:B+` ${i.value}`,endTime:B+` ${k}`}),n.push(B+` ${i.value} ~ ${k}`))}return{timeList:u,curriculumList:n}},L=d([]),ee=()=>{if(!t.courseName){b("\u8BF7\u586B\u5199\u8BFE\u7A0B\u540D\u79F0");return}if(!t.subjectId){b("\u8BF7\u9009\u62E9\u8BAD\u7EC3\u58F0\u90E8");return}if(!f.value.length){b("\u8BF7\u9009\u62E9\u4E0A\u8BFE\u5B66\u5458");return}if(!t.singleClssTime){b("\u8BF7\u586B\u5199\u5355\u8BFE\u65F6\u65F6\u957F");return}if(!t.date){b("\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F");return}if(!t.week){b("\u8BF7\u9009\u62E9\u5FAA\u73AF\u5468\u6B21");return}if(!i.value){b("\u8BF7\u9009\u62E9\u4E0A\u8BFE\u65F6\u95F4");return}const{timeList:u,curriculumList:n}=Z();t.timeList=u,L.value=n,console.log(n),p.value=!0},ue=async()=>{try{let{code:u,data:n}=await x.post("/api-teacher/courseSchedule/arrangeCourse",{data:{classNum:t.classNum,consumeTime:Math.ceil(f.value.length*t.classNum*t.singleClssTime),courseName:t.courseName,singleClssTime:t.singleClssTime,studentIds:f.value.map(F=>F.userId),subjectId:t.subjectId,timeList:t.timeList}});u===200&&(p.value=!1,b("\u6392\u8BFE\u6210\u529F"))}catch{}},H={\u5468\u4E00:1,\u5468\u4E8C:2,\u5468\u4E09:3,\u5468\u56DB:4,\u5468\u4E94:5,\u5468\u516D:6,\u5468\u65E5:0};return()=>e(re,null,[e(W,null,null),e("div",{class:v.container},[e(C,{label:"\u8BFE\u7A0B\u540D\u79F0",placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u540D\u79F0",modelValue:t.courseName,"onUpdate:modelValue":u=>t.courseName=u},null),e(C,S({label:"\u8BAD\u7EC3\u58F0\u90E8",placeholder:"\u8BF7\u9009\u62E9\u8BAD\u7EC3\u58F0\u90E8"},A,{modelValue:t.subjectName,onClick:()=>o.value=!0}),null),e(w,{style:{padding:0}},{default:()=>[e(C,S({style:{margin:0},border:!1,label:"\u4E0A\u8BFE\u5B66\u5458",placeholder:"\u8BF7\u9009\u62E9\u4E0A\u8BFE\u5B66\u5458"},A,{onClick:()=>m.value=!0}),null),f.value.length?e("div",{class:v.tags},[f.value.map((u,n)=>e(de,{closeable:!0,onClose:()=>s(n)},{default:()=>[u.userName]}))]):null]}),e(C,{label:"\u8BFE\u65F6\u6570",placeholder:"\u8BF7\u8F93\u5165\u8BFE\u65F6\u6570"},{input:()=>e(me,{modelValue:t.classNum,"onUpdate:modelValue":u=>t.classNum=u},null)}),e(C,{class:v.singleClssTime,type:"number",label:"\u5355\u8BFE\u65F6\u65F6\u957F",placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u65F6\u957F",modelValue:t.singleClssTime,"onUpdate:modelValue":u=>{if(Math.abs(u)>60){b("\u65F6\u957F\u4E0D\u80FD\u5927\u4E8E60\u5206\u949F");return}t.singleClssTime=Math.abs(u)}},{"right-icon":()=>e("div",null,[a("\u5206\u949F")])}),e(C,S({label:"\u5F00\u59CB\u65E5\u671F",placeholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F"},A,{modelValue:t.date,onClick:()=>l.value=!0}),null),e(w,{title:"\u5FAA\u73AF\u5468\u6B21"},{label:()=>{let u;return e(R,{class:v.week,modelValue:t.week,"onUpdate:modelValue":n=>t.week=n},K(u=Object.keys(H).map(n=>e(I,{disabled:t.isSkipHolidays&&(n==="\u5468\u516D"||n==="\u5468\u65E5"),name:n},K(n)?n:{default:()=>[n]})))?u:{default:()=>[u]})}}),e(C,S({label:"\u4E0A\u8BFE\u65F6\u95F4",placeholder:"\u8BF7\u9009\u62E9\u4E0A\u8BFE\u65F6\u95F4"},A,{modelValue:D.value,onClick:()=>c.value=!0}),null),e(w,{title:"\u662F\u5426\u8DF3\u8FC7\u8282\u5047\u65E5"},{value:()=>e(R,{class:v.holdays,modelValue:t.isSkipHolidays,"onUpdate:modelValue":u=>t.isSkipHolidays=u,onChange:()=>{t.isSkipHolidays&&(t.week==="\u5468\u516D"||t.week==="\u5468\u65E5")&&(t.week="")}},{default:()=>[e(I,{name:!0,style:{marginRight:"10px"}},{default:()=>[a("\u662F")]}),e(I,{name:!1},{default:()=>[a("\u5426")]})]})}),e(w,null,{title:()=>e("div",{class:v.tips},[e("img",{class:v.icon,src:fe},null),e("span",null,[a("\u6E29\u99A8\u63D0\u9192")])]),label:()=>e("div",{class:v.tipsContent},[a("1\u3001\u4E91\u9177\u7434\u623F\u65F6\u957F\u6309\u8BFE\u7A0B\u4EBA\u6570\u6263\u51CF\uFF08\u542B\u8001\u5E08\uFF09\uFF0C\u4EE545\u5206\u949F1\u5BF91\u8BFE\u7A0B\u5E08\u751F2\u4EBA\u4E3A\u4F8B\uFF0C\u8BFE\u7A0B\u7ED3\u675F\u540E\u5C06\u6D88\u8017\u65F6\u957F\uFF1A2\u4EBA*45\u5206\u949F=90\u5206\u949F\uFF1B"),e("br",null,null),e("br",null,null),a("2\u3001\u6BCF\u8282\u7EBF\u4E0A\u8BFE\u5E73\u53F0\u8D60\u900110\u5206\u949F\u514D\u8D39\u65F6\u957F\uFF0C\u5206\u522B\u4E3A\u8BFE\u524D5\u5206\u949F\u53CA\u8BFE\u540E5\u5206\u949F\uFF0C\u8D60\u9001\u65F6\u957F\u4E0D\u8BA1\u7B97\u8D39\u7528\uFF1B"),e("br",null,null),e("br",null,null),a("3\u3001\u8BFE\u7A0B\u6D88\u8017\u65F6\u957F\u6309\u6392\u8BFE\u4EBA\u6570\u8BA1\u7B97\uFF0C\u65E0\u8BBA\u5B9E\u9645\u5230\u8BFE\u4EBA\u6570\u662F\u5426\u4E3A\u6392\u8BFE\u4EBA\u6570\uFF0C\u90FD\u4F1A\u6309\u7167\u6392\u8BFE\u4EBA\u6570\u6263\u8D39\uFF1B"),e("br",null,null),e("br",null,null),a("4\u3001\u8BFE\u7A0B\u7ED3\u675F\u540E\u8D39\u7528\u7ACB\u5373\u7ED3\u7B97\uFF1B"),e("br",null,null),e("br",null,null),a("5\u3001\u7434\u623F\u65F6\u957F\u4E0D\u8DB3\u65F6\uFF0C\u60A8\u5C06\u65E0\u6CD5\u6392\u8BFE\uFF0C\u8BF7\u786E\u4FDD\u7434\u623F\u5269\u4F59\u65F6\u957F\u5145\u8DB3\u3002")])}),e(j,{block:!0,type:"primary",round:!0,style:{margin:"0 auto",width:"90%",marginTop:"20px"},onClick:()=>ee()},{default:()=>[a("\u4E0B\u4E00\u6B65")]})]),e(E,{position:"bottom",show:l.value,"onUpdate:show":u=>l.value=u},{default:()=>[e(z,{type:"date",minDate:y().year(2022).toDate(),formatter:Fe,onConfirm:u=>{t.date=y(u).format("YYYY-MM-DD"),l.value=!1,X(y(u).format("YYYY"))},onCancel:()=>l.value=!1},null)]}),e(E,{show:o.value,"onUpdate:show":u=>o.value=u,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0},{default:()=>[e(J,{subjectList:_.value,modelValue:t.subjectId,"onUpdate:modelValue":u=>t.subjectId=u,subjectName:t.subjectName,"onUpdate:subjectName":u=>t.subjectName=u,onSort:()=>o.value=!1},null)]}),e(E,{position:"bottom",show:c.value,"onUpdate:show":u=>c.value=u,round:!0},{default:()=>[e("div",{class:v.picker},[e(z,{modelValue:i.value,"onUpdate:modelValue":u=>i.value=u,type:"time",maxHour:"22",onConfirm:()=>{c.value=!1,console.log(i.value)},onCancel:()=>c.value=!1},null)])]}),e(ve,{modelValue:m.value,"onUpdate:modelValue":u=>m.value=u},{default:()=>[e(Ne,{ref:r,subjectList:_.value,onSetStudents:V},null)]}),e(E,{position:"bottom",class:v.coursePopup,show:p.value,"onUpdate:show":u=>p.value=u,closeable:!0,round:!0},{default:()=>[e($e,{item:t,students:f.value,curriculum:L.value,onClose:()=>{p.value=!1},onComfirm:()=>{ue()}},null)]})])}});export{iu as default};