1 |
- import{d as O,R as p,g as L,ag as B,r as M,ai as t,$ as b,m as N,o as C,c as s,aj as H,F as g,q as n,B as I,a5 as w,ak as V,al as U}from"./index.1c621181.js";import{O as j}from"./index.b491c24a.js";import{i as A}from"./isBetween.c42926d4.js";import{O as $}from"./index.b0685ec5.js";import{i as q}from"./icon_teacher.df08d662.js";import{c as v}from"./index.38b203e1.js";import{C as W}from"./index.36db2313.js";import{D as J,a as K}from"./index.b1f8d369.js";import{L as Q}from"./index.d5ee0b18.js";import{C as X}from"./index.2db9d877.js";import{C as D}from"./index.fd5ae97b.js";import{I as Z}from"./index.4c221cbe.js";import"./index.88a00aa9.js";import"./use-tab-status.40058c51.js";import"./index.78a302c3.js";import"./index.d5b73933.js";import"./utils.3d9f83cd.js";import"./Picker.9bc4331c.js";const ee="_coursewareGroup_1z06z_1",se="_top1_1z06z_9",ae="_top2_1z06z_14",re="_userLogo_1z06z_19",oe="_courseName_1z06z_26",te="_userName_1z06z_27",ce="_courseRange_1z06z_36",le="_courseRangeTips_1z06z_46",ne="_exerciseRecord_1z06z_50",ue="_searchMore_1z06z_53",ie="_searchContainer_1z06z_70",pe="_searchMoreGroup_1z06z_78",me="_searchTitle_1z06z_84",he="_searchTypeGroup_1z06z_92",de="_searchTypeFlex_1z06z_99",ve="_searchTypeItem_1z06z_99",Te="_searchTypeFlex1_1z06z_102",fe="_searchTypeFlex2_1z06z_114",ye="_searchTypeItemLine_1z06z_117",_e="_searchPreview_1z06z_141",ge="_searchPreviewItem_1z06z_148",we="_cross_1z06z_162";var r={coursewareGroup:ee,top1:se,top2:ae,userLogo:re,courseName:oe,userName:te,courseRange:ce,courseRangeTips:le,exerciseRecord:ne,searchMore:ue,searchContainer:ie,searchMoreGroup:pe,searchTitle:me,searchTypeGroup:he,searchTypeFlex:de,searchTypeItem:ve,searchTypeFlex1:Te,searchTypeFlex2:fe,searchTypeItemLine:ye,"is-active":"_is-active_1z06z_136",searchPreview:_e,searchPreviewItem:ge,cross:we};t.extend(A);function ze(m){return typeof m=="function"||Object.prototype.toString.call(m)==="[object Object]"&&!U(m)}var He=O({name:"exercise-record",setup(){const m=p(L.platformApi);B();const l=M({showSearchStatus:!0,showPopoverTime:!1,actions:[],subjects:[]}),a=M({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&&(a.page=1,h.value=[],u.value=!1);const{endTime:o,startTime:e,...c}=a,d=await N.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,a.page=d.data.current+1,z.value=!1}catch(o){const e=o.message;C(e),f.value=!1,T.value=!0}};b(()=>{i(),x()});const F=o=>{console.log(o,"val"),a.coursewareErr=o.value,a.coursewareErrName=o.name},E=o=>{a.orchestraId=o.value,a.orchestraName=o.name},k=o=>{a.courseType=o.value,a.courseTypeName=o.name},x=async()=>{try{const o=await N.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;C(e)}},P=()=>{T.value=!1,z.value=!0,i()},y=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"},R=p(),_=p(),S=()=>{var o;a.startTime=t().day(1).format("YYYY-MM-DD"),a.endTime=t().day(7).format("YYYY-MM-DD"),a.orchestraId="",a.orchestraName="",a.courseType="",a.courseTypeName="",a.coursewareErr=null,a.coursewareErrName="",(o=_.value)==null||o.toggle(),u.value=!0,i()},G=()=>{var o;(o=_.value)==null||o.toggle(),u.value=!0,i()};return()=>{let o;return s("div",{class:[f.value?"":"emptyRootContainer",r.exerciseRecord]},[s(j,{position:"top",background:"#F8F8F8",onGetHeight:e=>{document.documentElement.style.setProperty("--header-height",e+"px")}},{default:()=>[s(H,{border:!1},{right:()=>s(J,{class:r.searchMore,closeOnClickOverlay:!1,closeOnClickOutside:!1,ref:R},{default:()=>[s(K,{title:"\u7B5B\u9009",modelValue:l.showSearchStatus,"onUpdate:modelValue":e=>l.showSearchStatus=e,ref:_},{default:()=>[s("div",{class:r.searchContainer},[l.actions.length>0&&s(g,null,[s("div",{class:r.searchTitle},[n("\u4E50\u56E2")]),s("div",{class:[r.searchTypeGroup,r.searchTypeFlex]},[l.actions.map(e=>s("div",{class:[r.searchTypeItem,e.value===a.orchestraId&&r["is-active"]],onClick:()=>E(e)},[y(e.name)]))])]),s("div",{class:r.searchTitle},[n("\u65F6\u95F4\u6BB5")]),s("div",{class:[r.searchTypeGroup,r.searchTypeFlex2]},[s("div",{class:r.searchTypeItem,onClick:()=>l.showPopoverTime=!0},[a.startTime]),s("div",{class:r.searchTypeItemLine,onClick:()=>l.showPopoverTime=!0},null),s("div",{class:r.searchTypeItem,onClick:()=>l.showPopoverTime=!0},[a.endTime])]),s("div",{class:r.searchTitle},[n("\u8BFE\u7A0B\u7C7B\u578B")]),s("div",{class:[r.searchTypeGroup,r.searchTypeFlex1]},[Object.keys(v).map(e=>s("div",{class:[r.searchTypeItem,e===a.courseType&&r["is-active"]],onClick:()=>{k({name:v[e],value:e})}},[v[e]]))]),s("div",{class:r.searchTitle},[n("\u8BFE\u4EF6\u4F7F\u7528\u72B6\u6001")]),s("div",{class:[r.searchTypeGroup,r.searchTypeFlex]},[[{name:"\u6B63\u5E38",value:!1},{name:"\u5F02\u5E38",value:!0}].map(e=>s("div",{class:[r.searchTypeItem,a.coursewareErr===e.value&&r["is-active"]],onClick:()=>F(e)},[e.name]))])]),s("div",{class:[r.searchMoreGroup,"van-hairline--top"]},[s(I,{type:"default",block:!0,round:!0,onClick:S},{default:()=>[n("\u91CD\u7F6E")]}),s(I,{type:"primary",block:!0,round:!0,onClick:G},{default:()=>[n("\u67E5\u8BE2")]})])]})]})}),s("div",{style:{backgroundColor:"#fff"}},[s("div",{class:r.searchPreview},[s("div",{class:r.searchPreviewItem,onClick:()=>{}},[a.startTime,n("~"),a.endTime]),a.orchestraId&&s("div",{class:r.searchPreviewItem},[y(a.orchestraName),s(w,{name:"cross",class:r.cross,onClick:e=>{a.orchestraId="",a.orchestraName="",e.stopPropagation(),u.value=!0,i()}},null)]),a.courseType&&s("div",{class:r.searchPreviewItem},[a.courseTypeName,s(w,{name:"cross",class:r.cross,onClick:e=>{a.courseType="",a.courseTypeName="",e.stopPropagation(),u.value=!0,i()}},null)]),a.coursewareErr!=null&&s("div",{class:r.searchPreviewItem},[a.coursewareErrName,s(w,{name:"cross",class:r.cross,onClick:e=>{a.coursewareErr=null,a.coursewareErrName="",e.stopPropagation(),u.value=!0,i()}},null)])])])]}),f.value?s($,{modelValue:u.value,"onUpdate:modelValue":e=>u.value=e,onRefresh:P,style:{minHeight:"calc(100vh - var(--header-height))"}},{default:()=>[s(Q,{"loading-text":" ",finished:T.value,style:{paddingTop:"12px"},"finished-text":" ",immediateCheck:!1,onLoad:i},ze(o=h.value.map(e=>s(X,{inset:!0,class:r.coursewareGroup},{default:()=>[s(D,{class:r.top1},{title:()=>s(g,null,[t(e.startTime).format("YYYY-MM-DD HH:mm"),n("~"),t(e.endTime).format("HH:mm")]),value:()=>s(g,null,[y(e.orchestraName)])}),s(D,{class:r.top2,center:!0},{icon:()=>s(Z,{class:r.userLogo,src:e.teacherAvatar||q,fit:"cover"},null),title:()=>s("div",{class:r.userInfo},[s("p",{class:[r.userName,"van-ellipsis"]},[e.teacherName]),s("p",{class:[r.courseName,"van-ellipsis"]},[["INSTRUMENTAL_ENSEMBLE","EUPHONIUM_SINGLE"].includes(e.type)?v[e.type]:v[e.type]+"\u5355\u6280\u8BFE"])]),value:()=>s("div",{class:r.courseCount},[s("p",{class:r.courseRange},[s("span",{style:{color:e.coursewarePlayTime>=e.adviseStudyTimeSecond?"#333":"#f44541"}},[Y(e.coursewarePlayTime)]),n("/"),Y(e.adviseStudyTimeSecond)]),s("p",{class:r.courseRangeTips},[n("\u4F7F\u7528\u65F6\u957F/\u6807\u51C6\u65F6\u957F")])])})]})))?o:{default:()=>[o]})]}):s(V,{tips:"\u6682\u65E0\u8BFE\u4EF6\u8BB0\u5F55"},null),s(W,{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(a.startTime).toDate(),t(a.endTime).toDate()],style:{height:"70%"},onSelect:e=>{if(a.startTime="",a.endTime="",!t(e[0]).isBetween(t(a.startTime),t(a.endTime))){const c=t(e[0]).day();c===0?(a.startTime=t(e[0]).subtract(6,"day").format("YYYY-MM-DD"),a.endTime=t(e[0]).format("YYYY-MM-DD")):c===1?(a.startTime=t(e[0]).format("YYYY-MM-DD"),a.endTime=t(e[0]).add(6,"day").format("YYYY-MM-DD")):(a.startTime=t(e[0]).subtract(c-1,"day").format("YYYY-MM-DD"),a.endTime=t(e[0]).add(7-c,"day").format("YYYY-MM-DD"))}l.showPopoverTime=!1}},null)])}}});export{He as default};
|