orchestra-detail.943c00dc.js 15 KB

1
  1. import{by as W,d as N,y as H,aV as P,ag as z,r as E,ah as s,$ as L,c as a,q as m,ai as F,B as J,P as O,aj as $,F as k,ak as V,m as w,_ as K,R as C}from"./index.ffe80dbe.js";import{O as X}from"./index.a0ef77e4.js";import{O as j}from"./index.4ddd16f0.js";import{C as M}from"./countUp.min.9e8207da.js";import{i as G}from"./isSameOrBefore.8aa1af28.js";import{O as R}from"./index.6daa5b04.js";import{G as B,a as y}from"./index.72ca63b9.js";import{L as U}from"./index.cafcb8b5.js";import{D as q}from"./index.ff4fe619.js";import{i as Z}from"./icon_teacher.df08d662.js";import{C as ee}from"./index.ea031708.js";import{I as te}from"./index.7e972106.js";import{T as ae,a as I}from"./index.466e527a.js";import"./index.1d5c6f70.js";import"./index.84851ef1.js";import"./use-tab-status.5a3cd090.js";import"./utils.18cb7a73.js";import"./index.777c6c1a.js";import"./index.b4b77b5a.js";import"./index.02edecb1.js";const se="_gridContainer_1dfkx_1",re="_title_1dfkx_7",oe="_red_1dfkx_21",ie="_name_1dfkx_24",ne="_gridClass_1dfkx_29",le="_teacher_1dfkx_34",ce="_className_1dfkx_40",me="_line_1dfkx_47",ue="_informationBottom_1dfkx_69",de="_codeContainer_1dfkx_72",fe="_codeImg_1dfkx_72",pe="_codeContent_1dfkx_79",he="_codeTitle_1dfkx_82",Ye="_codeName_1dfkx_90",De="_codeQr_1dfkx_97",ve="_codeBtnText_1dfkx_109",ye="_codeTips_1dfkx_119",_e="_close_1dfkx_127",Te="_codeBottom_1dfkx_132",ge="_shareImg_1dfkx_154",we="_shareText_1dfkx_158";var n={gridContainer:se,title:re,red:oe,name:ie,gridClass:ne,teacher:le,className:ce,line:me,informationBottom:ue,codeContainer:de,codeImg:fe,codeContent:pe,codeTitle:he,codeName:Ye,codeQr:De,codeBtnText:ve,codeTips:ye,close:_e,codeBottom:Te,shareImg:ge,shareText:we},A={exports:{}};(function(d,c){(function(l,f){d.exports=f()})(W,function(){return function(l,f){f.prototype.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)}}})})(A);var Q=A.exports;s.extend(G,Q);function Se(d){return typeof d=="function"||Object.prototype.toString.call(d)==="[object Object]"&&!V(d)}var Me=N({name:"detail-information",props:{termTimes:{type:Object,default:{}}},setup(d){const c=H(()=>d.termTimes.start),l=H(()=>d.termTimes.end),f=P(),t=z(),e=E({timeShow:!1,currentData:[s().year()+""],actionText:"\u4E0A\u5B66\u671F",actionType:"up",actionTerm:[{name:"\u4E0A\u5B66\u671F",selected:!0,value:"up"},{name:"\u4E0B\u5B66\u671F",value:"down"}],oPopover:!1,check:[],checkboxRefs:[],isLoading:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},bottomHeight:0,params:{startTime:s(s().year()+c.value).format("YYYY-MM-DD HH:mm:ss"),endTime:s(s().year()+l.value).add(1,"year").subtract(1,"day").format("YYYY-MM-DD HH:mm:ss"),page:1,rows:20},statistics:{},orchestraInfo:{}}),D=i=>{e.actionTerm.forEach(r=>{r.selected=!1}),i.selected=!0,e.actionText=i.name,e.actionType=i.value,i.value==="up"?(e.params.startTime=s(Number(e.currentData[0])+c.value).format("YYYY-MM-DD HH:mm:ss"),e.params.endTime=s(Number(e.currentData[0])+l.value).add(1,"year").subtract(1,"day").format("YYYY-MM-DD HH:mm:ss")):i.value==="down"&&(e.params.startTime=s(Number(e.currentData[0])+l.value).add(1,"year").format("YYYY-MM-DD HH:mm:ss"),e.params.endTime=s(Number(e.currentData[0])+c.value).add(1,"year").subtract(1,"day").format("YYYY-MM-DD HH:mm:ss")),e.oPopover=!1,v()},_=i=>{e.currentData=i.selectedValues;const r=Number(e.currentData[0])+1;e.actionType==="up"?(e.params.startTime=s(r+c.value).format("YYYY-MM-DD HH:mm:ss"),e.params.endTime=s(r+l.value).add(1,"year").subtract(1,"day").format("YYYY-MM-DD HH:mm:ss")):e.actionType==="down"&&(e.params.startTime=s(r+l.value).format("YYYY-MM-DD HH:mm:ss"),e.params.endTime=s(r+c.value).subtract(1,"day").format("YYYY-MM-DD HH:mm:ss")),e.timeShow=!1,v()},S=async()=>{try{const{data:i}=await w.get("/api-school/orchestra/detail/"+f.query.id);e.orchestraInfo=i||{}}catch{}},u=async()=>{try{const{data:i}=await w.post("/api-school/school/schoolSummaryStat",{data:{orchestraId:f.query.id}});e.statistics=i||{},T()}catch{}},o=async()=>{try{if(e.isLoading)return;e.isLoading=!0;const i=await w.post("/api-school/classGroup/page",{data:{...e.params,orchestraId:f.query.id}});e.listState.loading=!1;const r=i.data||{};if(e.list.length>0&&r.current===1)return;const p=r.rows||[];e.list=e.list.concat(p),e.listState.finished=r.current>=r.pages,e.params.page=r.current+1,e.listState.dataShow=e.list.length>0,e.isLoading=!1}catch{e.listState.dataShow=!1,e.listState.finished=!0,e.isLoading=!1}},v=()=>{e.params.page=1,e.list=[],e.listState.dataShow=!0,e.listState.loading=!1,e.listState.finished=!1,o()},T=()=>{K(()=>{const i=e.statistics;new M("currentStudentNum",i.currentStudent||0).start(),new M("time1",i.attendanceRate*100||0).start(),new M("time2",i.homeworkSubmissionRate*100||0).start(),new M("time3",i.practicePassRate*100||0).start()})};return L(async()=>{const i=s(s().year()+c.value).format("YYYY-MM-DD"),r=s(s().year()+l.value).format("YYYY-MM-DD"),p=s().format("YYYY-MM-DD");console.log(p,i);const b=s(p).isBefore(s(i)),x=s(p).isBefore(s(r)),g=s().year();b&&x&&(e.currentData=[g-1+""],e.params.startTime=s(g-1+c.value).format("YYYY-MM-DD HH:mm:ss"),e.params.endTime=s(s().year()+l.value).subtract(1,"day").format("YYYY-MM-DD HH:mm:ss")),!b&&!x&&(e.params.startTime=s(s().year()+c.value).format("YYYY-MM-DD HH:mm:ss"),e.params.endTime=s(s().year()+l.value).add(1,"year").subtract(1,"day").format("YYYY-MM-DD HH:mm:ss")),b&&!x&&(e.params.startTime=s(g+l.value).format("YYYY-MM-DD HH:mm:ss"),e.params.endTime=s(g+c.value).subtract(1,"day").format("YYYY-MM-DD HH:mm:ss"),e.actionTerm.forEach(Y=>{Y.value==="down"?(Y.color="var(--van-primary-color)",e.actionText=Y.text,e.actionType=Y.value):Y.color=""}),e.currentData=[g-1+""],e.actionText="\u4E0B\u5B66\u671F",e.actionType="down",e.actionTerm.forEach(Y=>{Y.value==="down"?Y.selected=!0:Y.selected=!1})),await S(),await u(),await o()}),()=>{let i;return a(k,null,[a("div",{class:["searchGroup","van-hairline--top"]},[a("div",{class:["searchItem",e.timeShow?"searchItem-active":""],onClick:()=>e.timeShow=!0},[e.currentData[0],m("\u5E74 "),a("i",{class:"arrow"},null)]),a("div",{class:["searchItem",e.oPopover?"searchItem-active":""],onClick:()=>e.oPopover=!0},[e.actionText,m(" "),a("i",{class:"arrow"},null)])]),a("div",{style:{height:"calc(100vh - var(--header-height) - var(--van-tabs-line-height) - 1.17333rem)",overflow:"hidden",overflowY:"auto"}},[a(B,{border:!1,class:n.gridContainer},{default:()=>[a(y,null,{default:()=>[a("p",{class:[n.title,n.red]},[a("span",{id:"currentStudentNum"},[e.statistics.studentNum||0]),a("i",null,[m(" \u540D")])]),a("p",{class:n.name},[m("\u5728\u8BFB\u5B66\u751F")])]}),a(y,null,{default:()=>[a("p",{class:[n.title,n.red]},[a("span",{id:"time1"},[e.statistics.attendanceRate||0]),m("%")]),a("p",{class:n.name},[m("\u5230\u8BFE\u7387")])]}),a(y,null,{default:()=>[a("p",{class:[n.title,n.red]},[a("span",{id:"time2"},[e.statistics.homeworkRate||0]),m("%")]),a("p",{class:n.name},[m("\u4F5C\u4E1A\u63D0\u4EA4\u7387")])]}),a(y,null,{default:()=>[a("p",{class:[n.title,n.red]},[a("span",{id:"time3"},[e.statistics.homeworkQualifiedRate||0]),m("%")]),a("p",{class:n.name},[m("\u7EC3\u4E60\u5408\u683C\u7387")])]})]}),e.listState.dataShow?a(U,{finished:e.listState.finished,finishedText:" ",class:[n.liveList],onLoad:o,immediateCheck:!1},Se(i=e.list.map(r=>a("div",{class:[n.gridContainer,n.gridClass]},[a("div",{class:n.className},[a("i",{class:n.line},null),r.name]),a(B,{border:!1,columnNum:3},{default:()=>[a(y,null,{default:()=>[a("p",{class:n.title},[r.preStudentNum||0]),a("p",{class:n.name},[m("\u5728\u8BFB\u5B66\u751F")])]}),a(y,null,{default:()=>[a("p",{class:[n.title,n.teacher,"van-ellipsis"]},[r.teacherName||"-"]),a("p",{class:n.name},[m("\u4F34\u5B66\u6307\u5BFC")])]}),a(y,null,{default:()=>[a("p",{class:n.title},[r.completeCourseScheduleNum||0,m("/"),r.courseScheduleNum||0]),a("p",{class:n.name},[m("\u8BFE\u65F6")])]})]})])))?i:{default:()=>[i]}):a(F,{btnStatus:!1,tips:"\u6682\u65E0\u73ED\u7EA7"},null),e.orchestraInfo.canSignUp&&a(j,{position:"bottom",class:n.informationBottom,onGetHeight:r=>{e.bottomHeight=r}},{default:()=>[a("div",{class:"btnGroup"},[a(J,{round:!0,block:!0,type:"primary",onClick:()=>{t.push({path:"save-share-image",query:{type:"orchestra",id:f.query.id}})}},{default:()=>[m("\u62A5\u540D\u4E8C\u7EF4\u7801")]})])]})]),a(R,{show:e.oPopover,"onUpdate:show":r=>e.oPopover=r,actions:e.actionTerm,onSelect:D,teleport:"body"},null),a(O,{show:e.timeShow,"onUpdate:show":r=>e.timeShow=r,position:"bottom",round:!0,class:"popupBottomSearch",teleport:"body"},{default:()=>[a(q,{modelValue:e.currentData,"onUpdate:modelValue":r=>e.currentData=r,columnsType:["year"],formatter:$,onConfirm:_,onCancel:()=>e.timeShow=!1},null)]})])}}});const He="_gridContainer_1s15u_1",be="_title_1s15u_7",xe="_red_1s15u_16",Ce="_name_1s15u_19",ke="_gridClass_1s15u_24",Ne="_teacher_1s15u_27",Be="_className_1s15u_31",Ie="_line_1s15u_38",Pe="_gridCell_1s15u_46",Ee="_img_1s15u_50",Le="_courseware_1s15u_63",Fe="_teacherDesc_1s15u_69";var h={gridContainer:He,title:be,red:xe,name:Ce,gridClass:ke,teacher:Ne,className:Be,line:Ie,gridCell:Pe,img:Ee,class:"_class_1s15u_31",courseware:Le,teacherDesc:Fe};s.extend(G,Q);function Oe(d){return typeof d=="function"||Object.prototype.toString.call(d)==="[object Object]"&&!V(d)}var $e=N({name:"plan",props:{termTimes:{type:Object,default:{}},height:{type:[String,Number],default:0}},setup(d){const c=H(()=>d.termTimes.start),l=H(()=>d.termTimes.end),f=P(),t=E({timeShow:!1,currentData:[s().year()+""],showPopover:!1,actionText:"\u4E0A\u5B66\u671F",actionType:"up",actionTerm:[{name:"\u4E0A\u5B66\u671F",selected:!0,value:"up"},{name:"\u4E0B\u5B66\u671F",value:"down"}],oPopover:!1,check:[],checkboxRefs:[],showQrcode:!1,isLoading:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{startTime:s(s().year()+c.value).format("YYYY-MM-DD HH:mm:ss"),endTime:s(s().year()+l.value).add(1,"year").subtract(1,"day").format("YYYY-MM-DD HH:mm:ss"),page:1,rows:20}}),e=u=>{t.actionTerm.forEach(o=>{o.selected=!1}),u.selected=!0,t.actionText=u.name,t.actionType=u.value,u.value==="up"?(t.params.startTime=s(Number(t.currentData[0])+c.value).format("YYYY-MM-DD HH:mm:ss"),t.params.endTime=s(Number(t.currentData[0])+l.value).add(1,"year").subtract(1,"day").format("YYYY-MM-DD HH:mm:ss")):u.value==="down"&&(t.params.startTime=s(Number(t.currentData[0])+l.value).add(1,"year").format("YYYY-MM-DD HH:mm:ss"),t.params.endTime=s(Number(t.currentData[0])+c.value).add(1,"year").subtract(1,"day").format("YYYY-MM-DD HH:mm:ss")),t.oPopover=!1,S()},D=u=>{t.currentData=u.selectedValues;const o=Number(t.currentData[0])+1;t.actionType==="up"?(t.params.startTime=s(o+c.value).format("YYYY-MM-DD HH:mm:ss"),t.params.endTime=s(o+l.value).add(1,"year").subtract(1,"day").format("YYYY-MM-DD HH:mm:ss")):t.actionType==="down"&&(t.params.startTime=s(o+l.value).format("YYYY-MM-DD HH:mm:ss"),t.params.endTime=s(o+c.value).subtract(1,"day").format("YYYY-MM-DD HH:mm:ss")),t.timeShow=!1,S()},_=async()=>{try{if(t.isLoading)return;t.isLoading=!0;const u=await w.post("/api-school/classGroup/page",{data:{...t.params,orchestraId:f.query.id}});t.listState.loading=!1;const o=u.data||{};if(t.list.length>0&&o.current===1)return;const v=o.rows||[];t.list=t.list.concat(v||[]),t.listState.finished=o.current>=o.pages,t.params.page=o.current+1,t.listState.dataShow=t.list.length>0,t.isLoading=!1}catch{t.listState.dataShow=!1,t.listState.finished=!0,t.isLoading=!1}},S=()=>{t.params.page=1,t.list=[],t.listState.dataShow=!0,t.listState.loading=!1,t.listState.finished=!1,_()};return L(async()=>{const u=s(s().year()+c.value).format("YYYY-MM-DD"),o=s(s().year()+l.value).format("YYYY-MM-DD"),v=s().format("YYYY-MM-DD");console.log(v,u);const T=s(v).isBefore(s(u)),i=s(v).isBefore(s(o)),r=s().year();T&&i&&(t.currentData=[r-1+""],t.params.startTime=s(r-1+c.value).format("YYYY-MM-DD HH:mm:ss"),t.params.endTime=s(s().year()+l.value).subtract(1,"day").format("YYYY-MM-DD HH:mm:ss")),!T&&!i&&(t.params.startTime=s(s().year()+c.value).format("YYYY-MM-DD HH:mm:ss"),t.params.endTime=s(s().year()+l.value).add(1,"year").subtract(1,"day").format("YYYY-MM-DD HH:mm:ss")),T&&!i&&(t.params.startTime=s(r+l.value).format("YYYY-MM-DD HH:mm:ss"),t.params.endTime=s(r+c.value).subtract(1,"day").format("YYYY-MM-DD HH:mm:ss"),t.actionTerm.forEach(p=>{p.value==="down"?(p.color="var(--van-primary-color)",t.actionText=p.text,t.actionType=p.value):p.color=""}),t.currentData=[r-1+""],t.actionText="\u4E0B\u5B66\u671F",t.actionType="down",t.actionTerm.forEach(p=>{p.value==="down"?p.selected=!0:p.selected=!1})),await _()}),()=>{let u;return a("div",null,[a("div",{class:["searchGroup","van-hairline--top"]},[a("div",{class:["searchItem",t.timeShow?"searchItem-active":""],onClick:()=>t.timeShow=!0},[t.currentData[0],m("\u5E74 "),a("i",{class:"arrow"},null)]),a("div",{class:["searchItem",t.oPopover?"searchItem-active":""],onClick:()=>t.oPopover=!0},[t.actionText,m(" "),a("i",{class:"arrow"},null)])]),a("div",{style:"height: calc(100vh - var(--header-height) - var(--van-tabs-line-height) - 1.17333rem); overflow: hidden; overflow-y: auto;"},[t.listState.dataShow?a(U,{finished:t.listState.finished,finishedText:" ",class:[h.liveList],onLoad:_,immediateCheck:!1},Oe(u=t.list.map(o=>a("div",{class:[h.gridContainer,h.gridClass]},[a("div",{class:h.className},[a("i",{class:h.line},null),o.name]),a(ee,{center:!0,class:h.gridCell},{icon:()=>a(te,{class:h.img,src:o.teacherAvatar||Z,fit:"cover"},null),title:()=>a(k,null,[a("p",{class:h.class},[o.completeCourseScheduleNum||0,m("/"),o.courseScheduleNum||0]),a("p",{class:h.teacherDesc},[m("\u8BFE\u65F6")])]),value:()=>a(k,null,[a("p",{class:h.courseware},[o.newestLessonPlanDetailName||"-"]),a("p",{class:h.teacherDesc},[m("\u6700\u65B0\u8BFE\u4EF6")])])})])))?u:{default:()=>[u]}):a(F,{btnStatus:!1,tips:"\u6682\u65E0\u73ED\u7EA7"},null)]),a(R,{show:t.oPopover,"onUpdate:show":o=>t.oPopover=o,actions:t.actionTerm,onSelect:e,teleport:"body"},null),a(O,{show:t.timeShow,"onUpdate:show":o=>t.timeShow=o,position:"bottom",round:!0,class:"popupBottomSearch",teleport:"body"},{default:()=>[a(q,{modelValue:t.currentData,"onUpdate:modelValue":o=>t.currentData=o,columnsType:["year"],minDate:new Date(2010,0,1),maxDate:new Date(2055,11,31),formatter:$,onConfirm:D,onCancel:()=>t.timeShow=!1},null)]})])}}});const Ve="_orchestraDetail_xtf76_1";var je={orchestraDetail:Ve},lt=N({name:"orchestra-detail",setup(){const d=sessionStorage.getItem("orchestra-detail-tab"),c=C(d||"information");sessionStorage.removeItem("orchestra-detail-tab");const l=C("auto"),f=C({start:"09-01",end:"03-01"});return(async()=>{const{data:e}=await w.get("/api-school/sysParamConfig/queryByParamNameList",{params:{paramNames:"last_term_time,next_term_time"}});(e||[]).forEach(D=>{D.paramName==="last_term_time"?f.value.start=D.paramValue:D.paramName==="next_term_time"&&(f.value.end=D.paramValue)})})(),()=>a("div",{class:je.orchestraDetail},[a(j,{position:"top",onGetHeight:e=>{l.value=e,document.documentElement.style.setProperty("--header-height",e+"px")}},{default:()=>[a(X,{border:!1},null)]}),a(ae,{sticky:!0,lineWidth:20,lineHeight:4,active:c.value,"onUpdate:active":e=>c.value=e,animated:!0,offsetTop:l.value,swipeable:!0},{default:()=>[a(I,{title:"\u4E50\u56E2\u4FE1\u606F",name:"information"},{default:()=>[a(Me,{termTimes:f.value},null)]}),a(I,{title:"\u8BAD\u7EC3\u8FDB\u5EA6",name:"plan"},{default:()=>[a($e,{height:l.value,termTimes:f.value},null)]})]})])}});export{lt as default};