1 |
- import{M as Ye}from"./index-fcc8c1c4.js";import{j as re,d as z,ag as le,aB as _e,E as B,g as a,aC as Re,i as $,aD as Be,G as Oe,an as xe,t as de,Y as me,aE as Ee,p as se,n as Se,v as H,am as Ge,aF as fe,w as ne,aG as Fe,P as he,aH as ue,aI as Ve,m as Pe,f as ge,B as Z,D as Le,a as ve,O as we,o as pe,S as C,h as E,R as He,T as We,N as Ue}from"./index-7efc3749.js";import{M as Ke}from"./index-2b5b03fc.js";import{i as qe}from"./icon-student-default-4c78efb2.js";import{M as je}from"./index-272bac45.js";import{u as Xe}from"./index-12481d0a.js";import{g as ze}from"./utils-f47fb0b9.js";import{D as Qe,a as Je}from"./index-500b9e7e.js";import{C as K}from"./index-4a491eda.js";import{R as Ze,C as ee}from"./index-c0dcca95.js";import{P as Me}from"./index-f809fef2.js";import{S as $e,b as et,a as J}from"./index-713253ef.js";import{C as Ae}from"./index-a1fc7980.js";import{G as Ie,a as q}from"./index-f7d0f5db.js";import{L as tt}from"./index-046fabcc.js";import"./index-8bbe635b.js";import"./index-1b5fff5b.js";import"./use-tab-status-34b987e0.js";const[at,M,U]=re("calendar"),lt=e=>U("monthTitle",e.getFullYear(),e.getMonth()+1);function ye(e,d){const t=e.getFullYear(),s=d.getFullYear();if(t===s){const g=e.getMonth(),D=d.getMonth();return g===D?0:g>D?1:-1}return t>s?1:-1}function G(e,d){const t=ye(e,d);if(t===0){const s=e.getDate(),g=d.getDate();return s===g?0:s>g?1:-1}return t}const oe=e=>new Date(e),Te=e=>Array.isArray(e)?e.map(oe):oe(e);function Ce(e,d){const t=oe(e);return t.setDate(t.getDate()+d),t}const De=e=>Ce(e,-1),Ne=e=>Ce(e,1),be=()=>{const e=new Date;return e.setHours(0,0,0,0),e};function st(e){const d=e[0].getTime();return(e[1].getTime()-d)/(1e3*60*60*24)+1}const[nt]=re("calendar-day");var ot=z({name:nt,props:{item:le(Object),color:String,index:Number,offset:_e(0),rowHeight:String},emits:["click"],setup(e,{emit:d,slots:t}){const s=B(()=>{var o;const{item:i,index:w,color:Y,offset:_,rowHeight:V}=e,O={height:V};if(i.type==="placeholder")return O.width="100%",O;if(w===0&&(O.marginLeft=`${100*_/7}%`),Y)switch(i.type){case"end":case"start":case"start-end":case"multiple-middle":case"multiple-selected":O.background=Y;break;case"middle":O.color=Y;break}return _+(((o=i.date)==null?void 0:o.getDate())||1)>28&&(O.marginBottom=0),O}),g=()=>{e.item.type!=="disabled"&&d("click",e.item)},D=()=>{const{topInfo:o}=e.item;if(o||t["top-info"])return a("div",{class:M("top-info")},[t["top-info"]?t["top-info"](e.item):o])},k=()=>{const{bottomInfo:o}=e.item;if(o||t["bottom-info"])return a("div",{class:M("bottom-info")},[t["bottom-info"]?t["bottom-info"](e.item):o])},v=()=>{const{item:o,color:i,rowHeight:w}=e,{type:Y,text:_}=o,V=[D(),_,k()];return Y==="selected"?a("div",{class:M("selected-day"),style:{width:w,height:w,background:i}},[V]):V};return()=>{const{type:o,className:i}=e.item;return o==="placeholder"?a("div",{class:M("day"),style:s.value},null):a("div",{role:"gridcell",style:s.value,class:[M("day",o),i],tabindex:o==="disabled"?void 0:-1,onClick:g},[v()])}}});const[rt]=re("calendar-month"),it={date:le(Date),type:String,color:String,minDate:le(Date),maxDate:le(Date),showMark:Boolean,rowHeight:de,formatter:Function,lazyRender:Boolean,currentDate:[Date,Array],allowSameDay:Boolean,showSubtitle:Boolean,showMonthTitle:Boolean,firstDayOfWeek:Number};var ct=z({name:rt,props:it,emits:["click"],setup(e,{emit:d,slots:t}){const[s,g]=Re(),D=$(),k=$(),v=Be(k),o=B(()=>lt(e.date)),i=B(()=>Oe(e.rowHeight)),w=B(()=>{const f=e.date.getDay();return e.firstDayOfWeek?(f+7-e.firstDayOfWeek)%7:f}),Y=B(()=>ze(e.date.getFullYear(),e.date.getMonth()+1)),_=B(()=>s.value||!e.lazyRender),V=()=>o.value,O=f=>{const T=A=>e.currentDate.some(S=>G(S,A)===0);if(T(f)){const A=De(f),S=Ne(f),I=T(A),l=T(S);return I&&l?"multiple-middle":I?"end":l?"start":"multiple-selected"}return""},j=f=>{const[T,A]=e.currentDate;if(!T)return"";const S=G(f,T);if(!A)return S===0?"start":"";const I=G(f,A);return e.allowSameDay&&S===0&&I===0?"start-end":S===0?"start":I===0?"end":S>0&&I<0?"middle":""},Q=f=>{const{type:T,minDate:A,maxDate:S,currentDate:I}=e;if(G(f,A)<0||G(f,S)>0)return"disabled";if(I===null)return"";if(Array.isArray(I)){if(T==="multiple")return O(f);if(T==="range")return j(f)}else if(T==="single")return G(f,I)===0?"selected":"";return""},c=f=>{if(e.type==="range"){if(f==="start"||f==="end")return U(f);if(f==="start-end")return`${U("start")}/${U("end")}`}},n=()=>{if(e.showMonthTitle)return a("div",{class:M("month-title")},[t["month-title"]?t["month-title"]({date:e.date,text:o.value}):o.value])},h=()=>{if(e.showMark&&_.value)return a("div",{class:M("month-mark")},[e.date.getMonth()+1])},m=B(()=>{const f=Math.ceil((Y.value+w.value)/7);return Array(f).fill({type:"placeholder"})}),W=B(()=>{const f=[],T=e.date.getFullYear(),A=e.date.getMonth();for(let S=1;S<=Y.value;S++){const I=new Date(T,A,S),l=Q(I);let r={date:I,type:l,text:S,bottomInfo:c(l)};e.formatter&&(r=e.formatter(r)),f.push(r)}return f}),p=B(()=>W.value.filter(f=>f.type==="disabled")),X=(f,T)=>{if(D.value){const A=me(D.value),S=m.value.length,l=(Math.ceil((T.getDate()+w.value)/7)-1)*A.height/S;Ee(f,A.top+l+f.scrollTop-me(f).top)}},ie=(f,T)=>a(ot,{item:f,index:T,color:e.color,offset:w.value,rowHeight:i.value,onClick:A=>d("click",A)},se(t,["top-info","bottom-info"])),ce=()=>a("div",{ref:D,role:"grid",class:M("days")},[h(),(_.value?W:m).value.map(ie)]);return xe({getTitle:V,getHeight:()=>v.value,setVisible:g,scrollToDate:X,disabledDays:p}),()=>a("div",{class:M("month"),ref:k},[n(),ce()])}});const[ut]=re("calendar-header");var dt=z({name:ut,props:{date:Date,title:String,subtitle:String,showTitle:Boolean,showSubtitle:Boolean,firstDayOfWeek:Number},emits:["clickSubtitle"],setup(e,{slots:d,emit:t}){const s=()=>{if(e.showTitle){const v=e.title||U("title"),o=d.title?d.title():v;return a("div",{class:M("header-title")},[o])}},g=v=>t("clickSubtitle",v),D=()=>{if(e.showSubtitle){const v=d.subtitle?d.subtitle({date:e.date,text:e.subtitle}):e.subtitle;return a("div",{class:M("header-subtitle"),onClick:g},[v])}},k=()=>{const{firstDayOfWeek:v}=e,o=U("weekdays"),i=[...o.slice(v,7),...o.slice(0,v)];return a("div",{class:M("weekdays")},[i.map(w=>a("span",{class:M("weekday")},[w]))])};return()=>a("div",{class:M("header")},[s(),D(),k()])}});const mt={show:Boolean,type:Se("single"),title:String,color:String,round:H,readonly:Boolean,poppable:H,maxRange:Ge(null),position:Se("bottom"),teleport:[String,Object],showMark:H,showTitle:H,formatter:Function,rowHeight:de,confirmText:String,rangePrompt:String,lazyRender:H,showConfirm:H,defaultDate:[Date,Array],allowSameDay:Boolean,showSubtitle:H,closeOnPopstate:H,showRangePrompt:H,confirmDisabledText:String,closeOnClickOverlay:H,safeAreaInsetTop:Boolean,safeAreaInsetBottom:H,minDate:{type:Date,validator:fe,default:be},maxDate:{type:Date,validator:fe,default:()=>{const e=be();return new Date(e.getFullYear(),e.getMonth()+6,e.getDate())}},firstDayOfWeek:{type:de,default:0,validator:e=>e>=0&&e<=6}};var ft=z({name:at,props:mt,emits:["select","confirm","unselect","monthShow","overRange","update:show","clickSubtitle"],setup(e,{emit:d,slots:t}){const s=(l,r=e.minDate,y=e.maxDate)=>G(l,r)===-1?r:G(l,y)===1?y:l,g=(l=e.defaultDate)=>{const{type:r,minDate:y,maxDate:b,allowSameDay:R}=e;if(l===null)return l;const N=be();if(r==="range"){Array.isArray(l)||(l=[]);const P=s(l[0]||N,y,R?b:De(b)),x=s(l[1]||N,R?y:Ne(y));return[P,x]}return r==="multiple"?Array.isArray(l)?l.map(P=>s(P)):[s(N)]:((!l||Array.isArray(l))&&(l=N),s(l))};let D;const k=$(),v=$({text:"",date:void 0}),o=$(g()),[i,w]=Xe(),Y=B(()=>e.firstDayOfWeek?+e.firstDayOfWeek%7:0),_=B(()=>{const l=[],r=new Date(e.minDate);r.setDate(1);do l.push(new Date(r)),r.setMonth(r.getMonth()+1);while(ye(r,e.maxDate)!==1);return l}),V=B(()=>{if(o.value){if(e.type==="range")return!o.value[0]||!o.value[1];if(e.type==="multiple")return!o.value.length}return!o.value}),O=()=>o.value,j=()=>{const l=Ve(k.value),r=l+D,y=_.value.map((x,L)=>i.value[L].getHeight()),b=y.reduce((x,L)=>x+L,0);if(r>b&&l>0)return;let R=0,N;const P=[-1,-1];for(let x=0;x<_.value.length;x++){const L=i.value[x];R<=r&&R+y[x]>=l&&(P[1]=x,N||(N=L,P[0]=x),i.value[x].showed||(i.value[x].showed=!0,d("monthShow",{date:L.date,title:L.getTitle()}))),R+=y[x]}_.value.forEach((x,L)=>{const ke=L>=P[0]-1&&L<=P[1]+1;i.value[L].setVisible(ke)}),N&&(v.value={text:N.getTitle(),date:N.date})},Q=l=>{ue(()=>{_.value.some((r,y)=>ye(r,l)===0?(k.value&&i.value[y].scrollToDate(k.value,l),!0):!1),j()})},c=()=>{if(!(e.poppable&&!e.show))if(o.value){const l=e.type==="single"?o.value:o.value[0];fe(l)&&Q(l)}else ue(j)},n=()=>{e.poppable&&!e.show||(ue(()=>{D=Math.floor(me(k).height)}),c())},h=(l=g())=>{o.value=l,c()},m=l=>{const{maxRange:r,rangePrompt:y,showRangePrompt:b}=e;return r&&st(l)>+r?(b&&ge(y||U("rangePrompt",r)),d("overRange"),!1):!0},W=()=>{var l;return d("confirm",(l=o.value)!=null?l:Te(o.value))},p=(l,r)=>{const y=b=>{o.value=b,d("select",Te(b))};if(r&&e.type==="range"&&!m(l)){y([l[0],Ce(l[0],+e.maxRange-1)]);return}y(l),r&&!e.showConfirm&&W()},X=(l,r,y)=>{var b;return(b=l.find(R=>G(r,R.date)===-1&&G(R.date,y)===-1))==null?void 0:b.date},ie=B(()=>i.value.reduce((l,r)=>{var y,b;return l.push(...(b=(y=r.disabledDays)==null?void 0:y.value)!=null?b:[]),l},[])),ce=l=>{if(e.readonly||!l.date)return;const{date:r}=l,{type:y}=e;if(y==="range"){if(!o.value){p([r]);return}const[b,R]=o.value;if(b&&!R){const N=G(r,b);if(N===1){const P=X(ie.value,b,r);if(P){const x=De(P);G(b,x)===-1?p([b,x]):p([r])}else p([b,r],!0)}else N===-1?p([r]):e.allowSameDay&&p([r,r],!0)}else p([r])}else if(y==="multiple"){if(!o.value){p([r]);return}const b=o.value,R=b.findIndex(N=>G(N,r)===0);if(R!==-1){const[N]=b.splice(R,1);d("unselect",oe(N))}else e.maxRange&&b.length>=+e.maxRange?ge(e.rangePrompt||U("rangePrompt",e.maxRange)):p([...b,r])}else p(r,!0)},f=l=>d("update:show",l),T=(l,r)=>{const y=r!==0||!e.showSubtitle;return a(ct,Pe({ref:w(r),date:l,currentDate:o.value,showMonthTitle:y,firstDayOfWeek:Y.value},se(e,["type","color","minDate","maxDate","showMark","formatter","rowHeight","lazyRender","showSubtitle","allowSameDay"]),{onClick:ce}),se(t,["top-info","bottom-info","month-title"]))},A=()=>{if(t.footer)return t.footer();if(e.showConfirm){const l=t["confirm-text"],r=V.value,y=r?e.confirmDisabledText:e.confirmText;return a(Z,{round:!0,block:!0,type:"primary",color:e.color,class:M("confirm"),disabled:r,nativeType:"button",onClick:W},{default:()=>[l?l({disabled:r}):y||U("confirm")]})}},S=()=>a("div",{class:[M("footer"),{"van-safe-area-bottom":e.safeAreaInsetBottom}]},[A()]),I=()=>a("div",{class:M()},[a(dt,{date:v.value.date,title:e.title,subtitle:v.value.text,showTitle:e.showTitle,showSubtitle:e.showSubtitle,firstDayOfWeek:Y.value,onClickSubtitle:l=>d("clickSubtitle",l)},se(t,["title","subtitle"])),a("div",{ref:k,class:M("body"),onScroll:j},[_.value.map(T)]),S()]);return ne(()=>e.show,n),ne(()=>[e.type,e.minDate,e.maxDate],()=>h(g(o.value))),ne(()=>e.defaultDate,(l=null)=>{o.value=l,c()}),xe({reset:h,scrollToDate:Q,getSelectedDate:O}),Fe(n),()=>e.poppable?a(he,{show:e.show,class:M("popup"),round:e.round,position:e.position,closeable:e.showTitle||e.showSubtitle,teleport:e.teleport,closeOnPopstate:e.closeOnPopstate,safeAreaInsetTop:e.safeAreaInsetTop,closeOnClickOverlay:e.closeOnClickOverlay,"onUpdate:show":f},{default:I}):I()}});const ht=Le(ft),gt="_visitList_oa0b7_1",yt="_search_oa0b7_10",Dt="_logo_oa0b7_18",bt="_teacher_info_oa0b7_46",vt="_memberLogo_oa0b7_57",wt="_userName_oa0b7_64",pt="_orchestraName_oa0b7_68",Ct="_btnWrap_oa0b7_75",kt="_cancelBtn_oa0b7_79",St="_okBtn_oa0b7_86",F={visitList:gt,"van-tab":"_van-tab_oa0b7_7",search:yt,"van-search":"_van-search_oa0b7_10","data-content":"_data-content_oa0b7_13",logo:Dt,"van-row-item":"_van-row-item_oa0b7_26",teacher_info:bt,memberLogo:vt,userName:wt,orchestraName:pt,btnWrap:Ct,cancelBtn:kt,okBtn:St},Mt="data:image/png;base64,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",Tt="_trainModel_1lli7_1",xt="_cellTitle_1lli7_11",At="_calendarColor_1lli7_20",It="_studentCell_1lli7_24",Nt="_searchArray_1lli7_40",Yt="_box_1lli7_52",_t="_active_1lli7_65",u={trainModel:Tt,cellTitle:xt,"search-group":"_search-group_1lli7_15",calendarColor:At,studentCell:It,"visit-tips":"_visit-tips_1lli7_27",searchArray:Nt,"title-style":"_title-style_1lli7_47",box:Yt,"box-up":"_box-up_1lli7_58",active:_t,"box-down":"_box-down_1lli7_68","btn-group":"_btn-group_1lli7_85","submit-group":"_submit-group_1lli7_103"},Rt=e=>ve.get("/api-web/schoolCooperationOrgan/musicGroupPage",{params:e}),Bt=e=>ve.get("/api-web/schoolCooperationOrgan/musicGroupClassPage",{params:e});function te(e){let d=new Date(e.replace(/-/g,"/")).getTime(),t=new Date(e);t.getDay()==0&&(d-=7*24*60*60*1e3);let s=d-(t.getDay()-1)*24*60*60*1e3,g=new Date(s),D=g.getFullYear(),k=g.getMonth()+1<10?"0"+(g.getMonth()+1):g.getMonth()+1,v=g.getDate()<10?"0"+g.getDate():g.getDate();return D+"-"+k+"-"+v}function ae(e){let d=new Date(e.replace(/-/g,"/")).getTime(),s=7-new Date(e).getDay();s==7&&(s=0);let g=d+s*24*60*60*1e3,D=new Date(g),k=D.getFullYear(),v=D.getMonth()+1<10?"0"+(D.getMonth()+1):D.getMonth()+1,o=D.getDate()<10?"0"+D.getDate():D.getDate();return k+"-"+v+"-"+o}const Ot=z({props:{selectValues:{type:Object,default:()=>{}},defaultTime:{type:Number,default:0}},name:"train-model",emits:["load"],setup(e,{emit:d}){const t=we({showCalendar:!1,showMusicGroup:!1,musicGroupList:[],showClass:!1,classList:[],minDate:new Date(2e3,0,1),defaultDate:[],memberFlag:"",startDay:null,endDay:null,calendarStatus:!1,search:null,searchArray:[null,null,null,null],searchType:{totalPlayTime:null,trainNum:null,trainDay:null,recordNum:null},organId:"",organName:"全部分部",musicGroupId:"",popupMusicGroupId:[],musicGroupName:"全部乐团",classId:"",popupClassId:[],className:"全部班级"}),s=$(),g=B(()=>`${C(t.startDay).format("YYYY/MM/DD")} - ${C(t.endDay).format("YYYY/MM/DD")}`),D=c=>{const n=c.selectedOptions[0];t.musicGroupId=n.value,t.musicGroupName=n.text,t.classId="",t.className="全部班级",t.showMusicGroup=!1,o()},k=c=>{const n=c.selectedOptions[0];t.classId=n.value,t.className=n.text,t.showClass=!1},v=async()=>{try{const{data:c}=await Rt({organId:t.organId}),n=c||[],h=[{text:"全部乐团",value:""}];n.forEach(m=>{h.push({text:m.name,value:m.id})}),t.musicGroupList=h}catch(c){}},o=async()=>{try{const{data:c}=await Bt({organId:t.organId,musicGroupId:t.musicGroupId}),n=c||[],h=[{text:"全部班级",value:""}];n.forEach(m=>{h.push({text:m.name,value:m.id})}),t.classList=h}catch(c){}},i=(c,n)=>{c==="member"&&(t.memberFlag=n)},w=c=>{if(c!=null){let n=t.searchArray;n.forEach((h,m)=>{m!=c&&(n[m]=null)}),n[c]=="ASC"?n[c]="DESC":n[c]=="DESC"?n[c]=null:n[c]="ASC"}Y()},Y=()=>{const c=t.searchArray;let n=null,h=null;c.forEach((p,X)=>{p&&(n=X,h=p)});const m=["totalPlayTime","trainNum","trainDay","recordNum"];let W={search:t.search,memberFlag:t.memberFlag,startTime:t.startDay,endTime:t.endDay,classGroupId:t.classId,musicGroupId:t.musicGroupId,organId:t.organId,page:1,sort:m[n],order:h};d("load",W)},_=()=>{var c;(c=s.value)==null||c.toggle(!1)},V=()=>{_(),Y()},O=()=>{let n=e.defaultTime*7,h=new Date,m=new Date;n>0?(h=te(C().add(n,"day").format("YYYY-MM-DD")),m=ae(C().add(n,"day").format("YYYY-MM-DD"))):(h=te(C().subtract(Math.abs(n),"day").format("YYYY-MM-DD")),m=ae(C().subtract(Math.abs(n),"day").format("YYYY-MM-DD"))),t.defaultDate=[new Date(h),new Date(m)],t.startDay=h,t.endDay=m,t.memberFlag="",t.musicGroupId="",t.musicGroupName="全部乐团",t.classId="",t.className="全部班级",V()},j=c=>{let[n,h]=c;if(n){const m=C(n).get("day");m===0?n=C(n).subtract(6,"day"):n=C(n).subtract(m-1,"day")}if(n){const m=7-C(n).get("day");m<7&&(h=C(n).add(m,"day"))}t.defaultDate=[new Date(n.valueOf()),new Date(h.valueOf())]},Q=c=>{let[n,h]=c;if(t.showCalendar=!1,n){const m=C(n).get("day");m===0?n=C(n).subtract(6,"day"):n=C(n).subtract(m-1,"day")}if(h){const m=7-C(h).get("day");m<7&&(h=C(h).add(m,"day"))}t.calendarStatus=!0,t.startDay=C(n).format("YYYY-MM-DD"),t.endDay=C(h).format("YYYY-MM-DD")};return pe(async()=>{let n=e.defaultTime*7,h=new Date,m=new Date;const W=["totalPlayTime","trainNum","trainDay","recordNum"];if(e.selectValues.sort){const p=W.findIndex(X=>X===e.selectValues.sort);t.searchArray[p]=e.selectValues.order}e.selectValues.startTime&&e.selectValues.endTime?(h=e.selectValues.startTime,m=e.selectValues.endTime):n>0?(h=te(C().add(n,"day").format("YYYY-MM-DD")),m=ae(C().add(n,"day").format("YYYY-MM-DD"))):(h=te(C().subtract(Math.abs(n),"day").format("YYYY-MM-DD")),m=ae(C().subtract(Math.abs(n),"day").format("YYYY-MM-DD"))),t.defaultDate=[new Date(h),new Date(m)],t.startDay=h,t.endDay=m,t.memberFlag=e.selectValues.memberFlag||"",t.musicGroupId=e.selectValues.musicGroupId,await v(),e.selectValues.musicGroupId&&(t.popupMusicGroupId=[e.selectValues.musicGroupId],await o(),t.musicGroupList.forEach(p=>{p.value===t.musicGroupId&&(t.musicGroupName=p.text)})),e.selectValues.classGroupId&&(t.classId=e.selectValues.classGroupId,t.popupClassId=[t.classId],t.classList.forEach(p=>{p.value===t.classId&&(t.className=p.text)})),w()}),()=>a("div",{class:u.trainModel},[a(je,{placeholder:"学生姓名或手机号",onSearch:c=>{t.search=c,Y()}},{left:()=>a(Qe,{class:u.patrolDetailDropDown,style:{"padding-right":"10px"},closeOnClickOutside:!1},{default:()=>[a(Je,{title:"筛选",ref:s},{default:()=>[a("div",{class:"search-group"},[a(K,{title:"日期",isLink:!0,onClick:()=>{t.showCalendar=!0,t.calendarStatus=!1},titleClass:u.cellTitle,value:g.value,valueClass:u.calendarColor,class:u.studentCell},null),a(K,{title:"是否会员",titleClass:u.cellTitle,class:u.studentCell},{label:()=>a("div",{class:u["btn-group"]},[a(Z,{plain:t.memberFlag==="",round:!0,type:t.memberFlag===""?"primary":"default",onClick:()=>i("member","")},{default:()=>[E("全部学员")]}),a(Z,{plain:t.memberFlag==="1",round:!0,type:t.memberFlag==="1"?"primary":"default",onClick:()=>i("member","1")},{default:()=>[E("会员学员")]}),a(Z,{plain:t.memberFlag==="0",round:!0,type:t.memberFlag==="0"?"primary":"default",onClick:()=>i("member","0")},{default:()=>[E("普通学员")]})])}),a(K,{title:"乐团",isLink:!0,onClick:()=>t.showMusicGroup=!0,titleClass:u.cellTitle,value:t.musicGroupName,valueClass:u.calendarColor,class:u.studentCell},null),a(K,{title:"班级",isLink:!0,onClick:()=>{if(!t.musicGroupId){ge("请选择乐团");return}t.showClass=!0},titleClass:u.cellTitle,value:t.className,valueClass:u.calendarColor,class:u.studentCell},null)]),a("div",{class:[u["submit-group"],"van-hairline--top"]},[a(Z,{round:!0,block:!0,onClick:O,style:{marginRight:"10px"}},{default:()=>[E("重置")]}),a(Z,{type:"primary",round:!0,block:!0,onClick:V},{default:()=>[E("确认")]})])]})]})}),a(Ze,{class:u.searchArray},{default:()=>[a(ee,{span:"6",class:u["title-style"],onClick:()=>w(0)},{default:()=>[E("训练时长"),a("div",null,[a("i",{class:[u.box,u["box-up"],t.searchArray[0]=="ASC"&&u.active],style:"margin-bottom: 0.03rem"},null),a("i",{class:[u.box,u["box-down"],t.searchArray[0]==="DESC"&&u.active]},null)])]}),a(ee,{span:"6",class:u["title-style"],onClick:()=>w(1)},{default:()=>[E("训练次数"),a("div",null,[a("i",{class:[u.box,u["box-up"],t.searchArray[1]=="ASC"&&u.active],style:"margin-bottom: 0.03rem"},null),a("i",{class:[u.box,u["box-down"],t.searchArray[1]==="DESC"&&u.active]},null)])]}),a(ee,{span:"6",class:u["title-style"],onClick:()=>w(2)},{default:()=>[E("训练天数"),a("div",null,[a("i",{class:[u.box,u["box-up"],t.searchArray[2]=="ASC"&&u.active],style:"margin-bottom: 0.03rem"},null),a("i",{class:[u.box,u["box-down"],t.searchArray[2]==="DESC"&&u.active]},null)])]}),a(ee,{span:"6",class:u["title-style"],onClick:()=>w(3)},{default:()=>[E("评测次数"),a("div",null,[a("i",{class:[u.box,u["box-up"],t.searchArray[3]=="ASC"&&u.active],style:"margin-bottom: 0.03rem"},null),a("i",{class:[u.box,u["box-down"],t.searchArray[3]==="DESC"&&u.active]},null)])]})]}),a(ht,{show:t.showCalendar,"onUpdate:show":[c=>t.showCalendar=c,c=>{t.calendarStatus||(t.defaultDate=[new Date(t.startDay),new Date(t.endDay)])}],minDate:t.minDate,defaultDate:t.defaultDate,firstDayOfWeek:1,color:"#01c1b5",type:"range",onSelect:j,onConfirm:Q},null),a(he,{show:t.showMusicGroup,"onUpdate:show":c=>t.showMusicGroup=c,position:"bottom",round:!0},{default:()=>[a(Me,{columns:t.musicGroupList,showToolbar:!0,modelValue:t.popupMusicGroupId,"onUpdate:modelValue":c=>t.popupMusicGroupId=c,onCancel:()=>t.showMusicGroup=!1,onConfirm:D},null)]}),a(he,{show:t.showClass,"onUpdate:show":c=>t.showClass=c,position:"bottom",round:!0},{default:()=>[a(Me,{columns:t.classList,showToolbar:!0,modelValue:t.popupClassId,"onUpdate:modelValue":c=>t.popupClassId=c,onCancel:()=>t.showClass=!1,onConfirm:k},null)]})])}}),Et=z({name:"skeleton-modal",props:{show:{type:Boolean,default:!1},showCount:{type:Array,default:()=>[1,2,3,4,5]}},setup(e,{slots:d}){const t=we({loading:!1});return pe(()=>{t.loading=e.show}),ne(()=>e.show,()=>{t.loading=e.show}),()=>a($e,{loading:t.loading,style:"flex-wrap: wrap"},{template:()=>a("div",{style:{height:"calc(100vh - var(--header-height))",overflow:"hidden",width:"100%"}},[e.showCount.map(()=>a(Ae,{class:F["data-content"],border:!1},{default:()=>[a(K,{center:!0},{title:()=>a("div",{class:F.teacher_info},[a(et,{class:F.logo},null),a("p",{class:F.userName,style:{width:"100px"}},[a(J,{rowWidth:"50%"},null)])]),default:()=>a("p",{class:F.orchestraName},[a(J,null,null)])}),a(K,{isLink:!0,clickable:!1,center:!0},{title:()=>a(Ie,{border:!1,columnNum:4,clickable:!0},{default:()=>[a(q,null,{text:()=>a(J,{rowWidth:"50%"},null)}),a(q,null,{text:()=>a(J,{rowWidth:"50%"},null)}),a(q,null,{text:()=>a(J,{rowWidth:"50%"},null)}),a(q,null,{text:()=>a(J,{rowWidth:"50%"},null)})]})})]}))]),default:()=>d.default&&d.default()})}}),ta=z({name:"train-statistics",setup(){const e=sessionStorage.getItem("trainParams");sessionStorage.removeItem("trainParams");let d=null;e&&(d={...JSON.parse(e),page:1,rows:20});const t=Ue(),s=we({isClick:!1,listState:{dataShow:!0,loading:!0,finished:!1,refreshing:!1},params:d||{page:1,rows:20},list:[]}),g=async()=>{try{if(s.isClick)return;s.isClick=!0;const{data:i}=await ve.get("/api-web/schoolCloudStudy/countStudentTrain",{params:{...s.params}}),w=i||{};s.listState.refreshing?s.list=w.rows||[]:s.list=s.list.concat(w.rows||[]),s.listState.finished=w.pageNo>=w.totalPage,s.params.page=w.pageNo+1}catch(i){s.listState.finished=!0}finally{setTimeout(()=>{s.listState.dataShow=s.list.length>0,s.listState.refreshing=!1,s.listState.loading=!1,s.isClick=!1},500)}},D=()=>{s.params.page=1,g()},k=i=>{s.params=Object.assign(s.params,i),o()},v=i=>{sessionStorage.setItem("trainParams",JSON.stringify(s.params)),t.push({path:"/train-detail",query:{userId:i.userId,username:i.username,phone:i.phone,musicGroupName:i.musicGroupName,avatar:i.avatar,visitFlag:i.visitFlag}})},o=()=>{s.list=[],s.params.page=1,s.listState.dataShow=!0,s.listState.loading=!0,s.listState.finished=!1,s.listState.refreshing=!0,D()};return pe(()=>{}),()=>a("div",{class:F.visitList},[a(Ye,{position:"top"},{default:()=>[a(He,null,null),a(Ot,{onLoad:k,selectValues:s.params},null)]}),a(Et,{show:s.listState.loading,"onUpdate:show":i=>s.listState.loading=i},{default:()=>[a(Ke,{modelValue:s.listState.refreshing,"onUpdate:modelValue":i=>s.listState.refreshing=i,onRefresh:()=>D(),style:{minHeight:"calc(100vh - var(--header-height))"}},{default:()=>[a(tt,{finished:s.listState.finished,finishedText:" ",style:{overflow:"hidden",marginBottom:"18px"},onLoad:g,immediateCheck:!1},{default:()=>[s.listState.dataShow?s.list.map(i=>a(Ae,{class:F["data-content"],border:!1,onClick:()=>v(i)},{default:()=>[a(K,{center:!0},{title:()=>a("div",{class:F.teacher_info},[i.memberFlag&&a("img",{src:Mt,class:F.memberLogo},null),a("img",{class:F.logo,src:i.avatar||qe,alt:""},null),a("p",{class:F.userName},[i.username])]),default:()=>a("p",{class:F.orchestraName},[i.musicGroupName])}),a(K,{isLink:!0,clickable:!1,center:!0},{title:()=>a(Ie,{border:!1,columnNum:4,clickable:!0},{default:()=>[a(q,{text:"训练时长"},{icon:()=>a("span",null,[i.totalPlayTime,E("分钟")])}),a(q,{text:"训练次数"},{icon:()=>a("span",{style:"color: #01c1b5"},[i.trainNum,E("次")])}),a(q,{text:"训练天数"},{icon:()=>a("span",{style:"color: #ff802c"},[i.trainDay,E("天")])}),a(q,{text:"评测次数"},{icon:()=>a("span",{style:"color: #f79c00"},[i.recordNum,E("次")])})]})})]})):a(We,{style:{minHeight:"calc(100vh - var(--header-height))"},description:"暂无数据"},null)]})]})]})])}});export{ta as default};
|