1 |
- import{d as e,a as t,F as a,f as l,r as s,o as i,e as A,s as r,W as o,O as d,n,p as c,b as u,B as p,J as g,t as m,P as h,i as w}from"./index-d31722d5.js";import{O as C}from"./index-f2a9f072.js";import{O as B}from"./index-c77244c9.js";import{C as f,a as k}from"./index-c3f05cca.js";import{C as _}from"./index-40db5953.js";import"./index-aec66e25.js";import"./index-1f639c9e.js";const U={courseList:"_courseList_uldp4_1",periodContent:"_periodContent_uldp4_8",cover:"_cover_uldp4_12",contentTitle:"_contentTitle_uldp4_49",contentLabel:"_contentLabel_uldp4_56",periodTitle:"_periodTitle_uldp4_62",pIcon:"_pIcon_uldp4_68",pTitle:"_pTitle_uldp4_73",pNum:"_pNum_uldp4_79",left:"_left_uldp4_84",iconQuestion:"_iconQuestion_uldp4_88",periodItem:"_periodItem_uldp4_93",courseDialog:"_courseDialog_uldp4_105",iconCross:"_iconCross_uldp4_108",periodItemModel:"_periodItemModel_uldp4_116",iconCachePoint:"_iconCachePoint_uldp4_119",periodTip:"_periodTip_uldp4_128",downloading:"_downloading_uldp4_136",itemTitle:"_itemTitle_uldp4_150",itemTitleActive:"_itemTitleActive_uldp4_157",arrow:"_arrow_uldp4_160",arrowActive:"_arrowActive_uldp4_172",collapseParent:"_collapseParent_uldp4_176",collapseChild:"_collapseChild_uldp4_191",radioBtn:"_radioBtn_uldp4_204",btnGroup:"_btnGroup_uldp4_208",popupRule:"_popupRule_uldp4_216",title:"_title_uldp4_222",content:"_content_uldp4_49"},E="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAmBAMAAABe5iSgAAAAIVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABt0UjBAAAAC3RSTlMAMw0uJg4rHxcHBQEh60AAAAB6SURBVCjPY8AKWMsMBaFAOD0AJMLpKIgERCYAhZQFPYKUoEC1RdAIqMgQSCCAsvAEBhbhBchCXIYODIFCqJYpijIUOqAKsYgzJDagCnGIMRgGoLlSmEFQAVWISXBUiHIhzIDGFh2YkYYtajETALZkgpmYMJMc1oSJCQBqCxyPcdjczQAAAABJRU5ErkJggg==",y="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAmBAMAAABe5iSgAAAAKlBMVEUAAAAAAAAAAAAAAAAAAAABwbUBwbUAw7YAAAAAAAAAAAACwrUAAAABwbXwB2T9AAAADXRSTlMAMw0uI/fLYisXB6IFQ8BpnwAAAKJJREFUKM9jwAqYPAwFoUC4RQEkwuUoiAREFgCFlAU9leBgiqARUJEhkEAAZeEFDCzCB5CFeAwdGBSFUOwC8R0dUIVYRBgaJzAwsKfeBYOwAgYGTgkGQ6BL9t6FgttAVwozCCowsN+FgwIGJkGQEBtCKAEqxIoQCoAK8SKELgxXIUxvYwYOZhBiBjS26MCMNGxRi5kAsCUTzMSEmeSwJkxMAAC9wuFjWrF+EQAAAABJRU5ErkJggg==",M="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAb1BMVEUAAAABwbUBwbUBwbUBwrYCwrYAw7QAyLoAwbUBwbX///8LxLil6eX5/f30/PvY9fMry8ERxbr2/fzg9/W17eme5+Nn2tPd9vXQ8/Gr6uZy3dZs29Rg2NA5z8U0zcTt+vnj+PbF8O173thG0ckVxbrBdDPEAAAACXRSTlMA8u7YwJpEJT4GMcrVAAAA1UlEQVQ4y42USQ7DIAxFSYEkNpnnNm063v+MhaAoCwTmrZB4sr8QNttJJU/AIeEyZQeZAC8is05+gQCXfK+jnaBlagkgEDozkKRM0pJknJY4S2gpYRCBT1Lj3NeKkEZE/BCV7toZiHZNhfj6hSVVI5YPIniBiDdwJfUsq6G158kGciR7c7WBOsS+daSzxxFoA1c601p59b54U5k269HWkc4XfOtAcxuQYERDt0FIUouRJghJNlZBfpXvUiiPRBH1faMGIWqkooYzZswjFwa9euKXGL0O/14PLeCGCo1hAAAAAElFTkSuQmCC",b="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkBAMAAAATLoWrAAAALVBMVEUAAADMzMzMzMzMzMzNzc3Nzc3Ozs7Pz8/Ozs7r6+vMzMzj4+Pd3d3T09Pn5+dCYTflAAAACXRSTlMA8u7YwJpEJT4GMcrVAAAAeklEQVQoz2NgYGALlloFBQtNExiAgN1rFRJYUgAUalp1ZzccnF2lAVSktXomEti1qICBZdVLZKF5qxwYsiCKEMqWMUTdRBWau5TB6iSq0JzFDFI7UYVmL2RYhS60alSIciHMgMYWHZiRhi1qMRMAlmSCmZiwJjnMhAkA3DR6thxCvCcAAAAASUVORK5CYII=",v=(e,t)=>{if("disabled"!==e.status){if(t)e.status=t;else{if("disabled"===e.status)return;"checked"===e.status?e.status="nochecked":e.status="checked"}Array.isArray(e.materialList)&&e.materialList.forEach((t=>{"disabled"!==t.status&&("nochecked"===e.status?t.status="nochecked":t.status="checked")})),Array.isArray(e.children)&&e.children.forEach((t=>{v(t,e.status)}))}},R=(e,t="children")=>{let a=0,l=0,s=0,i=0,A=0;e.materialList&&e.materialList.length>0&&e.materialList.forEach((e=>{a+=1,"disabled"!==e.status?l+=1:s+=1,"checked"===e.status&&(i+=1)})),Array.isArray(e[t])&&e[t].forEach((e=>{a+=1,"disabled"!==e.status?l+=1:s+=1,"checked"===e.status&&(i+=1),"indeterminate"===e.status&&(A+=1)})),e.status=i>=l?"checked":i>0?"indeterminate":"nochecked",A>0&&(e.status="indeterminate"),a===s&&(e.status="disabled")},I=e({name:"child-node",props:{list:{type:Array,"default":()=>[]},collapse:{type:String,"default":""}},emits:["update:collapse","menuChange","materialChange"],setup:(e,{emit:l})=>()=>t(k,{modelValue:e.collapse,"onUpdate:modelValue":e=>{l("update:collapse",e)},border:!1,accordion:!0},{"default":()=>{var s;return[null==(s=e.list)?void 0:s.map((s=>t(f,{clickable:!1,center:!0,"class":U.collapseChild,name:s.id},{title:()=>t("div",{"class":[U.itemTitle,e.collapse===s.id?U.itemTitleActive:""]},[t("i",{"class":[U.arrow]},null),s.name]),"default":()=>t(a,null,[Array.isArray(null==s?void 0:s.materialList)&&s.materialList.map((e=>t(_,null,{title:()=>e.name,value:()=>t("img",{src:"disabled"===e.status?b:"checked"===e.status?M:E,"class":[U.radioBtn],onClick:t=>{t.stopPropagation(),"disabled"!==e.status&&("checked"===e.status?e.status="nochecked":e.status="checked",R(s),l("menuChange"))}},null)}))),Array.isArray(null==s?void 0:s.children)&&t(I,{list:s.children,collapse:s.collapse,"onUpdate:collapse":e=>{s.collapse=e},onMenuChange:()=>{R(s),l("menuChange")}},null)]),"right-icon":()=>t("img",{src:"indeterminate"===s.status?y:"disabled"===s.status?b:"checked"===s.status?M:E,"class":[U.radioBtn],onClick:e=>{e.stopPropagation(),v(s),l("menuChange")}},null)})))]}})}),L=e({name:"courseList",setup(){const e=l(),L=s({titleOpacity:0,catchStatus:!1,catchItem:{},loading:!0,detail:{id:null,cover:"",name:"",des:""},maxAddCourseware:0,list:[],ruleStatus:!1,isDownloading:!1,parentCollapse:"",childrenCollapse:"",disabledIds:[]}),S=(e=[])=>{const t=[];return e.forEach((e=>{let a={};e.status="nochecked",e.collapse="",Array.isArray(e.materialList)&&e.materialList.forEach((e=>{r.vIds.includes(e.id+"")||"VIDEO"!==e.typeCode?(e.status="disabled",L.disabledIds.push(e.id)):e.status="nochecked"})),a=e,Array.isArray(e.children)&&(a.children=S(e.children)),t.push({...a})})),t},x=(e,t,a=[])=>{for(const l of t){if(l.id===e)return[...a,e];if(Array.isArray(l.materialList))for(const t of l.materialList)if(t.id===e)return[...a,l.id,e];if(l.children&&l.children.length>0){const t=x(e,l.children,[...a,l.id]);if(t.includes(e))return t}}return a},Q=(e,t)=>{let a={};for(const l of t)l.id===e&&(a=l),l.children&&l.children.length>0&&!a.id&&(a=Q(e,l.children));return a},Y=(e=[])=>{const t=[];return e.forEach((e=>{Array.isArray(e.materialList)&&e.materialList.forEach((e=>{"checked"===e.status&&t.push({id:e.id,name:e.name,lessonCoursewareId:L.detail.id})})),Array.isArray(e.children)&&t.push(...Y(e.children))})),t};return i((async()=>{try{const e=await A.get(r.platformApi+"/sysConfig/queryByParamName",{params:{paramName:"upper_limit_homework_courseware"}});L.maxAddCourseware=e.data.paranValue||0}catch(t){}(async()=>{const t=await A.get("".concat(r.platformApi,"/lessonCourseware/getLessonCoursewareDetail/").concat(e.query.id));(null==t?void 0:t.data)&&(L.detail.id=t.data.id,L.detail.cover=t.data.coverImg,L.detail.name=t.data.name,L.detail.des=t.data.lessonTargetDesc)})(),(async()=>{L.loading=!0;try{const t=await A.get(r.platformApi+"/lessonCourseware/getLessonCoursewareCourseList/"+e.query.id);if(Array.isArray(null==t?void 0:t.data)){t.data.forEach((e=>{e.status="nochecked",e.children=e.knowledgePointList||[],e.id=e.coursewareDetailId,e.name=e.coursewareDetailName,S(e.children)})),L.list=t.data;const e={};L.disabledIds.forEach((t=>{e[t]=x(t,L.list)}));for(const t in e){const a=e[t];for(let e=a.length-2;e>=0;e--){const t=Q(a[e],L.list);R(t)}}}}catch(t){}L.loading=!1})()})),o("scroll",(()=>{const e=window.scrollY||window.pageYOffset||document.documentElement.scrollTop;L.titleOpacity=e>100?1:e/100})),()=>{let e;return t("div",{"class":U.courseList},[t(d,{border:!1,background:"rgba(255,255,255, ".concat(L.titleOpacity,")"),title:"教材详情"},null),t("div",{"class":U.periodContent},[t("div",{"class":U.cover},[t("img",{src:L.detail.cover,onLoad:e=>{e.target&&(e.target.style.opacity=1)}},null)]),t("div",null,[t("div",{"class":U.contentTitle},[L.detail.name]),t("div",{"class":U.contentLabel},[n("教学目标:"),L.detail.des])])]),t(c,{name:"van-fade"},{"default":()=>{return[!L.loading&&t(a,null,[t("div",{key:"periodTitle","class":U.periodTitle},[t("div",{"class":U.left},[t("img",{"class":U.pIcon,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAapJREFUWEftl7FKA0EQhv9NhAjhBHvLQBoj3L2DnaV2NhYWajqfwNo6PoGVptXCRxDcPVy1utIuTTAgEZSRExNi9Mxs5u488NJm5ua7b2d3bxQK/lMF50MJKF2h0uD/MdhsNr1avX4Yv/EzUScypufy9o1Go7boedsgWnHJ+xar1ONwMDiNougl/m/cgy3fvwKw/pnQQ6VyYG9uzrnFWr4fx25y42fEda0xW9OArwCqU4ndBWDfMGy2guAJRF4qgEoNrNZL04CU8HCWzTwMJgGOuH+1mUcPzgKMQXukVPtO67NUlpLxkMlNwgEc26wS7YZh2GfUEIXMCwgodWG13hBVZyTPDwj0rTHLjBqikPkBiTo2DNui6oxkZ0AChgo4ssYcA3hj1BCFOAEScE3Azr0xD6KqDsksQI61PzsHudbyuEmGAGoj+xxrkyuV+V286vsnCtiLi3KtfQHM+msm/vRaC4KPg/dW60vXHZp5DzpsrFxDy6FJqrs0WBqUGpDmj3swtXNMTJQ8F6c510oxf5iL05xrpXgJc3GxDRa+B6WrklV+eZNIzRbe4DtiDOop5126YAAAAABJRU5ErkJggg=="},null),t("div",{"class":U.pTitle},[n("课程列表")]),t("div",{"class":U.pNum},[n("共"),L.list.length,n("课")])]),t("div",{"class":U.right},[t("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAmVBMVEUAAAABwrYBwbUBwbUBwbQBwrUCwrYCw7UAwrUAwrcAw7gAwrYAv78AwbkBwbUAw7QBwbX///+h6OSJ4txn2tPQ8/Ga5uGP5N46z8Y2zsUbx70UxrsGwrf6/v30/Pzr+fjk+Pff9/bX9fO87uuF4duA39lc189S1cxI0souzMImysDG8e7G8O6n6eWD4Npx3NVP1MtE0cgKw7fljtW5AAAAEHRSTlMAzPjr18SkmGhYRBUIIdci7MCMzAAAATtJREFUOMuVlOtygjAQhQMIBgRNuBUEa6v12nvf/+G6g9HdkDgZzx/I4ZtscsiGUWU88gLfD7yIZ8yuOBREYWxBkokYaZKMkHQqLJqmlJl5wipvRpi5uKP5jUpxHnOua0VtPV3ze+rputS+iHWoJOi57tC67JHs/UkqvS4xiSFDZEr4XBXFBzy26MYAkZxfpMwFqADqjNkztkCmlXI1lPlbSblHP2McB3tYy23KEn3OIhycyvIwvCyh3A/6EbMF+QkpdCRQFphMDRMVZBww32ByYGpq+AjRQN+EBhnlWmB2uhUwz5yoGp8EFQFqi8UwAj5ydnl+HFkcfotTmfrBqK/1ptGdUB0VVAOb2+hQrA4d6gjQWm8/4/iK/l3Kbw1KLI3Qt2e9QR9pKXdzutvcfWG4r55HLzHU4s51+A/StULhhewHtwAAAABJRU5ErkJggg==","class":U.iconQuestion,onClick:()=>L.ruleStatus=!0},null)])]),t("div",{key:"list","class":U.periodList},[t(k,{modelValue:L.parentCollapse,"onUpdate:modelValue":e=>{L.parentCollapse=e,L.childrenCollapse=""},"class":U.collapseParent,border:!1,accordion:!0},(l=e=L.list.map((e=>t(f,{center:!0,name:e.coursewareDetailId,clickable:!1},{title:()=>t("div",{"class":[U.itemTitle,L.parentCollapse===e.coursewareDetailId?U.itemTitleActive:""]},[t("i",{"class":[U.arrow]},null),e.coursewareDetailName]),"default":()=>t(a,null,[Array.isArray(null==e?void 0:e.materialList)&&e.materialList.map((e=>t(_,null,{title:()=>e.name,value:()=>t("img",{src:M,"class":[U.radioBtn]},null)}))),Array.isArray(null==e?void 0:e.children)&&t(I,{list:e.children,collapse:e.collapse,"onUpdate:collapse":t=>{e.collapse=t},onMenuChange:()=>{R(e)}},null)]),"right-icon":()=>t("img",{src:"indeterminate"===e.status?y:"disabled"===e.status?b:"checked"===e.status?M:E,"class":[U.radioBtn],onClick:t=>{t.stopPropagation(),"disabled"!==e.status&&("checked"===e.status?e.status="nochecked":e.status="checked",Array.isArray(e.knowledgePointList)&&e.knowledgePointList.forEach((t=>{v(t,e.status)})))}},null)}))),"function"==typeof l||"[object Object]"===Object.prototype.toString.call(l)&&!w(l)?e:{"default":()=>[e]}))])])];var l}}),L.loading&&t(C,null,null),!L.loading&&!L.list.length&&t(u,{tips:"暂无内容"},null),t(B,{position:"bottom"},{"default":()=>[t("div",{"class":U.btnGroup},[t(p,{block:!0,type:"primary",color:"linear-gradient( 132deg, #60DBC7 0%, #01C1B5 100%)",onClick:()=>{const e=Y(L.list);-1!==r.max&&e.length>r.max?g("当前练习组只可添加".concat(r.max,"条练习内容")):m({api:"onCoursewareSelectResult",content:{result:e}})}},{"default":()=>[n("确定")]})])]}),t(h,{show:L.ruleStatus,"onUpdate:show":e=>L.ruleStatus=e,"class":U.popupRule},{"default":()=>[t("div",{"class":U.title},[n("温馨提示")]),t("div",{"class":U.content},[n("1、作业只能选择视频资源布置"),t("br",null,null),n("2、单个练习组最大可添加"),L.maxAddCourseware,n("个练习"),t("br",null,null),n("3、同练习组单个视频资源不可多次添加")]),t("div",{"class":U.popupBtnGroup},[t(p,{block:!0,color:"linear-gradient( 132deg, #60DBC7 0%, #01C1B5 100%)",onClick:()=>L.ruleStatus=!1},{"default":()=>[n("我知道了")]})])]})])}}});export{L as default};
|