import{i as p}from"./icon_back-c5ec0a72-1720452812367.js";import{i as w,a as S,b as h}from"./icon-plus-t-35f4cdeb-1720452812367.js";import{c as v,d as C}from"./api-d7a41832-1720452812367.js";import{T as u}from"./index-7ecc3f27-1720452812367.js";import{d as T,u as L,r as o,e as k,q as z,f as t,x as B,aQ as D,aR as b,k as K,E as y}from"./index-8fb4d12a-1720452812367.js";import{N as I}from"./Slider-e52b4cb2-1720452812367.js";const A="_container_1glyr_1",P="_iconBack_1glyr_6",N="_separator_1glyr_36",E="_wrap_1glyr_41",x="_wrapBottom_1glyr_47",R="_contentWrap_1glyr_50",W="_content_1glyr_50",$="_scrollBar_1glyr_67",H="_empty_1glyr_71",M="_directoryList_1glyr_76",U="_treeParent_1glyr_89",V="_treeChild_1glyr_92",q="_treeItem_1glyr_95",O="_childItem_1glyr_104",Q="_title_1glyr_104",j="_dir_1glyr_76",F="_titleSelect_1glyr_126",G="_arrow_1glyr_134",J="_arrowSelect_1glyr_141",X="_childArrow_1glyr_145",Y="_childSelect_1glyr_155",Z="_musicStaff_1glyr_162",ee="_musicTitle_1glyr_184",te="_musicContent_1glyr_192",le="_changeSizeSection_1glyr_203",se="_iconT_1glyr_216",ae="_iconAddT_1glyr_220",ce="_iconPlusT_1glyr_221",e={container:A,iconBack:P,separator:N,wrap:E,wrapBottom:x,contentWrap:R,content:W,scrollBar:$,empty:H,directoryList:M,treeParent:U,treeChild:V,treeItem:q,childItem:O,title:Q,dir:j,titleSelect:F,arrow:G,arrowSelect:J,childArrow:X,childSelect:Y,musicStaff:Z,musicTitle:ee,musicContent:te,changeSizeSection:le,iconT:se,iconAddT:ae,iconPlusT:ce},ue=T({name:"cotnent-knowledge",setup(){const g=L(),i=o(!1),n=o(!1),d=o(),l=k({fontSize:18,tableList:[],selectKey:null,details:{}}),m=async()=>{i.value=!0,n.value=!0;try{const{data:c}=await v({type:"COURSEWARE"});if(l.tableList=c||[],l.tableList.length){const s=l.tableList[0].lessonCoursewareDetailKnowledgeDetailList;if(l.tableList[0].selected=!0,s&&s.length){const r=s[0];l.selectKey=r.id,await _()}}}catch(c){}n.value=!1,i.value=!1},_=async()=>{n.value=!0;try{const{data:c}=await C({id:l.selectKey});l.details=c}catch(c){}n.value=!1};return z(()=>{m()}),()=>{var c;return t("div",{class:e.container},[t(B,{align:"center",wrapItem:!1,size:16},{default:()=>[t("img",{style:{cursor:"pointer"},src:p,class:e.iconBack,onClick:()=>{g.push("/")}},null),t(D,{separator:""},{default:()=>[t(b,{onClick:()=>{}},{default:()=>[K("乐理知识")]})]})]}),t("div",{class:[e.wrap]},[t("div",{class:e.content},[t("div",{class:e.contentWrap},[t("div",{class:e.directoryList},[t("div",{class:[e.scrollBar,!i.value&&l.tableList.length<=0?e.empty:""],style:{minHeight:"100%"}},[t(y,{show:i.value},{default:()=>[t("div",{class:[e.listSection]},[l.tableList.map((s,r)=>t("div",{class:e.treeParent,key:"parent"+r},[t("div",{class:[e.treeItem,e.parentItem],onClick:()=>{l.tableList.forEach(a=>{s.id!==a.id&&(a.selected=!1)}),s.selected=!s.selected}},[s.lessonCoursewareDetailKnowledgeDetailList&&s.lessonCoursewareDetailKnowledgeDetailList.length>0&&t("span",{class:[e.arrow,s.selected?e.arrowSelect:""]},null),t("p",{class:[e.title,s.selected?e.titleSelect:""]},[t("span",{class:[e.dir,s.selected?e.dirSelect:""]},null),s.name])]),s.selected&&s.lessonCoursewareDetailKnowledgeDetailList&&s.lessonCoursewareDetailKnowledgeDetailList.map((a,f)=>t("div",{key:"child"+f,class:[e.treeItem,e.childItem,e.animation,l.selectKey===a.id?e.childSelect:""],onClick:()=>{l.selectKey!==a.id&&(l.selectKey=a.id,_(),d.value.$el.scrollTo(0,0))}},[t("span",{class:e.childArrow},null),t("p",{class:e.title},[a.name])]))]))])]}),!i.value&&l.tableList.length<=0&&t(u,{style:{height:"100%"}},null)])]),t("div",{class:e.musicStaff},[t(y,{show:n.value,ref:d,class:!n.value&&!((c=l.details)!=null&&c.desc)?e.empty:""},{default:()=>{var s,r,a;return[(s=l.details)!=null&&s.desc?t("div",{class:e.musicContent,innerHTML:(r=l.details)==null?void 0:r.desc,style:{fontSize:l.fontSize+"px"}},null):"",!n.value&&!((a=l.details)!=null&&a.desc)&&t(u,null,null)]}})]),t("div",{class:e.changeSizeSection},[t("img",{src:w,class:e.iconT},null),t("img",{src:S,class:e.iconAddT,onClick:()=>{l.fontSize>=32||(l.fontSize+=1)}},null),t(I,{value:l.fontSize,"onUpdate:value":s=>l.fontSize=s,vertical:!0,min:12,max:32},null),t("img",{src:h,class:e.iconPlusT,onClick:()=>{l.fontSize<=12||(l.fontSize-=1)}},null)])])])])])}}});export{ue as default};
