index-legacy.f87f1c18.js 3.2 KB

1
  1. !function(){var e=document.createElement("style");e.innerHTML="._lessonCourseware_hwgf4_1{min-height:100vh;background-color:#ffe8ce;padding:.26667rem 0;box-sizing:border-box}._filter_hwgf4_7{font-size:.37333rem;font-weight:500}.van-action-sheet{max-height:40%}\n",document.head.appendChild(e),System.register(["./index-legacy.eb062188.js","./index-legacy.3d6106b0.js","./index-legacy.4e015ad0.js","./index-legacy.644c5d45.js","./index-legacy.38b799d5.js","./Picker-legacy.95f03705.js","./index-legacy.ac7c51db.js","./use-tab-status-legacy.91417466.js","./index-legacy.fab451f1.js","./index-legacy.10d8486a.js"],(function(e){"use strict";var t,a,o,n,i,s,c,r,l,u,d,g,h,f,y,m,p,w,v,b,j;return{setters:[function(e){t=e.d,a=e.ah,o=e.ag,n=e.r,i=e.f,s=e.$,c=e.y,r=e.c,l=e.aj,u=e.F,d=e.q,g=e.a5,h=e.b9,f=e.ak,y=e.P,m=e.m,p=e.g},function(e){w=e.C},function(e){v=e.c},function(e){b=e.O},function(e){j=e.P},function(){},function(){},function(){},function(){},function(){}],execute:function(){var x="_lessonCourseware_hwgf4_1",C="_filter_hwgf4_7";e("default",t({name:"lessonCourseware",setup(){const e=a(),t=o(),_=n({loading:!0,list:[],actionShow:!1,actionName:"课程类型",actionKey:"",showRight:"select"!=e.query.code&&i().isTeacher}),S=e=>{const t={};for(let a=0;a<e.length;a++)t[e[a].sortNo]?t[e[a].sortNo].push(e[a]):t[e[a].sortNo]=[e[a]];return t},N=async()=>{if(_.loading=!0,"select"===e.query.code)try{const t=await m.post(p.platformApi+`/courseSchedule/getCourseware/${e.query.courseScheduleId}`);if(Array.isArray(null==t?void 0:t.data)){const e=t.data.map((e=>({...e,coverImg:e.coverImg,name:e.coursewareName,id:e.lessonCoursewareId,courseNum:e.coursewareNum})));_.list=S(e),console.log("🚀 ~ data.list:",_.list)}}catch(t){}else try{const e=await m.post(p.platformApi+"/courseSchedule/myCourseware");if(Array.isArray(null==e?void 0:e.data)){const t=_.actionKey?e.data.filter((e=>e.courseTypeCode===_.actionKey)):e.data;_.list=S(t)}}catch(t){}_.loading=!1};s((()=>{N()}));const q=c((()=>{const e=Object.entries(v).map((([e,t])=>({id:e,name:t,text:t,value:e,color:e===_.actionKey?"var(--van-primary)":""})));return e.unshift({id:"",name:"课程类型",text:"全部",value:"",color:""===_.actionKey?"var(--van-primary)":""}),e}));return()=>r("div",{class:[x,!Object.values(_.list).length&&"emptyRootContainer"]},[r(l,{border:!1,background:"rgba(255, 232, 206, 1)",color:"rgba(124, 61, 18, 1)",title:"云教材"},{right:()=>r(u,null,[_.showRight&&r("div",{class:C,onClick:()=>_.actionShow=!0},[_.actionName,d(" "),r(g,{style:{transform:"rotate(90deg)"},name:"play"},null)," "])])}),r(h,{name:"van-fade"},{default:()=>[!_.loading&&Object.keys(_.list).map((a=>r(w,{term:a,list:_.list[a],onItemClick:a=>{return o=a,void("select"!==e.query.code?t.push({path:"/courseList",query:{id:o.id}}):t.push({path:"/courseList",query:{...e.query,id:o.id}}));var o}},null)))]}),_.loading&&r(b,null,null),!_.loading&&!Object.values(_.list).length&&r(f,{tips:"没有课件"},null),r(y,{position:"bottom",round:!0,show:_.actionShow,"onUpdate:show":e=>_.actionShow=e},{default:()=>[r(j,{class:"popupBottomSearch",columns:q.value,onCancel:()=>_.actionShow=!1,onConfirm:({selectedOptions:e})=>{var t;t=e[0],_.actionKey=t.id,_.actionName=t.name,_.actionShow=!1,N()}},null)]})])}}))}}}))}();