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