1 |
- import{i as f}from"./icon_back-c5ec0a72-1715840129614.js";import{i as w,a as S,b as h}from"./icon-plus-t-35f4cdeb-1715840129614.js";import{c as v,d as C}from"./api-279396c0-1715840129614.js";import{T as u}from"./index-f592738f-1715840129614.js";import{d as T,u as L,r as o,e as k,p as z,f as t,w as B,aM as D,aN as b,k as K,C as y}from"./index-27f38392-1715840129614.js";import{N as I}from"./Slider-17a69cd3-1715840129614.js";const A="_container_1glyr_1",N="_iconBack_1glyr_6",P="_separator_1glyr_36",E="_wrap_1glyr_41",x="_wrapBottom_1glyr_47",W="_contentWrap_1glyr_50",R="_content_1glyr_50",$="_scrollBar_1glyr_67",M="_empty_1glyr_71",H="_directoryList_1glyr_76",U="_treeParent_1glyr_89",V="_treeChild_1glyr_92",O="_treeItem_1glyr_95",j="_childItem_1glyr_104",q="_title_1glyr_104",F="_dir_1glyr_76",G="_titleSelect_1glyr_126",J="_arrow_1glyr_134",Q="_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:N,separator:P,wrap:E,wrapBottom:x,contentWrap:W,content:R,scrollBar:$,empty:M,directoryList:H,treeParent:U,treeChild:V,treeItem:O,childItem:j,title:q,dir:F,titleSelect:G,arrow:J,arrowSelect:Q,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:f,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,p)=>t("div",{key:"child"+p,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};
|