import{j as Fe,C as X,n as Ae,o as Me,p as Ge,r as ke}from"./isCollaose-aad6442a.js";import{P as oe}from"./index-7da9e175.js";import{T as ne}from"./index-5bfe8f9d.js";import{r as ie}from"./searchArray-7171584c.js";import{u as q}from"./catchData-0142750b.js";import{d as N,e as P,r as v,n as j,f as e,w as k,j as B,E as ce,N as H,g as Q,t as le,aU as $,R as I,M as D,O as ue,S as re,U as de,k as b,F as x,A as pe,x as Ue,v as J,b as ee,L as Ie,df as Pe,h as xe,W as Ne,dg as _,dh as Te,C as je,di as We,P as Le,m as Ee,p as De,q as ae}from"./index-937aaf25.js";import{A as Oe,m as ge,f as fe,i as ze,a as _e,b as Qe,c as ve,d as Ve,e as Be}from"./index-f6693dd8.js";import{T as me}from"./index-5df1a812.js";import{C as he,N as Ke}from"./contants-0aeae322.js";import{g as Z,s as U,a as ye,b as V}from"./api-2ae5e293.js";import{p as be,a as Ye}from"./index-3534dcc6.js";import"./index-9ca873fd.js";import"./Slider-c8e034c1.js";const Je="_listWrap_sirzm_1",Xe="_list_sirzm_1",Ze="_searchGroup_sirzm_46",qe="_btnType_sirzm_50",He="_inputSearch_sirzm_84",$e="_searchCatatory_sirzm_103",et="_addTrain_sirzm_110",se={listWrap:Je,list:Xe,searchGroup:Ze,btnType:qe,inputSearch:He,searchCatatory:$e,addTrain:et},tt="_list_vwz07_1",at="_itemWrap_vwz07_11",st="_itemWrapBox_vwz07_16",lt="_searchGroup_vwz07_28",ot="_btnType_vwz07_32",nt="_inputSearch_vwz07_67",it="_searchCatatory_vwz07_91",ct="_addTrain_vwz07_98",ut="_teachingModal_vwz07_110",rt="_spaceSection_vwz07_113",dt="_collapseWrap_vwz07_120",pt="_collaoseBtn_vwz07_126",gt="_isStart_vwz07_131",ft="_isHidden_vwz07_134",mt="_hideButton_vwz07_138",M={list:tt,itemWrap:at,itemWrapBox:st,searchGroup:lt,btnType:ot,inputSearch:nt,searchCatatory:it,addTrain:ct,teachingModal:ut,spaceSection:rt,collapseWrap:dt,collaoseBtn:pt,isStart:gt,isHidden:ft,hideButton:mt};function Se(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!$(n)}const ht=N({name:"search-group",emits:["search","add"],expose:["init"],setup(n,{emit:s}){const t=q(),u=P({type:"MUSIC",name:"",bookVersionId:null,subjectId:null}),i=()=>{s("search",u)},p=v(),r=v([]),y=v(0),l=v(0),o=v(!1),A=v(!1),a=d=>{d!=null&&d.selfElRef&&r.value.push(d.selfElRef.parentNode)},c=d=>{o.value=d,f()},f=()=>{try{r.value=[...new Set(r.value)];let d=-1;r.value.forEach((m,g)=>{g===0?(l.value=1,d=m.offsetLeft):m.offsetLeft===d&&g!=0&&l.value++,o.value?m.style.display="block":l.value>1?m.style.display="none":m.style.display="block"}),A.value=!0}catch(d){}};return j(async()=>{var d;console.log("加载"),await t.getMusicSheetCategory(),await t.getSubjects(),u.type==="MUSIC"&&(y.value=(d=p.value)==null?void 0:d.offsetHeight,f())}),()=>{let d,m;return e("div",{class:M.searchGroup},[e("div",{class:[M.searchCatatory]},[e(k,{size:"small",class:M.btnType},Se(d=ie.map(g=>e(B,{type:u.type===g.value?"primary":"default",secondary:u.type!==g.value,round:!0,size:"small",focusable:!1,onClick:()=>{u.type=g.value,i(),ce(()=>{var R;u.type==="MUSIC"?(y.value=(R=p.value)==null?void 0:R.offsetHeight,f()):r.value=[]})}},{default:()=>[g.label]})))?d:{default:()=>[d]})]),e(H,{labelAlign:"left",labelPlacement:"left"},{default:()=>[u.type==="MUSIC"&&e("div",{class:[M.collapsSection]},[e(Q,{label:"教材:"},{default:()=>[e("div",{class:[M.collapseWrap,A.value?"":M.hideButton,o.value?"":M.isHidden],ref:p},[e(k,{class:[M.spaceSection]},{default:()=>[t.getAllMusicCategories.map(g=>e(B,{ref:a,secondary:u.bookVersionId===g.id,quaternary:u.bookVersionId!==g.id,strong:!0,focusable:!1,type:u.bookVersionId===g.id?"primary":"default",onClick:()=>{u.bookVersionId=g.id,i()}},{default:()=>[g.name]})),l.value>1&&e("div",{style:{height:"var(--n-blank-height)",position:"absolute",display:"flex",alignItems:"center"},onClick:()=>{c(!o.value)}},[e(le,{previewDisabled:!0,src:Fe,class:[M.collaoseBtn,o.value?M.isStart:""]},null)])]})])]})]),e(Q,{label:"乐器:"},{default:()=>[e(k,{class:M.spaceSection},Se(m=t.getSubjectAllList.map(g=>e(B,{secondary:u.subjectId===g.id,quaternary:u.subjectId!==g.id,strong:!0,focusable:!1,type:u.subjectId===g.id?"primary":"default",onClick:()=>{u.subjectId=g.id,i()}},{default:()=>[g.name]})))?m:{default:()=>[m]})]}),e(ne,{class:M.inputSearch,round:!0,onSearch:g=>{u.name=g,i()}},null)]})])}}}),yt=N({name:"shareResources-guide",emits:["close"],setup(n,{emit:s}){const t=P({box:{height:"0px"},show:!1,steps:[{ele:"",eleRect:{},img:Z("shareResources1.png"),handStyle:{top:"0.91rem"},imgStyle:{top:I(-4),left:I(-263),width:I(553),height:I(229)},btnsStyle:{bottom:I(30),left:I(-102)},eleRectPadding:{left:14,top:14,width:28,height:28},boxStyle:{borderRadius:"30px"}},{ele:"",img:Z("shareResources2.png"),imgStyle:{left:I(99),width:I(618),height:I(273)},btnsStyle:{bottom:I(88),left:I(240)},eleRectPadding:{left:7,top:7,width:14,height:14},boxStyle:{borderRadius:"15px"},type:"bottom"}],step:0}),u=v(!1),i=v({});(async()=>{var a;try{const c=await ye({guideTag:"teacher-guideInfo"});c.data?i.value=JSON.parse((a=c.data)==null?void 0:a.guideValue)||null:i.value={},i.value&&i.value.shareResourcesGuide?u.value=!1:u.value=!0}catch(c){console.log(c)}})();const r=()=>{var c,f,d,m;const a=document.getElementById("shareResources-".concat(t.step));if(a){const g=a.getBoundingClientRect(),R=((c=t.steps[t.step].eleRectPadding)==null?void 0:c.left)||0,W=((f=t.steps[t.step].eleRectPadding)==null?void 0:f.top)||0,h=((d=t.steps[t.step].eleRectPadding)==null?void 0:d.width)||0,S=((m=t.steps[t.step].eleRectPadding)==null?void 0:m.height)||0;"shareResources-".concat(t.step)=="shareResources-1"?(t.box={left:g.x-R+"px",top:g.y-W+"px",width:(g.width+h)*2+h+"px",height:g.height+S+"px"},console.log(t.box.width,"---",g.width)):t.box={left:g.x-R+"px",top:g.y-W+"px",width:g.width+h+"px",height:g.height+S+"px"}}else o()},y=async a=>{try{if(a!=="shareResources")return;i.value?i.value.classGuide=!1:i.value={classGuide:!1};try{await V({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(i.value)})}catch(c){console.log(c)}t.step=0,r(),u.value=!0}catch(c){}};j(()=>{r(),window.addEventListener("resize",l),D.on("natural-resources-guide",a=>y(a))});const l=()=>{r()};ue(()=>{window.removeEventListener("resize",l),D.off("natural-resources-guide",y)});const o=()=>{if(t.step>=4){A();return}t.step=t.step+1,r()},A=async()=>{i.value?i.value.shareResourcesGuide=!0:i.value={shareResourcesGuide:!0};try{const a=await V({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(i.value)})}catch(a){console.log(a)}u.value=!1};return()=>e(x,null,[u.value?re(e("div",{"onUpdate:show":a=>u.value=a,class:["n-modal-mask","n-modal-mask-guide"]},[e("div",{class:U.content,onClick:()=>o()},[e("div",{class:U.backBtn,onClick:a=>{a.stopPropagation(),A()}},[b("跳过")]),e("div",{class:U.box,style:{...t.box,...t.steps[t.step].boxStyle},id:"modeType-".concat(t.step)},[t.steps.map((a,c)=>{var f,d,m,g;return e("div",{onClick:R=>R.stopPropagation(),class:U.item,style:a.type=="bottom"?{display:c===t.step?"":"none",left:"".concat((f=a.eleRect)==null?void 0:f.left,"px"),top:"-".concat((d=a.imgStyle)==null?void 0:d.height)}:{display:c===t.step?"":"none",left:"".concat((m=a.eleRect)==null?void 0:m.left,"px"),top:"".concat((g=t.box)==null?void 0:g.height)}},[e("img",{class:U.img,style:a.imgStyle,src:a.img},null),e("div",{class:U.btns,style:a.btnsStyle},[t.step+1==t.steps.length?e(x,null,[e("div",{class:[U.endBtn],onClick:()=>A()},[b("完成")]),e("div",{class:U.nextBtn,onClick:()=>{t.step=0,r()}},[b("再看一遍")])]):e("div",{class:U.btn,onClick:()=>o()},[b("下一步 ("),t.step+1,b("/"),t.steps.length,b(")")])])])})])])]),[[de,u.value,"show"]]):null])}}),At=N({name:"share-resources",setup(){const n=P({searchWord:"",loading:!1,pageTotal:0,pagination:{page:1,rows:20},searchGroup:{type:"MUSIC",name:"",bookVersionId:null,subjectId:null,sourceType:2},tableList:[],teachingStatus:!1,show:!1,item:{}}),s=v(!1),t=v(),u=async()=>{try{n.loading=!0;const{data:r}=await ge({...n.searchGroup,...n.pagination});n.loading=!1,n.pageTotal=Number(r.total);const y=r.rows||[],l=[];y.forEach(o=>{l.push({id:o.id,coverImg:o.coverImg,type:o.type,title:o.name,isCollect:!!o.favoriteFlag,isSelected:o.sourceFrom==="PLATFORM",content:o.content})}),n.tableList=l||[],setTimeout(()=>{s.value=!0},500)}catch(r){n.loading=!1}},i=async r=>{n.pagination.page=1,n.searchGroup=Object.assign(n.searchGroup,r),u()},p=async r=>{try{await fe({materialId:r.id,favoriteFlag:r.isCollect?0:1,type:r.type}),r.isCollect=!r.isCollect}catch(y){}};return j(()=>{u()}),()=>e(x,null,[e(ht,{ref:t,onSearch:r=>i(r),onAdd:()=>n.teachingStatus=!0},null),e(pe,{show:n.loading,"onUpdate:show":r=>n.loading=r,style:{"min-height":"50vh"}},{default:()=>[e("div",{class:M.list},[n.tableList.map((r,y)=>e("div",{class:M.itemWrap},[e("div",{class:M.itemWrapBox},[y==0?e(X,Ue({id:"shareResources-1"},{item:r,disabledMouseHover:!1,onClick:l=>{l.type!=="IMG"&&(n.show=!0,n.item=l)},onCollect:l=>p(l)}),null):e(X,{item:r,disabledMouseHover:!1,onClick:l=>{l.type!=="IMG"&&(n.show=!0,n.item=l)},onCollect:l=>p(l)},null)])])),!n.loading&&n.tableList.length<=0&&e(me,{style:{minHeight:"50vh"},description:"暂无共享资源"},null)])]}),e(oe,{page:n.pagination.page,"onUpdate:page":r=>n.pagination.page=r,pageSize:n.pagination.rows,"onUpdate:pageSize":r=>n.pagination.rows=r,pageTotal:n.pageTotal,"onUpdate:pageTotal":r=>n.pageTotal=r,onList:u},null),e(he,{show:n.show,"onUpdate:show":r=>n.show=r,item:n.item},null),e(J,{show:n.teachingStatus,"onUpdate:show":r=>n.teachingStatus=r,preset:"card",showIcon:!1,class:["modalTitle background",M.teachingModal],title:"自定义教材",blockScroll:!1},{default:()=>[e(Oe,{onClose:()=>n.teachingStatus=!1},null)]}),s.value?e(yt,null,null):null])}}),vt="_list_1nw8j_1",bt="_searchGroup_1nw8j_10",St="_btnType_1nw8j_14",wt="_inputSearch_1nw8j_50",Ct="_searchCatatory_1nw8j_74",Ut="_btnGroup_1nw8j_81",It="_addTrain_1nw8j_84",Et="_error_1nw8j_92",Bt="_iconUpload_1nw8j_99",Rt="_iconEdit_1nw8j_103",Ft="_iconSelectAll_1nw8j_107",Mt="_iconDelete_1nw8j_111",Gt="_iconPen_1nw8j_115",kt="_itemWrap_1nw8j_119",Pt="_itemWrapBox_1nw8j_124",xt="_itemBg_1nw8j_136",Nt="_itemBgChecked_1nw8j_145",Tt="_resourceDefault_1nw8j_148",jt="_spaceSection_1nw8j_155",Wt="_attendClassModal_1nw8j_161",Lt="_attendClassSaveModal_1nw8j_167",Dt="_removeVisiable_1nw8j_173",Ot="_studentRemove_1nw8j_179",zt="_btnGroupModal_1nw8j_191",C={list:vt,searchGroup:bt,btnType:St,inputSearch:wt,searchCatatory:Ct,btnGroup:Ut,addTrain:It,error:Et,iconUpload:Bt,iconEdit:Rt,iconSelectAll:Ft,iconDelete:Mt,iconPen:Gt,itemWrap:kt,itemWrapBox:Pt,itemBg:xt,itemBgChecked:Nt,resourceDefault:Tt,spaceSection:jt,attendClassModal:Wt,attendClassSaveModal:Lt,removeVisiable:Dt,studentRemove:Ot,btnGroupModal:zt},_t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAmCAYAAAC76qlaAAAAAXNSR0IArs4c6QAAB9dJREFU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wFyPlZMx3zveNxCd5K1FSImkURURyG8QfA1SdwUookA8QvCuMF6kYoLjks/8vXkm2yiXEslEpYyF0EVwLbrDuGPnN/NBVzB1pysPT1srVyt/gBipDhkRTI1nM9m+gAI7tY/Qn69lx/K9u3uBWfMNbPfi/1mCetLy03M3FlApkbxPl9VEEzW5l8IX6xm6DOLDfjIEwXMER0MdypsQaSoBKqKXxrOZnyVwUk+R+rO+JtriIBH1tBTiyZPQeGmLtfuTU3hDgoR7J8v8SCDNS1ZbKwvEjv5maIgSXAXR8islcEEimO1YGLcEpAeRJiCSEsTdj0E8qqBeNf30mR70OroW7dRBDf0KBF9ZOW9GRLg+qAloefKJ+8uV8o/1LyuwfC/WOEsx7j5OwYiZTc81CnL//mjwZ/kZw6hcbFUAA9stELSqmhEj8sDY4hc/tQUqOtNxzcpizUn+jfneLesDCnF3BprnQquoY1Y+fWqD3XFPgzwU2iPiWFnP32C33X8A3lwdU2JMmvn53EBAgZN8m8QLdeBPYr43s14wcFyf5IPhhEoOmznv/e0FslOnCH20GyCIOhLLp08PgTZbsmGGAGn7Ug8zNMxQq0odDOtQh14WOO5bJI/VehnOWfnMgQ11yHbzBO166zhk5rwPtrVSl5xkUhNphsc040AsPx822rUnsFOvEfqEQFbFiOw2F+d+2Vagqnhxct+9Sq9Gx/KZHxq3JtXfpcnpKanw0pifvtBoL2x1t28F0MvYjQ+07CR3l4nv6y9tWd2kbhv/Nr3cSxY28y09lBrTq/ovEpGqT0Swp3HZm/fUteuXKwSjdeFfRbAAojIQlMAgMQXgnvDPQlbM0V07G69nWp46Att9h+DzAwF0CBbIu5bv1Td6151bAtU26itnQT67LVAin1q3R2fl/PmVRv2257LwGo9MaMiEkGoQOIpoBS5pkWy7673/AG2QyadOuCtAAAAAAElFTkSuQmCC";function we(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!$(n)}const Xt=N({name:"search-group",emits:["search","upload","edit","selectAll","delete","update"],setup(n,{emit:s}){const t=v([]),u=q(),i=P({type:"MUSIC",name:"",bookVersionId:null,subjectId:null}),p=P({isEdit:!1,isSelectAll:!1}),r=()=>{s("search",i)};return j(async()=>{t.value=[],ie.forEach(y=>{t.value.push(y)}),await u.getSubjects()}),()=>{let y,l;return e("div",{class:C.searchGroup},[e("div",{class:C.searchCatatory},[e(k,{size:"small",class:C.btnType},we(y=t.value.map(o=>e(B,{type:i.type===o.value?"primary":"default",secondary:i.type!==o.value,round:!0,size:"small",focusable:!1,onClick:()=>{i.type!==o.value&&(p.isEdit=!1,p.isSelectAll=!1,s("edit",p.isEdit)),i.type=o.value,r()}},{default:()=>[o.label]})))?y:{default:()=>[y]}),e(k,{size:"small",class:C.btnGroup},{default:()=>[p.isEdit?e(x,null,[e(B,{type:"primary",class:C.addTrain,focusable:!1,strong:!0,onClick:()=>{p.isSelectAll=!p.isSelectAll,s("selectAll",p.isSelectAll)}},{default:()=>[e("img",{src:p.isSelectAll?Vt:Kt,class:C.iconSelectAll},null),b("全选")]}),e(B,{type:"error",class:[C.addTrain,C.error],focusable:!1,strong:!0,onClick:()=>s("delete")},{default:()=>[e("img",{src:Jt,class:C.iconDelete},null),b("删除")]}),i.type!=="MUSIC"&&e(B,{type:"primary",class:C.addTrain,focusable:!1,strong:!0,onClick:()=>s("update")},{default:()=>[e("img",{src:Yt,class:C.iconPen},null),b("修改")]}),e(B,{type:"primary",class:C.addTrain,focusable:!1,strong:!0,onClick:()=>{p.isEdit=!1,p.isSelectAll=!1,s("edit",p.isEdit)}},{default:()=>[b("完成编辑")]})]):e(x,null,[e(B,Ue({type:"primary",class:C.addTrain,focusable:!1},{id:"myResources-0"},{strong:!0,onClick:()=>s("upload")}),{default:()=>[e("img",{src:_t,class:C.iconUpload},null),b("上传资源")]}),e(B,{type:"primary",class:C.addTrain,focusable:!1,strong:!0,onClick:()=>{p.isEdit=!0,s("edit",p.isEdit)}},{default:()=>[e("img",{src:Qt,class:C.iconEdit},null),b("编辑资源")]})])]})]),e(H,{labelAlign:"left",labelPlacement:"left"},{default:()=>[e(Q,{label:"乐器:"},{default:()=>[e(k,{class:C.spaceSection},we(l=u.getSubjectAllList.map(o=>e(B,{secondary:i.subjectId===o.id,quaternary:i.subjectId!==o.id,strong:!0,focusable:!1,type:i.subjectId===o.id?"primary":"default",onClick:()=>{i.subjectId!==o.id&&(p.isEdit=!1,p.isSelectAll=!1,s("edit",p.isEdit)),i.subjectId=o.id,r()}},{default:()=>[o.name]})))?l:{default:()=>[l]})]}),e(ne,{class:C.inputSearch,round:!0,onSearch:o=>{i.name=o,r()}},null)]})])}}}),Zt="_uploadModal_3dbwl_1",qt="_formModal_3dbwl_4",Ht="_formSpace_3dbwl_8",$t="_previewModal_3dbwl_11",ea="_image_3dbwl_23",ta="_titleType_3dbwl_32",aa="_iconUploadDelete_3dbwl_40",sa="_commonType_3dbwl_49",la="_formItem_3dbwl_72",oa="_btnGroup_3dbwl_97",na="_uploadFile_3dbwl_104",ia="_uploadBtn_3dbwl_111",ca="_iconUploadAdd_3dbwl_128",T={uploadModal:Zt,formModal:qt,formSpace:Ht,previewModal:$t,image:ea,titleType:ta,iconUploadDelete:aa,commonType:sa,formItem:la,btnGroup:oa,uploadFile:na,uploadBtn:ia,iconUploadAdd:ca};function ua(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!$(n)}const Re=n=>n.indexOf(".mp3")>-1?_.SONG:n.indexOf(".mp4")>-1?_.VIDEO:_.IMG,ra=N({name:"upload-modal",props:{list:{type:Array,default:()=>[]},editStatus:{type:Boolean,default:!0}},emits:["close","confirm"],setup(n,{emit:s}){const t=q(),u=v(),i=ee();v(),v([]);const p=P({list:[],uploading:!1,uploadUrl:"",name:"",subjectIds:[]}),r=a=>{let c=Ae;switch(a){case"IMG":c=Ae;break;case"VIDEO":c=ke;break;case"SONG":c=Ge;break;case"MUSIC":c=Me;break}return c},y=async()=>{var a;(a=u.value)==null||a.validate(async c=>{if(c){ce(Te);return}p.uploading=!0;try{const f=[];p.list.forEach(d=>{f.push({subjectIds:d.subjectIds.join(","),openFlag:d.openFlag,coverImg:d.coverImg,name:d.name,type:d.type,enableFlag:1,content:d.content,id:d.id||null})}),o.value?await _e(f):await Qe(f),p.list=[],i.success("保存成功"),s("close",!0),s("confirm")}catch(f){}p.uploading=!1})},l=a=>{p.list.splice(a,1)},o=Ie(()=>n.list.length>0);j(async()=>{const a=n.list||[],c=[];a.forEach(f=>{c.push({subjectIds:f.subjectId?f.subjectId.split(",").map(d=>Number(d)):[],openFlag:f.openFlag,coverImg:f.coverImg,name:f.title,type:f.type,sourceFrom:f.sourceFrom,enableFlag:f.enableFlag,content:f.content,id:f.id})}),p.list=c||[],console.log(c,"uploadForms"),await t.getSubjects()});const A=(a,c)=>{a.subjectIds=c.map(f=>f.id)};return()=>{let a;return e("div",{class:T.uploadModal},[e(Ke,{style:{"max-height":"55vh"}},{default:()=>[e(H,{ref:u,labelPlacement:"left",labelWidth:120,model:p,class:T.formModal},{default:()=>[e(k,{class:T.formSpace},ua(a=p.list.map((c,f)=>e("div",{class:T.formItem,key:f},[e("div",{class:T.previewModal},[e(le,{class:[T.titleType],src:r(c.type),previewDisabled:!0,objectFit:"cover"},null),!o.value&&e("img",{class:[T.iconUploadDelete],src:ze,onClick:()=>l(f)},null),e(le,{class:[T.cover,T.image],lazy:!0,previewDisabled:!0,src:c.coverImg,objectFit:"cover"},null),e("div",{class:T.commonType},[b("是否公开:"),e(Pe,{size:"small",value:c.openFlag,"onUpdate:value":d=>c.openFlag=d,disabled:c.sourceFrom==="TEACHER"&&c.type==="MUSIC"},null)])]),e(Q,{showFeedback:!1,path:"list.".concat(f,".name"),rule:[{required:!0,message:"请输入资源名称",trigger:["input","blur"]}]},{default:()=>[e(xe,{value:c.name,"onUpdate:value":d=>c.name=d,placeholder:"请输入资源名称",maxlength:25,clearable:!0},null)]}),e(Q,{path:"list[".concat(f,"].subjectIds"),showFeedback:!1,rule:[{required:!0,message:"请选择素材可用乐器",trigger:"change",type:"array"}]},{default:()=>[e(Ne,{value:c.subjectIds,"onUpdate:value":d=>c.subjectIds=d,placeholder:"请选择素材可用乐器(可多选)",options:t.getSubjectList,labelField:"name",valueField:"id",multiple:!0,maxTagCount:2,clearable:!0},{action:()=>e(x,null,[e(B,{text:!0,style:" --n-width: 100% ",onClick:()=>A(c,t.getSubjectList)},{default:()=>[b("全选")]})])})]})])))?a:{default:()=>[a]})]})]}),e(k,{class:T.btnGroup,justify:"center"},{default:()=>[e(B,{round:!0,onClick:()=>s("close")},{default:()=>[n.editStatus?"取消":"上一步"]}),e(B,{round:!0,type:"primary",loading:p.uploading,disabled:p.list.length===0,onClick:y},{default:()=>[b("确定")]})]})])}}}),da="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAA8dJREFUWEfNmU1sE1cQx///3Ue8CCOBnUJjpVUlop7opahqj3DmAFS0VdNDb1UL7YUg4bXSsARkBwk4FYp66wFQP1TEoedwBFX0Ui6tglSVyCnUNogYsTa7O9Vbs46dpPVXIPuOfm/m/XZm3rx5Y6LPkZh8uMP3/X0C2UVBBkRGgIxWR6AIQVGIIsFbpmleq53acqefrdiLUNJZ3ObW659DcEBEdvYiS/I2iKvW0NBXVWfz/W5luwJ8yZHkA7cyIZSjECS7Vb7qOqJK4ZmtVursPw6rnXR1BDTt0rsALkCwfYUy8i4oPxOcM8CFwGBRrzECyQSQEYGMQbgXIq+slMU9AIf8wvBP/wf5n4Aiwg12ZUqA44AsrQstgPM01PdP81t+7WQBPb8h9/BNCbz3hTjc7gFqxSeeFlLTJGU1XasCjp6TjQv3K98C8l5TiPRA+caCNf04n9Rf3/PYlKtud+FOQfgJRNSSAv4wsi318fwRPlmudAWgtpyyK9+1wYHzhmHu69Zinci1RYPAvwbIaCukV0h9sNySKwBVtnxcIE4kSPBGwkoceOwk/+60cS/zm5zqyzW3dlUg77Ts5Xgz6ROtetoAwwMh/DGKOQ03aqX2/OnQ7WXzbte+5og171ZmlyApoBxsPThNQJ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QR585wKo+3zZPPkz2W2RGJZUAC+6N/GZPaSHkPvcjqpNcNSlH6tGRiNgqc2k3702FYoMHXdKmRhLbEQTmxMJ2RueNnOSQyN6aeUtANkLqxKFAu4zd1ZYcRQWymCYRmhGND6aRBHftXPxpnRTb3dXfWl6fZyA+oWFuGvixJ+GMm932lKM0H90sSV5/S1M366QlKtKTIahPJe3LmNOf/0wUHO6cejeCbm9PNbarnM2QfMVJBz+gk4FajyiB6OtAJYrfeif10f0dUY4kb9DfEf/jo/ywKomDwAAAAASUVORK5CYII=",ga=N({name:"myResources-guide",emits:["close"],setup(n,{emit:s}){const t=P({box:{height:"0px"},show:!1,steps:[{ele:"",eleRect:{},img:Z("myResourecs1.png"),handStyle:{top:"0.91rem"},imgStyle:{top:I(-4),left:I(-240),width:I(556),height:I(257)},btnsStyle:{bottom:I(30),left:I(-80)},eleRectPadding:{left:14,top:14,width:28,height:28},boxStyle:{borderRadius:"30px"}}],step:0}),u=v(!1),i=v({});(async()=>{var a;try{const c=await ye({guideTag:"teacher-guideInfo"});c.data?i.value=JSON.parse((a=c.data)==null?void 0:a.guideValue)||null:i.value={},console.log(i.value,"guideInfo.value"),i.value&&i.value.myResourcesGuide?u.value=!1:u.value=!0}catch(c){console.log(c)}})();const r=()=>{var c,f,d,m;const a=document.getElementById("myResources-".concat(t.step));if(a){const g=a.getBoundingClientRect(),R=((c=t.steps[t.step].eleRectPadding)==null?void 0:c.left)||0,W=((f=t.steps[t.step].eleRectPadding)==null?void 0:f.top)||0,h=((d=t.steps[t.step].eleRectPadding)==null?void 0:d.width)||0,S=((m=t.steps[t.step].eleRectPadding)==null?void 0:m.height)||0;t.box={left:g.x-R+"px",top:g.y-W+"px",width:g.width+h+"px",height:g.height+S+"px"}}else o()},y=async a=>{try{if(a!=="myResources")return;i.value?i.value.classGuide=!1:i.value={classGuide:!1};try{await V({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(i.value)})}catch(c){console.log(c)}t.step=0,r(),u.value=!0}catch(c){}};j(()=>{r(),window.addEventListener("resize",l),D.on("natural-resources-guide",a=>y(a))});const l=()=>{r()};ue(()=>{window.removeEventListener("resize",l),D.off("natural-resources-guide",y)});const o=()=>{if(t.step>=4){A();return}t.step=t.step+1,r()},A=async()=>{i.value?i.value.myResourcesGuide=!0:i.value={myResourcesGuide:!0};try{const a=await V({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(i.value)})}catch(a){console.log(a)}u.value=!1};return()=>e(x,null,[u.value?re(e("div",{"onUpdate:show":a=>u.value=a,class:["n-modal-mask","n-modal-mask-guide"]},[e("div",{class:U.content,onClick:()=>o()},[e("div",{class:U.backBtn,onClick:a=>{a.stopPropagation(),A()}},[b("跳过")]),e("div",{class:U.box,style:{...t.box,...t.steps[t.step].boxStyle},id:"modeType-".concat(t.step)},[t.steps.map((a,c)=>{var f,d,m,g;return e("div",{onClick:R=>R.stopPropagation(),class:U.item,style:a.type=="bottom"?{display:c===t.step?"":"none",left:"".concat((f=a.eleRect)==null?void 0:f.left,"px"),top:"-".concat((d=a.imgStyle)==null?void 0:d.height)}:{display:c===t.step?"":"none",left:"".concat((m=a.eleRect)==null?void 0:m.left,"px"),top:"".concat((g=t.box)==null?void 0:g.height)}},[e("img",{class:U.img,style:a.imgStyle,src:a.img},null),e("div",{class:U.btns,style:a.btnsStyle},[t.step+1==t.steps.length?e(x,null,[e("div",{class:[U.endBtn],onClick:()=>A()},[b("完成")])]):e("div",{class:U.btn,onClick:()=>o()},[b("下一步 ("),t.step+1,b("/"),t.steps.length,b(")")])])])})])])]),[[de,u.value,"show"]]):null])}}),fa="_saveModal_9enii_1",ma="_uploadBtn_9enii_25",ha="_iconUploadAdd_9enii_47",ya="_btnGroup_9enii_57",Y={saveModal:fa,uploadBtn:ma,iconUploadAdd:ha,btnGroup:ya},Aa=N({name:"save-modal",props:{fileList:{type:String,default:""},imageList:{type:Array,default:()=>[]},accept:{type:String,default:".jpg,.png,.jpeg,.gif"},showType:{type:String,default:"default"},showFileList:{type:Boolean,default:!0},max:{type:Number,default:1},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},bucketName:{type:String,default:"gyt"},directoryDnd:{type:Boolean,default:!1},path:{type:String,default:""},fileName:{type:String,default:""}},emits:["close","confrim"],setup(n,{emit:s}){const t="https://".concat(n.bucketName,".ks3-cn-beijing.ksyuncs.com/"),u=ee(),i=v(!1),p=v(!1),r=v(),y=v(),l=P([]),o=v([]),A=v([]),a=async h=>{const S=h.file;let w=!0;const E=S.type.includes("image")?_.IMG:S.type.includes("audio")?_.SONG:S.type.includes("video")?_.VIDEO:"other";if(console.log(E,"type"),E==="other")return u.error("文件格式不支持"),!1;const F=E==="IMG"?2:E==="SONG"?20:500;if(F&&(w=S.file.size/1024/1024{f(h)},f=async h=>{const S=l.find(G=>G.id==h.file.id),w=t+S.key,E=Re(w);let F="";E==="IMG"?F=w:E==="SONG"?F=Le.SONG_DEFAULT_COVER:E==="VIDEO"&&(F=await m(S.tempFiileBuffer)),A.value.push({coverImg:F,content:w,id:h.file.id,name:h.file.name?h.file.name.slice(0,h.file.name.lastIndexOf(".")):""}),h.file.url=w,i.value=!1,p.value=!1},d=h=>new Promise(S=>{const w=document.createElement("video");w.currentTime=1,w.src=URL.createObjectURL(h),w.addEventListener("loadeddata",function(){const E=document.createElement("canvas"),F=w.videoWidth,G=w.videoHeight;E.width=F,E.height=G,E.getContext("2d").drawImage(w,0,0,F,G),E.toBlob(O=>{S(O)})})}),m=async h=>{try{p.value=!0;const S=await d(h||r.value),w="".concat(n.path).concat(Date.now()+".png"),E={filename:w,bucketName:n.bucketName,postData:{filename:w,acl:"public-read",key:w,unknowValueField:[]}},{data:F}=await be(E),G={policy:F.policy,signature:F.signature,key:w,acl:"public-read",KSSAccessKeyId:F.kssAccessKeyId,name:w},O=new FormData;for(const K in G)O.append(K,G[K]);return O.append("file",S),await Ye.post(t,O),t+w}finally{p.value=!1}},g=async h=>{const S=A.value.findIndex(w=>w.id===h.file.id);return A.value.splice(S,1),p.value=!1,!0},R=Ie(()=>{let h=!1;return o.value.forEach(S=>{S.status!=="finished"&&(h=!0)}),h||o.value.length<=0}),W=async()=>{const h=[];o.value.forEach(S=>{const w=A.value.find(E=>E.id===S.id);w&&h.push(w)}),s("confrim",h)};return()=>e("div",{class:Y.saveModal},[e(je,{ref:y,action:t,data:h=>{const S=l.find(G=>G.id==h.file.id),{id:w,tempFiileBuffer:E,...F}=S;return{...F}},fileList:o.value,"onUpdate:fileList":h=>o.value=h,accept:".jpg,jpeg,.png,audio/mp3,video/mp4",multiple:!0,max:10,showFileList:!0,showPreviewButton:!0,onBeforeUpload:h=>a(h),onFinish:h=>{c(h)},onRemove:h=>g(h)},{default:()=>[e(We,null,{default:()=>[e("div",{class:Y.uploadBtn},[e("div",{class:Y.iconUploadAdd},null),e("h3",null,[b("点击或者拖动文件到该区域来上传")]),e("p",null,[b("仅支持JPG、PNG、MP3、MP4格式文件,单次最多支持"),e("br",null,null),b("上传10个文件")])])]})]}),e(k,{class:Y.btnGroup,justify:"center"},{default:()=>[e(B,{round:!0,onClick:()=>s("close")},{default:()=>[b("取消")]}),e(B,{round:!0,type:"primary",disabled:R.value,onClick:W},{default:()=>[b("确定")]})]})])}}),va=N({name:"share-resources",setup(){const n=ee();Ee();const s=P({searchWord:"",loading:!1,pageTotal:0,pagination:{page:1,rows:20},searchGroup:{type:"MUSIC",name:"",bookVersionId:null,subjectId:null,sourceType:3},tableList:[],uploadStatus:!1,saveStatus:!1,show:!1,item:{},editStatus:!1,editList:[],editIds:[],removeVisiable:!1,removeContent:"是否删除该资源?",type:"remove",removeItem:{}}),t=v(!1),u=async()=>{try{s.loading=!0;const{data:l}=await ge({...s.searchGroup,...s.pagination});s.loading=!1,s.pageTotal=Number(l.total);const o=l.rows||[],A=[];o.forEach(a=>{A.push({id:a.id,coverImg:a.coverImg,type:a.type,title:a.name,isCollect:!!a.favoriteFlag,isSelected:a.sourceFrom==="PLATFORM",content:a.content,subjectId:a.subjectIds,sourceFrom:a.sourceFrom,enableFlag:a.enableFlag?1:0,openFlag:a.openFlag})}),s.tableList=A||[],setTimeout(()=>{t.value=!0},500)}catch(l){s.loading=!1}},i=async l=>{try{await fe({materialId:l.id,favoriteFlag:l.isCollect?0:1,type:l.type}),l.isCollect=!l.isCollect}catch(o){}},p=async l=>{s.pagination.page=1,s.searchGroup=Object.assign(s.searchGroup,l),u()},r=async()=>{try{s.searchGroup.type==="MUSIC"?await ve(s.editIds):await Ve(s.editIds),n.success("删除成功"),p(s.searchGroup),s.editIds=[]}catch(l){}},y=async()=>{try{s.searchGroup.type==="MUSIC"?await ve([s.removeItem.id]):await Be({ids:s.removeItem.id}),n.success("删除成功"),p(s.searchGroup)}catch(l){}};return j(()=>{u()}),()=>e(x,null,[e(Xt,{onSearch:l=>p(l),onUpload:()=>{s.editList=[],s.saveStatus=!0},onUpdate:()=>{const l=[];if(s.tableList.forEach(o=>{s.editIds.indexOf(o.id)>-1&&l.push(o)}),s.editList=l||[],s.editList.length<=0){n.error("至少选择一条资源进行编辑");return}s.uploadStatus=!0},onEdit:l=>{s.editStatus=l,s.editStatus||(s.editIds=[])},onSelectAll:l=>{if(l){const o=[];s.tableList.forEach(A=>{o.push(A.id)}),s.editIds=o}else s.editIds=[]},onDelete:()=>{if(s.editIds.length<=0){n.error("至少选择一条资源进行删除");return}s.type="delete",s.removeContent="是否删除该资源?",s.removeVisiable=!0}},null),e(pe,{show:s.loading,"onUpdate:show":l=>s.loading=l,style:{"min-height":"50vh"}},{default:()=>[e("div",{class:C.list},[s.tableList.map(l=>e("div",{class:C.itemWrap},[e("div",{class:C.itemWrapBox},[e(X,{item:l,disabledMouseHover:!1,offShelf:!l.enableFlag,onOffShelf:()=>{s.type="remove",s.removeContent="该资源已下架,是否删除?",s.removeVisiable=!0,s.removeItem=l},onClick:o=>{o.type==="IMG"||!l.enableFlag||(s.show=!0,s.item=o)},onCollect:o=>i(o)},null),s.editStatus&&e("div",{class:[C.itemBg,s.editIds.includes(l.id)?C.itemBgChecked:""],onClick:()=>{const o=s.editIds.indexOf(l.id);o>-1?s.editIds.splice(o,1):s.editIds.push(l.id)}},[e("img",{src:s.editIds.includes(l.id)?pa:da,class:C.resourceDefault},null)])])])),!s.loading&&s.tableList.length<=0&&e(me,{style:{minHeight:"50vh"},description:"暂无资源"},null)])]}),e(oe,{page:s.pagination.page,"onUpdate:page":l=>s.pagination.page=l,pageSize:s.pagination.rows,"onUpdate:pageSize":l=>s.pagination.rows=l,pageTotal:s.pageTotal,"onUpdate:pageTotal":l=>s.pageTotal=l,onList:u},null),e(he,{show:s.show,"onUpdate:show":l=>s.show=l,item:s.item},null),e(J,{show:s.uploadStatus,"onUpdate:show":l=>s.uploadStatus=l,preset:"card",showIcon:!1,class:["modalTitle background",C.attendClassModal],title:s.editStatus?"修改资源":"上传资源",blockScroll:!1},{default:()=>[e(ra,{editStatus:s.editStatus,onClose:()=>s.uploadStatus=!1,onConfirm:()=>{s.editIds=[],s.editList=[],s.saveStatus=!1,p(s.searchGroup)},list:s.editList},null)]}),e(J,{show:s.saveStatus,"onUpdate:show":l=>s.saveStatus=l,preset:"card",showIcon:!1,class:["modalTitle background",C.attendClassSaveModal],title:"上传资源",blockScroll:!1},{default:()=>[e(Aa,{onClose:()=>s.saveStatus=!1,onConfrim:l=>{const o=l||[],A=[];o.forEach(a=>{A.push({subjectIds:null,openFlag:!1,coverImg:a.coverImg,title:a.name||"",type:Re(a.content),enableFlag:1,content:a.content,id:null})}),s.editList=A,s.uploadStatus=!0,s.editStatus=!1}},null)]}),t.value?e(ga,null,null):null,e(J,{show:s.removeVisiable,"onUpdate:show":l=>s.removeVisiable=l,preset:"card",class:["modalTitle",C.removeVisiable],title:"提示"},{default:()=>[e("div",{class:C.studentRemove},[e("p",null,[s.removeContent]),e(k,{class:C.btnGroupModal,justify:"center"},{default:()=>[e(B,{round:!0,type:"primary",onClick:()=>{s.type==="remove"?y():r(),s.removeVisiable=!1}},{default:()=>[b("确定")]}),e(B,{round:!0,onClick:()=>s.removeVisiable=!1},{default:()=>[b("取消")]})]})])]})])}}),ba="_list_1mce6_1",Sa="_itemWrap_1mce6_11",wa="_itemWrapBox_1mce6_16",Ca="_searchGroup_1mce6_28",Ua="_btnType_1mce6_32",Ia="_inputSearch_1mce6_67",Ea="_searchCatatory_1mce6_91",Ba="_addTrain_1mce6_98",Ra="_spaceSection_1mce6_110",Fa="_collapseWrap_1mce6_116",Ma="_collaoseBtn_1mce6_122",Ga="_isStart_1mce6_127",ka="_collapsSection_1mce6_130",Pa="_isHidden_1mce6_133",xa="_hideButton_1mce6_137",L={list:ba,itemWrap:Sa,itemWrapBox:wa,searchGroup:Ca,btnType:Ua,inputSearch:Ia,searchCatatory:Ea,addTrain:Ba,spaceSection:Ra,collapseWrap:Fa,collaoseBtn:Ma,isStart:Ga,collapsSection:ka,isHidden:Pa,hideButton:xa};function Ce(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!$(n)}const Na=N({name:"search-group",emits:["search"],setup(n,{emit:s}){const t=q(),u=v([]),i=P({type:"",name:"",bookVersionId:null,subjectId:null}),p=()=>{s("search",i)},r=v(),y=v([]),l=v(0),o=v(0),A=v(!1),a=v(!1),c=()=>{try{y.value=[...new Set(y.value)];let f=-1;y.value.forEach((d,m)=>{m===0?(o.value=1,f=d.offsetLeft):d.offsetLeft===f&&m!=0&&o.value++,A.value?d.style.display="block":o.value>1?d.style.display="none":d.style.display="block"}),a.value=!0}catch(f){}};return j(async()=>{u.value=[{label:"全部",value:""},...ie],await t.getMusicSheetCategory(),await t.getSubjects()}),()=>{let f,d;return e("div",{class:L.searchGroup},[e("div",{class:L.searchCatatory},[e(k,{size:"small",class:L.btnType},Ce(f=u.value.map(m=>e(B,{type:i.type===m.value?"primary":"default",secondary:i.type!==m.value,round:!0,size:"small",focusable:!1,onClick:()=>{i.type=m.value,p(),ce(()=>{var g;i.type==="MUSIC"?(l.value=(g=r.value)==null?void 0:g.offsetHeight,c()):y.value=[]})}},{default:()=>[m.label]})))?f:{default:()=>[f]})]),e(H,{labelAlign:"left",labelPlacement:"left"},{default:()=>[e(Q,{label:"乐器:"},{default:()=>[e(k,{class:L.spaceSection},Ce(d=t.getSubjectAllList.map(m=>e(B,{secondary:i.subjectId===m.id,quaternary:i.subjectId!==m.id,strong:!0,focusable:!1,type:i.subjectId===m.id?"primary":"default",onClick:()=>{i.subjectId=m.id,p()}},{default:()=>[m.name]})))?d:{default:()=>[d]})]}),e(ne,{class:L.inputSearch,round:!0,onSearch:m=>{i.name=m,p()}},null)]})])}}}),Ta=N({name:"myColloge-guide",emits:["close"],setup(n,{emit:s}){const t=P({box:{height:"0px"},show:!1,steps:[{ele:"",img:Z("myColloge1.png"),imgStyle:{top:I(-4),left:I(630),width:I(458),height:I(291)},btnsStyle:{bottom:I(96),left:I(790)},eleRectPadding:{left:7,top:7,width:14,height:14},type:"bottom"}],step:0}),u=v(!1),i=v({});(async()=>{var a;try{const c=await ye({guideTag:"teacher-guideInfo"});c.data?i.value=JSON.parse((a=c.data)==null?void 0:a.guideValue)||null:i.value={},i.value&&i.value.myColloge?u.value=!1:u.value=!0}catch(c){console.log(c)}})();const r=()=>{var c,f,d,m;const a=document.getElementById("myColloge-".concat(t.step));if(a){const g=a.getBoundingClientRect(),R=((c=t.steps[t.step].eleRectPadding)==null?void 0:c.left)||0,W=((f=t.steps[t.step].eleRectPadding)==null?void 0:f.top)||0,h=((d=t.steps[t.step].eleRectPadding)==null?void 0:d.width)||0,S=((m=t.steps[t.step].eleRectPadding)==null?void 0:m.height)||0;t.box={left:g.x-R+"px",top:g.y-W+"px",width:g.width+h+"px",height:g.height+S+"px"}}else o()},y=async a=>{try{if(console.log(a),a!=="myCollect")return;console.log(a,"name"),i.value?i.value.myColloge=!1:i.value={myColloge:!1};try{await V({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(i.value)})}catch(c){console.log(c)}t.step=0,r(),u.value=!0}catch(c){}};j(()=>{r(),window.addEventListener("resize",l),D.on("natural-resources-guide",a=>y(a))});const l=()=>{r()};ue(()=>{window.removeEventListener("resize",l),D.off("natural-resources-guide",y)});const o=()=>{if(t.step>=4){A();return}t.step=t.step+1,r()},A=async()=>{i.value?i.value.myColloge=!0:i.value={myColloge:!0};try{const a=await V({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(i.value)})}catch(a){console.log(a)}u.value=!1};return()=>e(x,null,[u.value?re(e("div",{"onUpdate:show":a=>u.value=a,class:["n-modal-mask","n-modal-mask-guide"]},[e("div",{class:U.content,onClick:()=>o()},[e("div",{class:U.backBtn,onClick:a=>{a.stopPropagation(),A()}},[b("跳过")]),e("div",{class:U.box,style:{...t.box},id:"modeType-".concat(t.step)},[t.steps.map((a,c)=>{var f,d,m,g;return e("div",{onClick:R=>R.stopPropagation(),class:U.item,style:a.type=="bottom"?{display:c===t.step?"":"none",left:"".concat((f=a.eleRect)==null?void 0:f.left,"px"),top:"-".concat((d=a.imgStyle)==null?void 0:d.height)}:{display:c===t.step?"":"none",left:"".concat((m=a.eleRect)==null?void 0:m.left,"px"),top:"".concat((g=t.box)==null?void 0:g.height)}},[e("img",{class:U.img,style:a.imgStyle,src:a.img},null),e("div",{class:U.btns,style:a.btnsStyle},[t.step+1==t.steps.length?e(x,null,[e("div",{class:[U.endBtn],onClick:()=>A()},[b("完成")])]):e("div",{class:U.btn,onClick:()=>o()},[b("下一步 ("),t.step+1,b("/"),t.steps.length,b(")")])])])})])])]),[[de,u.value,"show"]]):null])}}),ja=N({name:"share-resources",setup(){const n=ee(),s=Ee(),t=P({searchWord:"",loading:!1,pageTotal:0,pagination:{page:1,rows:20},searchGroup:{type:"",name:"",bookVersionId:null,subjectId:null,sourceType:4},tableList:[],show:!1,item:{}}),u=async()=>{try{t.loading=!0;const{data:l}=await ge({...t.searchGroup,...t.pagination});t.loading=!1,t.pageTotal=Number(l.total);const o=l.rows||[],A=[];o.forEach(a=>{A.push({id:a.id,coverImg:a.coverImg,type:a.type,title:a.name,isCollect:!!a.favoriteFlag,isSelected:a.sourceFrom==="PLATFORM",content:a.content,subjectId:a.subjectIds,enableFlag:a.enableFlag?1:0,openFlag:a.openFlag})}),t.tableList=A||[],setTimeout(()=>{i.value=!0},500)}catch(l){t.loading=!1}},i=v(!1),p=async l=>{t.pagination.page=1,t.searchGroup=Object.assign(t.searchGroup,l),u()},r=async l=>{try{await fe({materialId:l.id,favoriteFlag:l.isCollect?0:1,type:l.type}),l.isCollect=!l.isCollect}catch(o){}},y=async l=>{try{s.warning({title:"提示",content:"该资源已下架,是否删除?",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{await Be({id:l.id}),n.success("删除成功"),p(t.searchGroup)}})}catch(o){}};return j(()=>{u()}),()=>e(x,null,[e(Na,{onSearch:l=>p(l)},null),e(pe,{show:t.loading,"onUpdate:show":l=>t.loading=l,style:{"min-height":"50vh"}},{default:()=>[e("div",{class:L.list,id:"myColloge-0"},[t.tableList.map(l=>e("div",{class:L.itemWrap},[e("div",{class:L.itemWrapBox},[e(X,{item:l,offShelf:!l.enableFlag,onOffShelf:()=>y(l),disabledMouseHover:!1,onClick:o=>{o.type==="IMG"||!l.enableFlag||(t.show=!0,t.item=o)},onCollect:o=>r(o)},null)])])),!t.loading&&t.tableList.length<=0&&e(me,{style:{minHeight:"50vh"},description:"暂无收藏资源"},null)])]}),e(oe,{page:t.pagination.page,"onUpdate:page":l=>t.pagination.page=l,pageSize:t.pagination.rows,"onUpdate:pageSize":l=>t.pagination.rows=l,pageTotal:t.pageTotal,"onUpdate:pageTotal":l=>t.pageTotal=l,onList:u},null),e(he,{show:t.show,"onUpdate:show":l=>t.show=l,item:t.item},null),i.value?e(Ta,null,null):null])}}),qa=N({name:"student-studentList",setup(){const n=v("myResources");return j(()=>{D.on("teacher-guideInfo",s=>{s==="natural-resources"&&D.emit("natural-resources-guide",n.value)})}),()=>e("div",{class:se.listWrap},[e(De,{defaultValue:"myResources",paneClass:se.paneTitle,justifyContent:"center",paneWrapperClass:se.paneWrapperContainer,"onUpdate:value":[s=>{n.value=s},s=>n.value=s],value:n.value},{default:()=>[e(ae,{name:"myResources",tab:"我的资源"},{default:()=>[e(va,null,null)]}),e(ae,{name:"shareResources",tab:"共享资源"},{default:()=>[e(At,null,null)],tab:()=>e("span",{id:"shareResources-0"},[b("共享资源")])}),e(ae,{name:"myCollect",tab:"我的收藏"},{default:()=>[e(ja,null,null)]})]})])}});export{qa as default};