index-cbea9e05-1702457100297.js 4.1 KB

1
  1. import{i as p}from"./icon_back-c5ec0a72-1702457100297.js";import{i as k,a as S,b as h}from"./icon-plus-t-35f4cdeb-1702457100297.js";import{d as v,e as y}from"./api-7b65732e-1702457100297.js";import{T as u}from"./index-79c200ea-1702457100297.js";import{d as g,u as C,r,e as T,n as L,f as t,w as z,ci as B,cj as D,k as b,A as w}from"./index-9f639282-1702457100297.js";import{N as K}from"./Slider-245046f7-1702457100297.js";const I="_container_1wqkq_1",A="_iconBack_1wqkq_6",P="_separator_1wqkq_36",N="_wrap_1wqkq_41",E="_wrapBottom_1wqkq_47",x="_contentWrap_1wqkq_50",W="_content_1wqkq_50",R="_scrollBar_1wqkq_67",$="_empty_1wqkq_71",H="_directoryList_1wqkq_76",M="_treeParent_1wqkq_89",U="_treeChild_1wqkq_92",V="_treeItem_1wqkq_95",j="_title_1wqkq_107",O="_dir_1wqkq_76",F="_titleSelect_1wqkq_126",G="_arrow_1wqkq_134",J="_arrowSelect_1wqkq_141",Q="_childArrow_1wqkq_145",X="_childItem_1wqkq_148",Y="_childSelect_1wqkq_155",Z="_musicStaff_1wqkq_162",ee="_musicTitle_1wqkq_184",te="_musicContent_1wqkq_192",se="_changeSizeSection_1wqkq_203",le="_iconT_1wqkq_216",ae="_iconAddT_1wqkq_220",ce="_iconPlusT_1wqkq_221",e={container:I,iconBack:A,separator:P,wrap:N,wrapBottom:E,contentWrap:x,content:W,scrollBar:R,empty:$,directoryList:H,treeParent:M,treeChild:U,treeItem:V,title:j,dir:O,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},ue=g({name:"cotnent-knowledge",setup(){const q=C(),o=r(!1),n=r(!1),d=r(),s=T({fontSize:18,tableList:[],selectKey:null,details:{}}),m=async()=>{o.value=!0,n.value=!0;try{const{data:c}=await v({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 _()}}}catch(c){}n.value=!1,o.value=!1},_=async()=>{n.value=!0;try{const{data:c}=await y({id:s.selectKey});s.details=c}catch(c){}n.value=!1};return L(()=>{m()}),()=>{var c;return t("div",{class:e.container},[t(z,{align:"center",wrapItem:!1,size:16},{default:()=>[t("img",{style:{cursor:"pointer"},src:p,class:e.iconBack,onClick:()=>{q.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(w,{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,f)=>t("div",{key:"child"+f,class:[e.treeItem,e.childItem,e.animation,s.selectKey===a.id?e.childSelect:""],onClick:()=>{s.selectKey!==a.id&&(s.selectKey=a.id,_(),d.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(u,{style:{height:"100%"}},null)])]),t("div",{class:e.musicStaff},[t(w,{show:n.value,ref:d,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(u,null,null)]}})]),t("div",{class:e.changeSizeSection},[t("img",{src:k,class:e.iconT},null),t("img",{src:S,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:h,class:e.iconPlusT,onClick:()=>{s.fontSize<=12||(s.fontSize-=1)}},null)])])])])])}}});export{ue as default};