1 |
- import{d as L,R as p,g as M,ag as B,r as N,ai as t,$ as b,m as C,o as I,c as a,aj as H,F as g,q as n,B as D,_ as V,a5 as w,ak as A,al as U}from"./index.332c7f08.js";import{O as j}from"./index.d7c1b6ac.js";import{i as $}from"./isBetween.edbfdc90.js";import{O as q}from"./index.626c48f9.js";import{i as W}from"./icon_teacher.df08d662.js";import{c as v}from"./index.b28db9f5.js";import{C as J}from"./index.97c682f1.js";import{D as K,a as Q}from"./index.6fe63dc5.js";import{L as X}from"./index.b186dfda.js";import{C as Z}from"./index.324108a5.js";import{C as F}from"./index.91135ff9.js";import{I as ee}from"./index.96a8db5e.js";import"./index.7c580591.js";import"./use-tab-status.9d769af8.js";import"./index.1e2dfe6e.js";import"./index.4aa8e076.js";import"./utils.4b86e8c9.js";import"./Picker.e56f94bd.js";const ae="_coursewareGroup_1z06z_1",se="_top1_1z06z_9",re="_top2_1z06z_14",oe="_userLogo_1z06z_19",te="_courseName_1z06z_26",ce="_userName_1z06z_27",le="_courseRange_1z06z_36",ne="_courseRangeTips_1z06z_46",ue="_exerciseRecord_1z06z_50",ie="_searchMore_1z06z_53",pe="_searchContainer_1z06z_70",me="_searchMoreGroup_1z06z_78",he="_searchTitle_1z06z_84",de="_searchTypeGroup_1z06z_92",ve="_searchTypeFlex_1z06z_99",Te="_searchTypeItem_1z06z_99",fe="_searchTypeFlex1_1z06z_102",ye="_searchTypeFlex2_1z06z_114",_e="_searchTypeItemLine_1z06z_117",ge="_searchPreview_1z06z_141",we="_searchPreviewItem_1z06z_148",ze="_cross_1z06z_162";var r={coursewareGroup:ae,top1:se,top2:re,userLogo:oe,courseName:te,userName:ce,courseRange:le,courseRangeTips:ne,exerciseRecord:ue,searchMore:ie,searchContainer:pe,searchMoreGroup:me,searchTitle:he,searchTypeGroup:de,searchTypeFlex:ve,searchTypeItem:Te,searchTypeFlex1:fe,searchTypeFlex2:ye,searchTypeItemLine:_e,"is-active":"_is-active_1z06z_136",searchPreview:ge,searchPreviewItem:we,cross:ze};t.extend($);function Ye(m){return typeof m=="function"||Object.prototype.toString.call(m)==="[object Object]"&&!U(m)}var Ve=L({name:"exercise-record",setup(){const m=p(M.platformApi);B();const l=N({showSearchStatus:!0,showPopoverTime:!1,actions:[],subjects:[]}),s=N({startTime:t().day(1).format("YYYY-MM-DD"),endTime:t().day(7).format("YYYY-MM-DD"),orchestraId:"",orchestraName:"",courseType:"",courseTypeName:"",coursewareErr:null,coursewareErrName:"",keyword:"",page:1,rows:20}),u=p(!1),z=p(!1),T=p(!1),f=p(!0),h=p([]),i=async()=>{try{u.value&&(s.page=1,h.value=[],u.value=!1);const{endTime:o,startTime:e,...c}=s,d=await C.post(`${m.value}/courseSchedule/coursewareErrPage`,{data:{...c,endTime:o+" 23:59:59",startTime:e+" 00:00:00"}});if(h.value.length>0&&d.data.pages===1)return;h.value=h.value.concat(d.data.rows||[]),T.value=d.data.current>=d.data.pages,f.value=h.value.length>0,s.page=d.data.current+1,z.value=!1}catch(o){const e=o.message;I(e),f.value=!1,T.value=!0}};b(()=>{i(),P()});const E=o=>{console.log(o,"val"),s.coursewareErr=o.value,s.coursewareErrName=o.name},k=o=>{s.orchestraId=o.value,s.orchestraName=o.name},x=o=>{s.courseType=o.value,s.courseTypeName=o.name},P=async()=>{try{const o=await C.post(`${m.value}/orchestra/page`,{data:{page:1,rows:9999,status:"DONE"}});l.actions=o.data.rows.map(e=>({name:e.name,value:e.id}))}catch(o){const e=o.message;I(e)}},R=()=>{T.value=!1,z.value=!0,i()},_=o=>{if(o.length>11){const e=o.substring(0,6),c=o.substring(o.length-5,o.length);return e+"..."+c}else return o},Y=o=>{if(o){const e=Math.floor(o/60),c=o%60;return(e>=10?e:"0"+e)+":"+(c>=10?c:"0"+c)}else return"00:00"},S=p(),y=p(),G=()=>{var o;s.startTime=t().day(1).format("YYYY-MM-DD"),s.endTime=t().day(7).format("YYYY-MM-DD"),s.orchestraId="",s.orchestraName="",s.courseType="",s.courseTypeName="",s.coursewareErr=null,s.coursewareErrName="",(o=y.value)==null||o.toggle(),u.value=!0,i()},O=()=>{var o;(o=y.value)==null||o.toggle(),u.value=!0,i()};return()=>{let o;return a("div",{class:[f.value?"":"emptyRootContainer",r.exerciseRecord]},[a(j,{position:"top",background:"#F8F8F8",onGetHeight:e=>{document.documentElement.style.setProperty("--header-height",e+"px")}},{default:()=>[a(H,{border:!1},{right:()=>a(K,{class:r.searchMore,closeOnClickOverlay:!1,closeOnClickOutside:!1,ref:S},{default:()=>[a(Q,{title:"\u7B5B\u9009",modelValue:l.showSearchStatus,"onUpdate:modelValue":e=>l.showSearchStatus=e,ref:y},{default:()=>[a("div",{class:r.searchContainer},[l.actions.length>0&&a(g,null,[a("div",{class:r.searchTitle},[n("\u4E50\u56E2")]),a("div",{class:[r.searchTypeGroup,r.searchTypeFlex]},[l.actions.map(e=>a("div",{class:[r.searchTypeItem,e.value===s.orchestraId&&r["is-active"]],onClick:()=>k(e)},[_(e.name)]))])]),a("div",{class:r.searchTitle},[n("\u65F6\u95F4\u6BB5")]),a("div",{class:[r.searchTypeGroup,r.searchTypeFlex2]},[a("div",{class:r.searchTypeItem,onClick:()=>l.showPopoverTime=!0},[s.startTime]),a("div",{class:r.searchTypeItemLine,onClick:()=>l.showPopoverTime=!0},null),a("div",{class:r.searchTypeItem,onClick:()=>l.showPopoverTime=!0},[s.endTime])]),a("div",{class:r.searchTitle},[n("\u8BFE\u7A0B\u7C7B\u578B")]),a("div",{class:[r.searchTypeGroup,r.searchTypeFlex1]},[Object.keys(v).map(e=>a("div",{class:[r.searchTypeItem,e===s.courseType&&r["is-active"]],onClick:()=>{x({name:v[e],value:e})}},[v[e]]))]),a("div",{class:r.searchTitle},[n("\u8BFE\u4EF6\u4F7F\u7528\u72B6\u6001")]),a("div",{class:[r.searchTypeGroup,r.searchTypeFlex]},[[{name:"\u6B63\u5E38",value:!1},{name:"\u5F02\u5E38",value:!0}].map(e=>a("div",{class:[r.searchTypeItem,s.coursewareErr===e.value&&r["is-active"]],onClick:()=>E(e)},[e.name]))])]),a("div",{class:[r.searchMoreGroup,"van-hairline--top"]},[a(D,{type:"default",block:!0,round:!0,onClick:G},{default:()=>[n("\u91CD\u7F6E")]}),a(D,{type:"primary",block:!0,round:!0,onClick:O},{default:()=>[n("\u67E5\u8BE2")]})])]})]})}),a("div",{style:{backgroundColor:"#fff"}},[a("div",{class:r.searchPreview},[a("div",{class:r.searchPreviewItem,onClick:()=>{var e;(e=y.value)==null||e.toggle(),V(()=>{document.querySelectorAll(".van-dropdown-item--down")[0].style.top=`calc(var(--van-nav-bar-height) + ${M.navBarHeight}px`})}},[s.startTime,n("~"),s.endTime]),s.orchestraId&&a("div",{class:r.searchPreviewItem},[_(s.orchestraName),a(w,{name:"cross",class:r.cross,onClick:e=>{s.orchestraId="",s.orchestraName="",e.stopPropagation(),u.value=!0,i()}},null)]),s.courseType&&a("div",{class:r.searchPreviewItem},[s.courseTypeName,a(w,{name:"cross",class:r.cross,onClick:e=>{s.courseType="",s.courseTypeName="",e.stopPropagation(),u.value=!0,i()}},null)]),s.coursewareErr!=null&&a("div",{class:r.searchPreviewItem},[s.coursewareErrName,a(w,{name:"cross",class:r.cross,onClick:e=>{s.coursewareErr=null,s.coursewareErrName="",e.stopPropagation(),u.value=!0,i()}},null)])])])]}),f.value?a(q,{modelValue:u.value,"onUpdate:modelValue":e=>u.value=e,onRefresh:R,style:{minHeight:"calc(100vh - var(--header-height))"}},{default:()=>[a(X,{"loading-text":" ",finished:T.value,style:{paddingTop:"12px"},"finished-text":" ",immediateCheck:!1,onLoad:i},Ye(o=h.value.map(e=>a(Z,{inset:!0,class:r.coursewareGroup},{default:()=>[a(F,{class:r.top1},{title:()=>a(g,null,[t(e.startTime).format("YYYY-MM-DD HH:mm"),n("~"),t(e.endTime).format("HH:mm")]),value:()=>a(g,null,[_(e.orchestraName)])}),a(F,{class:r.top2,center:!0},{icon:()=>a(ee,{class:r.userLogo,src:e.teacherAvatar||W,fit:"cover"},null),title:()=>a("div",{class:r.userInfo},[a("p",{class:[r.userName,"van-ellipsis"]},[e.teacherName]),a("p",{class:[r.courseName,"van-ellipsis"]},[["INSTRUMENTAL_ENSEMBLE","EUPHONIUM_SINGLE"].includes(e.type)?v[e.type]:v[e.type]+"\u5355\u6280\u8BFE"])]),value:()=>a("div",{class:r.courseCount},[a("p",{class:r.courseRange},[a("span",{style:{color:e.coursewarePlayTime>=e.adviseStudyTimeSecond?"#333":"#f44541"}},[Y(e.coursewarePlayTime)]),n("/"),Y(e.adviseStudyTimeSecond)]),a("p",{class:r.courseRangeTips},[n("\u4F7F\u7528\u65F6\u957F/\u6807\u51C6\u65F6\u957F")])])})]})))?o:{default:()=>[o]})]}):a(A,{tips:"\u6682\u65E0\u8BFE\u4EF6\u8BB0\u5F55"},null),a(J,{show:l.showPopoverTime,"onUpdate:show":e=>l.showPopoverTime=e,firstDayOfWeek:1,showConfirm:!1,type:"range",maxRange:7,minDate:new Date("2023-02-27"),defaultDate:[t(s.startTime).toDate(),t(s.endTime).toDate()],style:{height:"70%"},onSelect:e=>{if(s.startTime="",s.endTime="",!t(e[0]).isBetween(t(s.startTime),t(s.endTime))){const c=t(e[0]).day();c===0?(s.startTime=t(e[0]).subtract(6,"day").format("YYYY-MM-DD"),s.endTime=t(e[0]).format("YYYY-MM-DD")):c===1?(s.startTime=t(e[0]).format("YYYY-MM-DD"),s.endTime=t(e[0]).add(6,"day").format("YYYY-MM-DD")):(s.startTime=t(e[0]).subtract(c-1,"day").format("YYYY-MM-DD"),s.endTime=t(e[0]).add(7-c,"day").format("YYYY-MM-DD"))}l.showPopoverTime=!1}},null)])}}});export{Ve as default};
|