import{i as S}from"./icon_back-c5ec0a72-1706882452509.js";import{i as h,a as x,b as v}from"./icon-plus-t-35f4cdeb-1706882452509.js";import{d as y,e as g}from"./api-6d1b538f-1706882452509.js";import{T as _}from"./index-dcd64cc7-1706882452509.js";import{d as C,u as T,r,e as L,p as k,f as t,w as z,ck as B,cl as D,k as b,A as m}from"./index-f5a86b16-1706882452509.js";import{N as K}from"./Slider-bd85da84-1706882452509.js";const I="_container_12xus_1",A="_iconBack_12xus_6",P="_separator_12xus_36",N="_wrap_12xus_41",E="_wrapBottom_12xus_47",W="_contentWrap_12xus_50",R="_content_12xus_50",$="_scrollBar_12xus_67",H="_empty_12xus_71",M="_directoryList_12xus_76",U="_treeParent_12xus_89",V="_treeChild_12xus_92",O="_treeItem_12xus_95",j="_title_12xus_107",q="_dir_12xus_76",F="_titleSelect_12xus_126",G="_arrow_12xus_134",J="_arrowSelect_12xus_141",Q="_childArrow_12xus_145",X="_childItem_12xus_148",Y="_childSelect_12xus_155",Z="_musicStaff_12xus_162",ee="_musicTitle_12xus_184",te="_musicContent_12xus_192",se="_changeSizeSection_12xus_203",le="_iconT_12xus_216",ae="_iconAddT_12xus_220",ce="_iconPlusT_12xus_221",e={container:I,iconBack:A,separator:P,wrap:N,wrapBottom:E,contentWrap:W,content:R,scrollBar:$,empty:H,directoryList:M,treeParent:U,treeChild:V,treeItem:O,title:j,dir:q,titleSelect:F,arrow:G,arrowSelect:J,childArrow:Q,childItem:X,childSelect:Y,musicStaff:Z,musicTitle:ee,musicContent:te,changeSizeSection:se,iconT:le,iconAddT:ae,iconPlusT:ce},_e=C({name:"cotnent-knowledge",setup(){const p=T(),o=r(!1),n=r(!1),u=r(),s=L({fontSize:18,tableList:[],selectKey:null,details:{}}),f=async()=>{o.value=!0,n.value=!0;try{const{data:c}=await y({type:"COURSEWARE"});if(s.tableList=c||[],s.tableList.length){const l=s.tableList[0].lessonCoursewareDetailKnowledgeDetailList;if(s.tableList[0].selected=!0,l&&l.length){const i=l[0];s.selectKey=i.id,await d()}}}catch(c){}n.value=!1,o.value=!1},d=async()=>{n.value=!0;try{const{data:c}=await g({id:s.selectKey});s.details=c}catch(c){}n.value=!1};return k(()=>{f()}),()=>{var c;return t("div",{class:e.container},[t(z,{align:"center",wrapItem:!1,size:16},{default:()=>[t("img",{style:{cursor:"pointer"},src:S,class:e.iconBack,onClick:()=>{p.push("/")}},null),t(B,{separator:""},{default:()=>[t(D,{onClick:()=>{}},{default:()=>[b("乐理知识")]})]})]}),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,!o.value&&s.tableList.length<=0?e.empty:""],style:{minHeight:"100%"}},[t(m,{show:o.value},{default:()=>[t("div",{class:[e.listSection]},[s.tableList.map((l,i)=>t("div",{class:e.treeParent,key:"parent"+i},[t("div",{class:[e.treeItem,e.parentItem],onClick:()=>{s.tableList.forEach(a=>{l.id!==a.id&&(a.selected=!1)}),l.selected=!l.selected}},[l.lessonCoursewareDetailKnowledgeDetailList&&l.lessonCoursewareDetailKnowledgeDetailList.length>0&&t("span",{class:[e.arrow,l.selected?e.arrowSelect:""]},null),t("p",{class:[e.title,l.selected?e.titleSelect:""]},[t("span",{class:[e.dir,l.selected?e.dirSelect:""]},null),l.name])]),l.selected&&l.lessonCoursewareDetailKnowledgeDetailList&&l.lessonCoursewareDetailKnowledgeDetailList.map((a,w)=>t("div",{key:"child"+w,class:[e.treeItem,e.childItem,e.animation,s.selectKey===a.id?e.childSelect:""],onClick:()=>{s.selectKey!==a.id&&(s.selectKey=a.id,d(),u.value.$el.scrollTo(0,0))}},[t("span",{class:e.childArrow},null),t("p",{class:e.title},[a.name])]))]))])]}),!o.value&&s.tableList.length<=0&&t(_,{style:{height:"100%"}},null)])]),t("div",{class:e.musicStaff},[t(m,{show:n.value,ref:u,class:!n.value&&!((c=s.details)!=null&&c.desc)?e.empty:""},{default:()=>{var l,i,a;return[(l=s.details)!=null&&l.desc?t("div",{class:e.musicContent,innerHTML:(i=s.details)==null?void 0:i.desc,style:{fontSize:s.fontSize+"px"}},null):"",!n.value&&!((a=s.details)!=null&&a.desc)&&t(_,null,null)]}})]),t("div",{class:e.changeSizeSection},[t("img",{src:h,class:e.iconT},null),t("img",{src:x,class:e.iconAddT,onClick:()=>{s.fontSize>=32||(s.fontSize+=1)}},null),t(K,{value:s.fontSize,"onUpdate:value":l=>s.fontSize=l,vertical:!0,min:12,max:32},null),t("img",{src:v,class:e.iconPlusT,onClick:()=>{s.fontSize<=12||(s.fontSize-=1)}},null)])])])])])}}});export{_e as default};
