import{d as j,ag as S,R as d,Z as E,c as e,q as l,F as M,g as I,ah as O,r as b,ai as i,$ as W,m as g,o as w,aj as G,B as C,a5 as y,ak as V,al as $}from"./index.1c621181.js";import{O as A}from"./index.944c4ba2.js";import{O as q}from"./index.b491c24a.js";import{i as H}from"./isBetween.c42926d4.js";import{O as U}from"./index.b0685ec5.js";import{s as Z}from"./student-icon.30fb072d.js";import{C as z}from"./index.fd5ae97b.js";import{I as J}from"./index.4c221cbe.js";import{D as K,a as Q}from"./index.b1f8d369.js";import{L as X}from"./index.d5ee0b18.js";import{C as ee}from"./index.36db2313.js";import"./index.c7a20c76.js";import"./use-tab-status.40058c51.js";import"./index.88a00aa9.js";import"./index.78a302c3.js";import"./index.d5b73933.js";import"./utils.3d9f83cd.js";import"./Picker.9bc4331c.js";const te="_itemWrap_15s53_1",se="_itemTop_15s53_8",ae="_itemTopLeft_15s53_16",oe="_headIcon_15s53_21",re="_name_15s53_33",ce="_tag_15s53_41",ie="_itemTopRight_15s53_54",ne="_itemBottom_15s53_63",le="_msgMain_15s53_70",me="_msgsub_15s53_85",ue="_itemBottomLeft_15s53_94",he="_itemBottomRight_15s53_109",de="_arrow_15s53_113",pe="_bottomTitle_15s53_126",_e="_bottomTitleLeft_15s53_140",fe="_bottomConent_15s53_153",Te="_bottomImgWrap_15s53_159",ge="_bottomConentLeft_15s53_168",ye="_bottomConentRight_15s53_169",ve="_recordItem_15s53_175",Ie="_imgContainer_15s53_181",be="_img_15s53_181",we="_userInfo_15s53_201",Ce="_userItem_15s53_205",je="_topText_15s53_210";var n={itemWrap:te,itemTop:se,itemTopLeft:ae,headIcon:oe,name:re,tag:ce,itemTopRight:ie,itemBottom:ne,msgMain:le,msgsub:me,itemBottomLeft:ue,itemBottomRight:he,arrow:de,bottomTitle:pe,bottomTitleLeft:_e,bottomConent:fe,bottomImgWrap:Te,bottomConentLeft:ge,bottomConentRight:ye,recordItem:ve,imgContainer:Ie,img:be,userInfo:we,userItem:Ce,topText:je};const _=d({});var Se=j({props:["item","forms"],name:"student-item",setup(c){const f=S();d(!1),E(()=>c.forms,s=>{_.value=s},{deep:!0});const a=()=>{console.log(_.value.practiceMonth,_.value.practiceMonthName),console.log(c.item),f.push({path:"/exercis-detail",query:{id:c.item.userId,practiceMonth:_.value.practiceMonth,practiceMonthName:_.value.practiceMonthName}})};return()=>e(M,null,[e(z,{isLink:!0,class:n.recordItem,center:!0,onClick:a},{icon:()=>e("div",{class:n.imgContainer},[e(J,{class:n.img,src:c.item.avatar?c.item.avatar:Z,alt:""},null),c.item.memberFlag?e("i",{class:n.iconMember},null):""]),title:()=>e("div",{class:n.userInfo},[e("div",{class:n.userItem},[e("p",{class:n.topText,style:"font-weight: bold;"},[c.item.nickname]),e("p",{class:n.bottomText},[c.item.subjectName?c.item.subjectName:"\u6682\u65E0\u58F0\u90E8"])]),e("div",{class:n.userItem},[e("p",{class:n.topText},[e("span",{style:{color:c.item.standardFlag?"#333":"#F44541"}},[c.item.trainingTime?c.item.trainingTime:0]),l("\u5206\u949F")]),e("p",{class:n.bottomText},[l("\u7EC3\u4E60\u65F6\u957F")])]),e("div",{class:n.userItem,style:{paddingLeft:"10px"}},[e("p",{class:n.topText},[e("span",null,[c.item.trainingDays?c.item.trainingDays:0]),l("\u5929")]),e("p",{class:n.bottomText},[l("\u7EC3\u4E60\u5929\u6570")])])])})])}});const Me="_chioseWrap_1uj41_1",Ye="_searchBandWrap_1uj41_9",ke="_searchBand_1uj41_9",xe="_exerciseRecord_1uj41_22",De="_searchMore_1uj41_25",Fe="_searchContainer_1uj41_51",Ne="_searchMoreGroup_1uj41_59",Re="_searchTitle_1uj41_65",Pe="_searchTypeGroup_1uj41_73",Be="_searchTypeFlex_1uj41_80",Le="_searchTypeItem_1uj41_80",Ee="_searchTypeFlex1_1uj41_83",Oe="_searchTypeFlex2_1uj41_95",We="_searchTypeItemLine_1uj41_98",Ge="_searchPreview_1uj41_122",Ve="_searchPreviewItem_1uj41_128",$e="_cross_1uj41_142";var r={chioseWrap:Me,searchBandWrap:Ye,searchBand:ke,exerciseRecord:xe,searchMore:De,searchContainer:Fe,searchMoreGroup:Ne,searchTitle:Re,searchTypeGroup:Pe,searchTypeFlex:Be,searchTypeItem:Le,searchTypeFlex1:Ee,searchTypeFlex2:Oe,searchTypeItemLine:We,"is-active":"_is-active_1uj41_117",searchPreview:Ge,searchPreviewItem:Ve,cross:$e};i.extend(H);function Ae(c){return typeof c=="function"||Object.prototype.toString.call(c)==="[object Object]"&&!$(c)}var lt=j({name:"exercise-record",setup(){const c=d(I.platformApi);S();const f=O(),a=b({showSearchStatus:!0,showPopoverTime:!1,actions:[],subjects:[],listState:{dataShow:!0,loading:!1,finished:!1,refreshing:!1,height:0},isClick:!1}),s=b({startTime:i().day(1).format("YYYY-MM-DD"),endTime:i().day(7).format("YYYY-MM-DD"),orchestraId:"",orchestraName:"",subjectId:"",subjectName:"",sortType:"",sortTypeName:"",keyword:"",page:1,rows:20}),h=d([]),m=async()=>{try{if(a.isClick)return;a.isClick=!0,a.listState.refreshing&&(s.page=1,h.value=[],a.listState.refreshing=!1);const{endTime:o,startTime:t,...u}=s,L=await g.post(`${c.value}/musicPracticeRecord/${I.platformType==="TEACHER"?"teacher":"school"}/studentPracticeThisWeek`,{data:{...u,endTime:o+" 23:59:59",startTime:t+" 00:00:00"}});a.listState.loading=!1,a.listState.refreshing=!1;const p=L.data||{};if(h.value.length>0&&p.current===1)return;h.value=h.value.concat(p.rows||[]),a.listState.finished=p.current>=p.pages,s.page=p.current+1,a.listState.dataShow=h.value.length>0,a.isClick=!1}catch{a.listState.dataShow=!1,a.listState.finished=!0,a.listState.refreshing=!1,a.isClick=!1}};W(async()=>{await F(),await D(),await m()});const Y=o=>{s.sortType=o.value,s.sortTypeName=o.name},k=o=>{s.orchestraId=o.value,s.orchestraName=o.name},x=o=>{s.subjectId=o.value,s.subjectName=o.name},D=async()=>{try{const o=await g.post(`${c.value}/orchestra/page`,{data:{page:1,rows:9999,status:"DONE"}});a.actions=o.data.rows.map(t=>({name:t.name,value:t.id}))}catch(o){const t=o.message;w(t)}},F=async()=>{try{const o=await g.post(`${c.value}/subjectBasicConfig/page`,{data:{page:1,rows:9999}});a.subjects=o.data.rows.map(t=>(f.query.subjectId==t.subjectId&&(s.subjectId=t.subjectId,s.subjectName=t.subjectName),{name:t.subjectName,value:t.subjectId}))}catch(o){const t=o.message;w(t)}},N=()=>{a.listState.finished=!1,a.listState.loading=!0,console.log(3),m()},v=o=>{if(o.length>11){const t=o.substring(0,6),u=o.substring(o.length-5,o.length);return t+"..."+u}else return o},R=d(),T=d(),P=()=>{var o;s.startTime=i().day(1).format("YYYY-MM-DD"),s.endTime=i().day(7).format("YYYY-MM-DD"),s.orchestraId="",s.orchestraName="",s.subjectId="",s.subjectName="",s.sortType="",s.sortTypeName="",(o=T.value)==null||o.toggle(),a.listState.refreshing=!0,console.log(4),m()},B=()=>{var o;(o=T.value)==null||o.toggle(),a.listState.refreshing=!0,console.log(5),m()};return()=>{let o;return e("div",{class:[a.listState.dataShow?"":"emptyRootContainer",r.exerciseRecord]},[e(q,{position:"top",background:"#F8F8F8",onGetHeight:t=>{document.documentElement.style.setProperty("--header-height",t+"px")}},{default:()=>[e(G,{border:!1},{right:()=>e(K,{class:r.searchMore,closeOnClickOverlay:!1,closeOnClickOutside:!1,ref:R},{default:()=>[e(Q,{title:"\u7B5B\u9009",modelValue:a.showSearchStatus,"onUpdate:modelValue":t=>a.showSearchStatus=t,ref:T},{default:()=>[e("div",{class:r.searchContainer},[a.actions.length>0&&e(M,null,[e("div",{class:r.searchTitle},[l("\u4E50\u56E2")]),e("div",{class:[r.searchTypeGroup,r.searchTypeFlex]},[a.actions.map(t=>e("div",{class:[r.searchTypeItem,t.value===s.orchestraId&&r["is-active"]],onClick:()=>k(t)},[v(t.name)]))])]),e("div",{class:r.searchTitle},[l("\u65F6\u95F4\u6BB5")]),e("div",{class:[r.searchTypeGroup,r.searchTypeFlex2]},[e("div",{class:r.searchTypeItem,onClick:()=>a.showPopoverTime=!0},[s.startTime]),e("div",{class:r.searchTypeItemLine,onClick:()=>a.showPopoverTime=!0},null),e("div",{class:r.searchTypeItem,onClick:()=>a.showPopoverTime=!0},[s.endTime])]),e("div",{class:r.searchTitle},[l("\u58F0\u90E8")]),e("div",{class:[r.searchTypeGroup,r.searchTypeFlex1]},[a.subjects.map(t=>e("div",{class:[r.searchTypeItem,t.value===s.subjectId&&r["is-active"]],onClick:()=>x(t)},[t.name]))]),e("div",{class:r.searchTitle},[l("\u6392\u5E8F\u65B9\u5F0F")]),e("div",{class:[r.searchTypeGroup,r.searchTypeFlex]},[[{name:"\u6309\u65F6\u957F",value:"PRACTICE_TIMES"},{name:"\u6309\u5929\u6570",value:"PRACTICE_DAY"}].map(t=>e("div",{class:[r.searchTypeItem,s.sortType===t.value&&r["is-active"]],onClick:()=>Y(t)},[t.name]))])]),e("div",{class:[r.searchMoreGroup,"van-hairline--top"]},[e(C,{type:"default",block:!0,round:!0,onClick:P},{default:()=>[l("\u91CD\u7F6E")]}),e(C,{type:"primary",block:!0,round:!0,onClick:B},{default:()=>[l("\u67E5\u8BE2")]})])]})]})}),e("div",{style:{backgroundColor:"#fff"}},[e(A,{placeholder:"\u8BF7\u8F93\u5165\u5B66\u5458\u59D3\u540D",class:r.recordSearch,onSearch:t=>{s.keyword=t,a.listState.refreshing=!0,console.log(6),m()}},null),e("div",{class:r.searchPreview},[e("div",{class:r.searchPreviewItem,onClick:()=>{}},[s.startTime,l("~"),s.endTime]),s.orchestraId&&e("div",{class:r.searchPreviewItem},[v(s.orchestraName),e(y,{name:"cross",class:r.cross,onClick:t=>{s.orchestraId="",s.orchestraName="",t.stopPropagation(),a.listState.refreshing=!0,console.log(8),m()}},null)]),s.subjectId&&e("div",{class:r.searchPreviewItem},[s.subjectName,e(y,{name:"cross",class:r.cross,onClick:t=>{s.subjectId="",s.subjectName="",t.stopPropagation(),a.listState.refreshing=!0,console.log(2),m()}},null)]),s.sortType&&e("div",{class:r.searchPreviewItem},[s.sortTypeName,e(y,{name:"cross",class:r.cross,onClick:t=>{s.sortType="",s.sortTypeName="",t.stopPropagation(),a.listState.refreshing=!0,console.log(1),m()}},null)])])])]}),a.listState.dataShow?e(U,{modelValue:a.listState.refreshing,"onUpdate:modelValue":t=>a.listState.refreshing=t,onRefresh:N,style:"min-height: calc(100vh - var(--header-height))"},{default:()=>[e(X,{finished:a.listState.finished,style:{paddingTop:"12px"},finishedText:" ",onLoad:m,immediateCheck:!1},Ae(o=h.value.map(t=>e(Se,{item:t,forms:s},null)))?o:{default:()=>[o]})]}):e(V,{tips:"\u6682\u65E0\u7EC3\u4E60\u8BB0\u5F55"},null),e(ee,{show:a.showPopoverTime,"onUpdate:show":t=>a.showPopoverTime=t,firstDayOfWeek:1,showConfirm:!1,type:"range",maxRange:7,minDate:new Date("2023-02-27"),defaultDate:[i(s.startTime).toDate(),i(s.endTime).toDate()],style:{height:"70%"},onSelect:t=>{if(s.startTime="",s.endTime="",!i(t[0]).isBetween(i(s.startTime),i(s.endTime))){const u=i(t[0]).day();u===0?(s.startTime=i(t[0]).subtract(6,"day").format("YYYY-MM-DD"),s.endTime=i(t[0]).format("YYYY-MM-DD")):u===1?(s.startTime=i(t[0]).format("YYYY-MM-DD"),s.endTime=i(t[0]).add(6,"day").format("YYYY-MM-DD")):(s.startTime=i(t[0]).subtract(u-1,"day").format("YYYY-MM-DD"),s.endTime=i(t[0]).add(7-u,"day").format("YYYY-MM-DD"))}a.showPopoverTime=!1}},null)])}}});export{lt as default};