1 |
- import{d,aV as m,ag as g,R as p,r as f,$ as _,c as s,q as u,ai as v,ak as y,m as I,f as b}from"./index.ffe80dbe.js";import{G as h,a as C}from"./index.72ca63b9.js";const N="_grid_82obo_1",w="_gridItem_82obo_8",S="_cover_82obo_16",k="_title_82obo_27",q="_num_82obo_33",G="_look_82obo_48";var r={grid:N,gridItem:w,cover:S,title:k,num:q,look:G};function O(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!y(a)}var R=d({name:"unit-Lesson",setup(){const a=m(),l=g(),n=p({}),o=f({loading:!0,list:[]}),i=async()=>{o.loading=!0;try{const e=await I.post(b.platformApi+"/courseSchedule/getCoursewareByClassId",{requestType:"form",data:{classGroupId:a.query.classGroupId}});Array.isArray(e==null?void 0:e.data)&&(o.list=[],e.data.map(t=>{t.unitTestNum&&o.list.push(t)}))}catch(e){console.log(e)}o.loading=!1};_(()=>{n.value={...JSON.parse(sessionStorage.getItem("unit-create")||"{}")},i()});const c=e=>{n.value.coursewareName=e.coursewareName,n.value.lessonCoursewareId=e.lessonCoursewareId,sessionStorage.setItem("unit-create",JSON.stringify(n.value)),l.push({path:"/uni-test",query:{lessonCoursewareId:e.lessonCoursewareId}})};return()=>{let e;return s("div",{style:{paddingTop:"14px"},class:[o.list.length>0?"":"emptyRootContainer"]},[o.list.length>0?s(h,{gutter:14,columnNum:3,class:r.grid},O(e=o.list.map(t=>s(C,null,{default:()=>[s("div",{class:r.gridItem,style:{background:t.coverImg?"":`hsla(${Math.floor(Math.random()*360)},50%,50%,.8)`},onClick:()=>c(t)},[s("img",{src:t.coverImg,class:r.cover},null),s("div",{class:r.title},[t.name]),s("div",{class:r.num},[u("\u5171"),t.unitTestNum||0,u("\u6B21\u6D4B\u9A8C")])])]})))?e:{default:()=>[e]}):s(v,{btnStatus:!1,tips:"\u6682\u65E0\u6559\u6750"},null)])}}});export{R as default};
|