1 |
- import{u as X,k as Ie,C as z,n as me,o as Me,p as Pe,r as Te}from"./isCollaose-e2448a95.js";import{P as se}from"./index-303f287e.js";import{i as Le,A as je,m as le,f as oe,a as De,b as Oe,c as We,d as Qe,e as Ue}from"./index-2c9646cc.js";import{T as ne}from"./index-33f2f2d8.js";import{r as ie}from"./searchArray-746f8390.js";import{d as L,e as T,r as v,n as O,f as e,v as P,j as R,k as A,N as q,g as Q,y as Y,b3 as ce,M as k,K as ue,a3 as re,a4 as de,F as B,A as H,w as ke,t as J,b as _,x as ye,di as Ve,dj as K,P as Ke,$ as ze,dk as Ye,h as Ae,J as be,C as Ee,dl as Je,m as xe,p as Ze,q as ee}from"./index-a35b8844.js";import{T as pe}from"./index-bfc96f1b.js";import{C as ge,N as Xe}from"./contants-78b8e3b7.js";import{g as Z,s as I,a as fe,b as he}from"./api-5904c957.js";import{C as qe,p as te,a as ve}from"./index-92f6e9ad.js";import"./index-4b99efe2.js";import"./Slider-952747c3.js";const He="_listWrap_sirzm_1",_e="_list_sirzm_1",$e="_searchGroup_sirzm_46",et="_btnType_sirzm_50",tt="_inputSearch_sirzm_84",at="_searchCatatory_sirzm_103",st="_addTrain_sirzm_110",ae={listWrap:He,list:_e,searchGroup:$e,btnType:et,inputSearch:tt,searchCatatory:at,addTrain:st},lt="_list_1hwnh_1",ot="_searchGroup_1hwnh_9",nt="_btnType_1hwnh_13",it="_inputSearch_1hwnh_48",ct="_searchCatatory_1hwnh_72",ut="_addTrain_1hwnh_79",rt="_teachingModal_1hwnh_91",dt="_spaceSection_1hwnh_94",pt="_collapseWrap_1hwnh_101",gt="_collaoseBtn_1hwnh_107",ft="_isStart_1hwnh_112",ht="_isHidden_1hwnh_115",F={list:lt,searchGroup:ot,btnType:nt,inputSearch:it,searchCatatory:ct,addTrain:ut,teachingModal:rt,spaceSection:dt,collapseWrap:pt,collaoseBtn:gt,isStart:ft,isHidden:ht};function Se(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!ce(o)}const mt=L({name:"search-group",emits:["search","add"],setup(o,{emit:s}){const t=X(),g=T({type:"MUSIC",name:"",bookVersionId:null,subjectId:null}),n=()=>{s("search",g)},u=v(),c=v([]),h=v(0),a=v(0),d=v(0),l=v(!1),i=p=>{p!=null&&p.selfElRef&&c.value.push(p.selfElRef.parentNode)},f=p=>{l.value=p,y()},y=()=>{c.value=[...new Set(c.value)];let p=-1;c.value.forEach((r,m)=>{m===0?(d.value=1,p=r.offsetLeft):r.offsetLeft===p&&m!=0&&d.value++,l.value?r.style.display="block":d.value>1?r.style.display="none":r.style.display="block"})};return O(async()=>{await t.getMusicSheetCategory(),await t.getSubjects(),h.value=u.value.offsetHeight,a.value=u.value.offsetHeight/d.value,y()}),()=>{let p,r;return e("div",{class:F.searchGroup},[e("div",{class:[F.searchCatatory]},[e(P,{size:"small",class:F.btnType},Se(p=ie.map(m=>e(R,{type:g.type===m.value?"primary":"default",secondary:g.type!==m.value,round:!0,size:"small",focusable:!1,onClick:()=>{g.type=m.value,n()}},{default:()=>[m.label]})))?p:{default:()=>[p]}),e(R,{type:"primary",class:F.addTrain,focusable:!1,strong:!0,onClick:()=>s("add")},{default:()=>[e("img",{src:Le},null),A("添加自定义教材")]})]),e(q,{labelAlign:"left",labelPlacement:"left"},{default:()=>[g.type==="MUSIC"&&e("div",{class:[F.collapsSection]},[e(Q,{label:"教材:"},{default:()=>[e("div",{class:[F.collapseWrap,l.value?"":F.isHidden],ref:u},[e(P,{class:[F.spaceSection]},{default:()=>[t.getAllMusicCategories.map(m=>e(R,{ref:i,secondary:g.bookVersionId===m.id,quaternary:g.bookVersionId!==m.id,strong:!0,focusable:!1,type:g.bookVersionId===m.id?"primary":"default",onClick:()=>{g.bookVersionId=m.id,n()}},{default:()=>[m.name]})),d.value>1&&e("div",{style:{height:"var(--n-blank-height)",position:"absolute",display:"flex",alignItems:"center"},onClick:()=>{f(!l.value)}},[e(Y,{previewDisabled:!0,src:Ie,class:[F.collaoseBtn,l.value?F.isStart:""]},null)])]})])]})]),e(Q,{label:"乐器:"},{default:()=>[e(P,{class:F.spaceSection},Se(r=t.getSubjectAllList.map(m=>e(R,{secondary:g.subjectId===m.id,quaternary:g.subjectId!==m.id,strong:!0,focusable:!1,type:g.subjectId===m.id?"primary":"default",onClick:()=>{g.subjectId=m.id,n()}},{default:()=>[m.name]})))?r:{default:()=>[r]})]}),e(ne,{class:F.inputSearch,round:!0,onSearch:m=>{g.name=m,n()}},null)]})])}}}),yt=L({name:"shareResources-guide",emits:["close"],setup(o,{emit:s}){const t=T({box:{height:"0px"},show:!1,steps:[{ele:"",eleRect:{},img:Z("shareResources1.png"),handStyle:{top:"0.91rem"},imgStyle:{top:k(-4),left:k(-263),width:k(553),height:k(229)},btnsStyle:{bottom:k(30),left:k(-102)},eleRectPadding:{left:14,top:14,width:28,height:28},boxStyle:{borderRadius:"30px"}},{ele:"",img:Z("shareResources2.png"),imgStyle:{left:k(99),width:k(618),height:k(273)},btnsStyle:{bottom:k(88),left:k(240)},eleRectPadding:{left:7,top:7,width:14,height:14},boxStyle:{borderRadius:"15px"},type:"bottom"}],step:0}),g=v(!1),n=v({});(async()=>{var l;try{const i=await fe({guideTag:"teacher-guideInfo"});i.data?n.value=JSON.parse((l=i.data)==null?void 0:l.guideValue)||null:n.value={},n.value&&n.value.shareResourcesGuide?g.value=!1:g.value=!0}catch(i){console.log(i)}})();const c=()=>{var i,f,y,p;const l=document.getElementById(`shareResources-${t.step}`);if(l){const r=l.getBoundingClientRect(),m=((i=t.steps[t.step].eleRectPadding)==null?void 0:i.left)||0,S=((f=t.steps[t.step].eleRectPadding)==null?void 0:f.top)||0,W=((y=t.steps[t.step].eleRectPadding)==null?void 0:y.width)||0,V=((p=t.steps[t.step].eleRectPadding)==null?void 0:p.height)||0;`shareResources-${t.step}`=="shareResources-1"?(t.box={left:r.x-m+"px",top:r.y-S+"px",width:(r.width+W)*2+W+"px",height:r.height+V+"px"},console.log(t.box.width,"---",r.width)):t.box={left:r.x-m+"px",top:r.y-S+"px",width:r.width+W+"px",height:r.height+V+"px"},console.log(`coai-${t.step}`,t.box)}else a()};O(()=>{c(),window.addEventListener("resize",h)});const h=()=>{c()};ue(()=>{window.removeEventListener("resize",h)});const a=()=>{if(t.step>=4){d();return}t.step=t.step+1,c()},d=async()=>{n.value?n.value.shareResourcesGuide=!0:n.value={shareResourcesGuide:!0};try{const l=await he({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(n.value)})}catch(l){console.log(l)}g.value=!1};return()=>e(B,null,[g.value?re(e("div",{"onUpdate:show":l=>g.value=l,class:["n-modal-mask","n-modal-mask-guide"]},[e("div",{class:I.content,onClick:()=>a()},[e("div",{class:I.backBtn,onClick:l=>{l.stopPropagation(),d()}},[A("跳过")]),e("div",{class:I.box,style:{...t.box,...t.steps[t.step].boxStyle},id:`modeType-${t.step}`},[t.steps.map((l,i)=>{var f,y,p,r;return e("div",{onClick:m=>m.stopPropagation(),class:I.item,style:l.type=="bottom"?{display:i===t.step?"":"none",left:`${(f=l.eleRect)==null?void 0:f.left}px`,top:`-${(y=l.imgStyle)==null?void 0:y.height}`}:{display:i===t.step?"":"none",left:`${(p=l.eleRect)==null?void 0:p.left}px`,top:`${(r=t.box)==null?void 0:r.height}`}},[e("img",{class:I.img,style:l.imgStyle,src:l.img},null),e("div",{class:I.btns,style:l.btnsStyle},[t.step+1==t.steps.length?e(B,null,[e("div",{class:[I.endBtn],onClick:()=>d()},[A("完成")]),e("div",{class:I.nextBtn,onClick:()=>{t.step=0,c()}},[A("再看一遍")])]):e("div",{class:I.btn,onClick:()=>a()},[A("下一步 ("),t.step+1,A("/"),t.steps.length,A(")")])])])})])])]),[[de,g.value,"show"]]):null])}}),At=L({name:"share-resources",setup(){const o=T({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=async()=>{try{o.loading=!0;const{data:u}=await le({...o.searchGroup,...o.pagination});o.loading=!1,o.pageTotal=Number(u.total);const c=u.rows||[],h=[];c.forEach(a=>{h.push({id:a.id,coverImg:a.coverImg,type:a.type,title:a.name,isCollect:!!a.favoriteFlag,isSelected:a.sourceFrom==="PLATFORM",content:a.content})}),o.tableList=h||[],setTimeout(()=>{s.value=!0},500)}catch(u){o.loading=!1}},g=async u=>{o.pagination.page=1,o.searchGroup=Object.assign(o.searchGroup,u),t()},n=async u=>{try{await oe({materialId:u.id,favoriteFlag:u.isCollect?0:1,type:u.type}),u.isCollect=!u.isCollect}catch(c){}};return O(()=>{t()}),()=>e(B,null,[e(mt,{onSearch:u=>g(u),onAdd:()=>o.teachingStatus=!0},null),e(H,{show:o.loading,"onUpdate:show":u=>o.loading=u,style:{"min-height":"50vh"}},{default:()=>[e("div",{class:F.list},[o.tableList.map((u,c)=>e(B,null,[c==0?e(z,ke({id:"shareResources-1"},{item:u,disabledMouseHover:!1,onClick:h=>{h.type!=="IMG"&&(o.show=!0,o.item=h)},onCollect:h=>n(h)}),null):e(z,{item:u,disabledMouseHover:!1,onClick:h=>{h.type!=="IMG"&&(o.show=!0,o.item=h)},onCollect:h=>n(h)},null)])),!o.loading&&o.tableList.length<=0&&e(pe,{style:{minHeight:"50vh"},description:"暂无共享资源"},null)])]}),e(se,{page:o.pagination.page,"onUpdate:page":u=>o.pagination.page=u,pageSize:o.pagination.rows,"onUpdate:pageSize":u=>o.pagination.rows=u,pageTotal:o.pageTotal,"onUpdate:pageTotal":u=>o.pageTotal=u,onList:t},null),e(ge,{show:o.show,"onUpdate:show":u=>o.show=u,item:o.item},null),e(J,{show:o.teachingStatus,"onUpdate:show":u=>o.teachingStatus=u,preset:"card",showIcon:!1,class:["modalTitle background",F.teachingModal],title:"自定义教材",blockScroll:!1},{default:()=>[e(je,{onClose:()=>o.teachingStatus=!1},null)]}),s.value?e(yt,null,null):null])}}),bt="_list_ow164_1",vt="_searchGroup_ow164_8",St="_btnType_ow164_12",Ct="_inputSearch_ow164_48",wt="_searchCatatory_ow164_72",It="_btnGroup_ow164_79",Ut="_addTrain_ow164_82",kt="_error_ow164_90",Et="_iconUpload_ow164_97",xt="_iconEdit_ow164_101",Rt="_iconSelectAll_ow164_105",Nt="_iconDelete_ow164_109",Ft="_iconPen_ow164_113",Bt="_itemSection_ow164_117",Gt="_itemBg_ow164_120",Mt="_itemBgChecked_ow164_129",Pt="_resourceDefault_ow164_132",Tt="_spaceSection_ow164_139",Lt="_attendClassModal_ow164_145",jt="_removeVisiable_ow164_151",Dt="_studentRemove_ow164_157",Ot="_btnGroupModal_ow164_169",w={list:bt,searchGroup:vt,btnType:St,inputSearch:Ct,searchCatatory:wt,btnGroup:It,addTrain:Ut,error:kt,iconUpload:Et,iconEdit:xt,iconSelectAll:Rt,iconDelete:Nt,iconPen:Ft,itemSection:Bt,itemBg:Gt,itemBgChecked:Mt,resourceDefault:Pt,spaceSection:Tt,attendClassModal:Lt,removeVisiable:jt,studentRemove:Dt,btnGroupModal:Ot},Wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAmCAYAAAC76qlaAAAAAXNSR0IArs4c6QAAB9dJREFUWEe1mQ2MHGUZx//POzO3V669j5mt0g8badGmRKFfVA2ijWCICAUKJbFAoygJkdAPtcnOXmuW2Ns5E6IUaSiCoJRKpdSWIn7RmIZqlBZL/Ugr6LVaS096O3PXa3vs7sy8j5m9/Zhu73Z2r8cmd7m7eT5+7/M+zzPP+x5hnD6pFIsNuf5PAfKzTJhGjKlgijHQS4STLPhgvN347btr6dx4uKSLNTKhMzMtz0hC4g4AH6hpj5AlxqsgsjzL+OPF+B4z+PTv8YT/9dnfZsYqABMahSDQTlVVvpnd0H6sUd1AfkzgQZRdiV3MWDiiU0IfMZ0EIcfAFARfzOoFskQOKcoyb0P77xqFbxi8aV1mju8hcHRp2BkBbxKJJ1Uhd7/XFX8n/Gxyiic6rnMDSSxnxm0AV/wSeQLiXtfq2NIIfEPgranT+rmcux+MWWUn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pizUn+jfneLesDCnF3BprnQquoY1Y+fWqD3XFPgzwU2iPiWFnP32C33X8A3lwdU2JMmvn53EBAgZN8m8QLdeBPYr43s14wcFyf5IPhhEoOmznv/e0FslOnCH20GyCIOhLLp08PgTZbsmGGAGn7Ug8zNMxQq0odDOtQh14WOO5bJI/VehnOWfnMgQ11yHbzBO166zhk5rwPtrVSl5xkUhNphsc040AsPx822rUnsFOvEfqEQFbFiOw2F+d+2Vagqnhxct+9Sq9Gx/KZHxq3JtXfpcnpKanw0pifvtBoL2x1t28F0MvYjQ+07CR3l4nv6y9tWd2kbhv/Nr3cSxY28y09lBrTq/ovEpGqT0Swp3HZm/fUteuXKwSjdeFfRbAAojIQlMAgMQXgnvDPQlbM0V07G69nWp46Att9h+DzAwF0CBbIu5bv1Td6151bAtU26itnQT67LVAin1q3R2fl/PmVRv2257LwGo9MaMiEkGoQOIpoBS5pkWy7673/AG2QyadOuCtAAAAAAElFTkSuQmCC";function Ce(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!ce(o)}const Jt=L({name:"search-group",emits:["search","upload","edit","selectAll","delete","update"],setup(o,{emit:s}){const t=v([]),g=X(),n=T({type:"",name:"",bookVersionId:null,subjectId:null}),u=T({isEdit:!1,isSelectAll:!1}),c=()=>{s("search",n)};return O(async()=>{t.value=[{label:"全部",value:""}],ie.forEach(h=>{h.value!=="MUSIC"&&t.value.push(h)}),await g.getSubjects()}),()=>{let h,a;return e("div",{class:w.searchGroup},[e("div",{class:w.searchCatatory},[e(P,{size:"small",class:w.btnType},Ce(h=t.value.map(d=>e(R,{type:n.type===d.value?"primary":"default",secondary:n.type!==d.value,round:!0,size:"small",focusable:!1,onClick:()=>{n.type=d.value,c()}},{default:()=>[d.label]})))?h:{default:()=>[h]}),e(P,{size:"small",class:w.btnGroup},{default:()=>[u.isEdit?e(B,null,[e(R,{type:"primary",class:w.addTrain,focusable:!1,strong:!0,onClick:()=>{u.isSelectAll=!u.isSelectAll,s("selectAll",u.isSelectAll)}},{default:()=>[e("img",{src:u.isSelectAll?Vt:Kt,class:w.iconSelectAll},null),A("全选")]}),e(R,{type:"error",class:[w.addTrain,w.error],focusable:!1,strong:!0,onClick:()=>s("delete")},{default:()=>[e("img",{src:Yt,class:w.iconDelete},null),A("删除")]}),e(R,{type:"primary",class:w.addTrain,focusable:!1,strong:!0,onClick:()=>s("update")},{default:()=>[e("img",{src:zt,class:w.iconPen},null),A("修改")]}),e(R,{type:"primary",class:w.addTrain,focusable:!1,strong:!0,onClick:()=>{u.isEdit=!1,s("edit",u.isEdit)}},{default:()=>[A("完成编辑")]})]):e(B,null,[e(R,ke({type:"primary",class:w.addTrain,focusable:!1},{id:"myResources-0"},{strong:!0,onClick:()=>s("upload")}),{default:()=>[e("img",{src:Wt,class:w.iconUpload},null),A("上传资源")]}),e(R,{type:"primary",class:w.addTrain,focusable:!1,strong:!0,onClick:()=>{u.isEdit=!0,s("edit",u.isEdit)}},{default:()=>[e("img",{src:Qt,class:w.iconEdit},null),A("编辑资源")]})])]})]),e(q,{labelAlign:"left",labelPlacement:"left"},{default:()=>[e(Q,{label:"乐器:"},{default:()=>[e(P,{class:w.spaceSection},Ce(a=g.getSubjectAllList.map(d=>e(R,{secondary:n.subjectId===d.id,quaternary:n.subjectId!==d.id,strong:!0,focusable:!1,type:n.subjectId===d.id?"primary":"default",onClick:()=>{n.subjectId=d.id,c()}},{default:()=>[d.name]})))?a:{default:()=>[a]})]}),e(ne,{class:w.inputSearch,round:!0,onSearch:d=>{n.name=d,c()}},null)]})])}}}),Zt="_uploadModal_xk0km_1",Xt="_formModal_xk0km_4",qt="_formSpace_xk0km_8",Ht="_previewModal_xk0km_11",_t="_image_xk0km_23",$t="_titleType_xk0km_32",ea="_iconUploadDelete_xk0km_40",ta="_commonType_xk0km_49",aa="_formItem_xk0km_72",sa="_btnGroup_xk0km_94",la="_uploadFile_xk0km_101",oa="_uploadBtn_xk0km_104",na="_iconUploadAdd_xk0km_121",N={uploadModal:Zt,formModal:Xt,formSpace:qt,previewModal:Ht,image:_t,titleType:$t,iconUploadDelete:ea,commonType:ta,formItem:aa,btnGroup:sa,uploadFile:la,uploadBtn:oa,iconUploadAdd:na},ia="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAAA8FJREFUeF7tnMFqE1EUhu+p6Kb2Fdx1AgZ8CBeCm0ITcN0EN6IL64OoC8WNpK6FVnAjuPAhhAQSd76CcWMxVyZtQiBJzfznnJnc6d91/v/e+31hJpmSIyHRvw+ffzTj3/g4xvAgxHhnegyRnyLhq9yQ90cH+/0UjyapbfpjP976PRy9jFGehBB3Vu9fJiLx3W4je/GoKX9SOmNSQi5lfIkx3N8Eskj4ttvIHqYkJSkhJ2fDNzGGp5vImL1GJLzttBrPimSqfG0yQvJ7xuQ8fl9/mVqHUSY7N+VeKveUZIScfBq9ipP4HHn3yo687hxmx0i27EwyQnpno36I8S4ESGTQbWVNKFtyKB0hp8NfIYTbIJ9xt93YA7OlxlISEjVkuu1GEmdNYpO5iN7pkEI070jrLIVYE1X2UYgSoHWcQqyJKvsoRAnQOk4h1kSVfRSiBGgdpxBroso+ClECtI5TiDVRZR+FKAFaxynEmqiyj0KUAK3jFGJNVNlHIUqA1nEKsSaq7KMQJUDrOIVYE1X2UYgSoHWcQqyJKvsoRAnQOk4h1kSVfRSiBGgdpxBroso+ClECtI5TiDVRZR+FKAFaxynEmqiyj0KUAK3jFGJNVNlHIUqA1nEKsSaq7Lu2QlZMSEB/RqZUUNv4+KqJE/NfUG02IaG2kCo62PLEiamQohMSKtp9bZddnDgxFYJMSKgtnYoONps4IfiEhIp2XttlLyZOiGZCQm3ZVHSwfOKEqCYkVLTx2i4rMpCebkJCbdlUdLAxhVREfs2yY16ytklIfsniTX17jExv6vzYuy1CLj/28ovhdgiZfzHko5PqhSw9OlmQ8p/xq9Vvvl47WPNwcfGQfPzurnyzx+/u21AucG3/QaXk5hanEDe0WDGFYNzcUhTihhYrphCMm1uKQtzQYsUUgnFzS1GIG1qsmEIwbm4pCnFDixVTCMbNLUUhbmixYgrBuLmlKMQNLVZMIRg3txSFuKHFiikE4+aWohA3tFgxhWDc3FIU4oYWK6YQjJtbikLc0GLFFIJxc0tRiBtarJhCMG5uKQpxQ4sVUwjGzS1FIW5osWIKwbi5pSjEDS1WTCEYN7cUhbihxYopBOPmlqIQN7RYsXIEyLjbbuxhK5ebmk+UK3fZ4quphuSIDLqtrFl81fITyQjRTJzIJyR0DrPj8vEWXzEZIfjEiYsJCUcH+/3ieMpPJCMkR4OMIpxNSCgfLbZiUkKKDutcnJCA4Sk/lZSQHM9m42yXJySUjxZbMTkhs2OumDgRrhpQjOEpP/UP2N84xSH2EaMAAAAASUVORK5CYII=",ca=L({name:"upload-file",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"},path:{type:String,default:""},fileName:{type:String,default:""},cropper:{type:Boolean,default:!1},options:{type:Object,default:()=>({viewMode:0,autoCrop:!0,enlarge:1,autoCropWidth:200,autoCropHeight:200,fixedBox:!1,previewsCircle:!0,title:"上传图片"})}},emits:["update:fileList","close","readFileInputEventAsArrayBuffer","remove","finished"],setup(o,{emit:s,expose:t,slots:g}){const n=`https://${o.bucketName}.ks3-cn-beijing.ksyuncs.com/`,u=_(),c=v(!1),h=v(!1),a=v(),d=v(),l=T({policy:"",signature:"",key:"",KSSAccessKeyId:"",acl:"public-read",name:""}),i=v([]),f=()=>{if(o.fileList){const C=o.fileList.split("/");i.value=[{id:new Date().getTime().toString(),name:C[C.length-1],status:"finished",url:o.fileList}]}else i.value=[]};f(),ye(()=>o.imageList,()=>{f()}),ye(()=>o.fileList,()=>{f()}),t({handleClearFile:()=>{var C;(C=d.value)==null||C.clear()}});const p=v(),r=async C=>{const b=C.file;let U=!0;const E=b.type.includes("image")?K.IMG:b.type.includes("audio")?K.SONG:K.VIDEO,G=E==="IMG"?2:E==="SONG"?20:500;if(G&&(U=b.file.size/1024/1024<G,!U))return u.error(`文件大小不能超过${G}M`),!1;if(!U)return U;if(o.cropper&&E==="IMG")return m(b.file,x=>{const D=Object.assign({},o.options,{img:x,name:b.file.name});c.value=!0,setTimeout(()=>{var j;(j=p.value)==null||j.edit(D)},100)}),!1;try{h.value=!0;const x=b.file.name,D=x.slice(x.lastIndexOf(".")),j=`${o.path}${o.fileName||Date.now()+D}`,Ge={filename:j,bucketName:o.bucketName,postData:{filename:j,acl:"public-read",key:j,unknowValueField:[]}},{data:$}=await te(Ge);l.policy=$.policy,l.signature=$.signature,l.key=j,l.KSSAccessKeyId=$.kssAccessKeyId,l.name=j,a.value=b.file}catch(x){return h.value=!1,!1}return!0},m=async(C,b)=>{const U=new FileReader;U.addEventListener("load",()=>b(U.result)),U.readAsDataURL(C)},S=C=>{W(C)},W=async C=>{const b=n+l.key,U=Re(b);let E="";U==="IMG"?E=b:U==="SONG"?E=Ke.SONG_DEFAULT_COVER:U==="VIDEO"&&(E=await Ne()),s("update:fileList",b),s("readFileInputEventAsArrayBuffer",a.value),s("finished",{coverImg:E,content:b}),C.file.url=b,c.value=!1,h.value=!1},V=C=>new Promise(b=>{const U=document.createElement("video");U.currentTime=1,U.src=URL.createObjectURL(C),U.addEventListener("loadeddata",function(){const E=document.createElement("canvas"),G=U.videoWidth,x=U.videoHeight;E.width=G,E.height=x,E.getContext("2d").drawImage(U,0,0,G,x),console.log(E),E.toBlob(D=>{console.log(D),b(D)})})}),Ne=async()=>{try{h.value=!0;const C=await V(a.value),b=`${o.path}${Date.now()+".png"}`,U={filename:b,bucketName:o.bucketName,postData:{filename:b,acl:"public-read",key:b,unknowValueField:[]}},{data:E}=await te(U),G={policy:E.policy,signature:E.signature,key:b,acl:"public-read",KSSAccessKeyId:E.kssAccessKeyId,name:b},x=new FormData;for(const j in G)x.append(j,G[j]);return x.append("file",C),await ve.post(n,x),n+b}finally{h.value=!1}},Fe=async()=>{s("update:fileList",""),s("remove"),h.value=!1},Be=async C=>{try{const b=`${o.path}${o.fileName||new Date().getTime()+".png"}`,U={filename:b,bucketName:o.bucketName,postData:{filename:b,acl:"public-read",key:b,unknowValueField:[]}},{data:E}=await te(U);l.policy=E.policy,l.signature=E.signature,l.key=b,l.KSSAccessKeyId=E.kssAccessKeyId,l.name=b;const G=new FormData;for(const x in l)G.append(x,l[x]);G.append("file",C),await ve.post(n,G).then(()=>{const x=n+l.key,D=x.split("/");i.value=[{id:new Date().getTime().toString(),name:D[D.length-1],status:"finished",url:x}],s("update:fileList",x),s("finished",{coverImg:x,content:x}),c.value=!1})}catch(b){return!1}};return()=>e("div",{class:N.uploadFile},[e(H,{show:h.value,description:"上传中..."},{default:()=>[e(Ve,{ref:d,action:n,data:l,fileList:i.value,"onUpdate:fileList":C=>i.value=C,accept:o.accept,multiple:o.multiple,max:o.max,disabled:o.disabled,showFileList:o.showFileList,showPreviewButton:!0,onBeforeUpload:C=>r(C),onFinish:C=>S(C),onRemove:()=>Fe()},{default:()=>[o.showType==="default"&&e("div",{class:N.uploadBtn},[e("img",{src:ia,class:N.iconUploadAdd},null),e("p",null,[A("上传")])]),o.showType==="custom"&&g.custom&&g.custom()]})]}),e(J,{show:c.value,"onUpdate:show":C=>c.value=C,preset:"dialog",showIcon:!1,class:["modalTitle background"],title:"上传图片",style:{width:"800px"}},{default:()=>[e(qe,{ref:p,onClose:()=>c.value=!1,onCropperOk:Be},null)]})])}}),Re=o=>o.indexOf(".mp3")>-1?K.SONG:o.indexOf(".mp4")>-1?K.VIDEO:K.IMG,ua=L({name:"upload-modal",props:{list:{type:Array,default:()=>[]}},emits:["close","confirm"],setup(o,{emit:s}){const t=X(),g=v(),n=_(),u=v(),c=T({list:[],uploading:!1,uploadUrl:"",name:"",subjectIds:[]}),h=f=>{let y=me;switch(f){case"IMG":y=me;break;case"VIDEO":y=Te;break;case"SONG":y=Pe;break;case"MUSIC":y=Me;break}return y},a=async()=>{var f;(f=g.value)==null||f.validate(async y=>{if(y){Ee(Je);return}c.uploading=!0;try{const p=[];c.list.forEach(r=>{p.push({subjectIds:r.subjectIds.join(","),openFlag:r.openFlag,coverImg:r.coverImg,name:r.name,type:r.type,enableFlag:1,content:r.content,id:r.id||null})}),l.value?await Oe(p):await We(p),c.list=[],n.success("保存成功"),s("close",!0),s("confirm")}catch(p){}c.uploading=!1})},d=f=>{c.list.splice(f,1)},l=ze(()=>o.list.length>0);O(async()=>{const f=o.list||[],y=[];f.forEach(p=>{y.push({subjectIds:p.subjectId?p.subjectId.split(",").map(r=>Number(r)):[],openFlag:p.openFlag,coverImg:p.coverImg,name:p.title,type:p.type,enableFlag:p.enableFlag,content:p.content,id:p.id})}),c.list=y||[],await t.getSubjects()});const i=(f,y)=>{f.subjectIds=y.map(p=>p.id)};return()=>e("div",{class:N.uploadModal},[e(Xe,{style:{"max-height":"55vh"}},{default:()=>[e(q,{ref:g,labelPlacement:"left",labelWidth:120,model:c,class:N.formModal},{default:()=>[e(P,{class:N.formSpace},{default:()=>[c.list.map((f,y)=>e("div",{class:N.formItem,key:y},[e("div",{class:N.previewModal},[e(Y,{class:[N.titleType],src:h(f.type),previewDisabled:!0,objectFit:"cover"},null),!l.value&&e("img",{class:[N.iconUploadDelete],src:De,onClick:()=>d(y)},null),e(Y,{class:[N.cover,N.image],lazy:!0,previewDisabled:!0,src:f.coverImg,objectFit:"cover"},null),e("div",{class:N.commonType},[A("公开资源:"),e(Ye,{size:"small",value:f.openFlag,"onUpdate:value":p=>f.openFlag=p},null)])]),e(Q,{showFeedback:!1,path:`list.${y}.name`,rule:[{required:!0,message:"请输入资源名称",trigger:["input","blur"]}]},{default:()=>[e(Ae,{value:f.name,"onUpdate:value":p=>f.name=p,placeholder:"请输入资源名称",maxlength:25,clearable:!0},null)]}),e(Q,{path:`list[${y}].subjectIds`,showFeedback:!1,rule:[{required:!0,message:"请选择素材可用乐器",trigger:"change",type:"array"}]},{default:()=>[e(be,{value:f.subjectIds,"onUpdate:value":p=>f.subjectIds=p,placeholder:"请选择素材可用乐器(可多选)",options:t.getSubjectList,labelField:"name",valueField:"id",multiple:!0,maxTagCount:2,clearable:!0},{action:()=>e(B,null,[e(R,{text:!0,style:" --n-width: 100% ",onClick:()=>i(f,t.getSubjectList)},{default:()=>[A("全选")]})])})]})])),!l.value&&e("div",{class:N.formItem},[e(ca,{fileList:c.uploadUrl,"onUpdate:fileList":f=>c.uploadUrl=f,accept:".jpg,jpeg,.png,audio/mp3,video/mp4",showFileList:!1,ref:u,options:{autoCropWidth:320,autoCropHeight:180,fixedBox:!0},onFinished:f=>{c.list.push({subjectIds:c.subjectIds||[],openFlag:!0,coverImg:f.coverImg,name:c.name||"",type:Re(f.content),enableFlag:1,content:f.content}),c.uploadUrl="",c.name="",c.subjectIds=[],u.value.handleClearFile()}},null),e(Q,{showFeedback:!1},{default:()=>[e(Ae,{value:c.name,"onUpdate:value":f=>c.name=f,placeholder:"请输入资源名称",maxlength:25,clearable:!0},null)]}),e(Q,{showFeedback:!1},{default:()=>[e(be,{value:c.subjectIds,"onUpdate:value":f=>c.subjectIds=f,placeholder:"请选择素材可用乐器(可多选)",options:t.getSubjectList,labelField:"name",valueField:"id",multiple:!0,maxTagCount:2,clearable:!0},{action:()=>e(B,null,[e(R,{text:!0,style:" --n-width: 100% ",onClick:()=>i(c,t.getSubjectList)},{default:()=>[A("全选")]})])})]})])]})]})]}),e(P,{class:N.btnGroup,justify:"center"},{default:()=>[e(R,{round:!0,onClick:()=>s("close")},{default:()=>[A("取消")]}),e(R,{round:!0,type:"primary",loading:c.uploading,disabled:c.list.length===0,onClick:a},{default:()=>[A("确定")]})]})])}}),ra="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAA8dJREFUWEfNmU1sE1cQx///3Ue8CCOBnUJjpVUl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rU61yggH44slirFhUBAMvQgCSzNA3EsWD+6chyRosET4kod3Xx4DlGsR1ibhXWPHC/RY4LMnU/jkh4YG9Afw9qQWdsvj2k+D2nWEMd+Ty3vO4HZbLBe4Lyug4PpvTyb23CjjymB3zHcnUXhBlbOoV0ftbVPNBiXCWp3g6F//xIt+91oaSlEj4gzLq3wlg8LyU5azMSuh7yoEl84TEt9mojAM/R7CpN6gZnCLIl1tjuy8AoDiX5sEmO9bcZYIphSYGRmNYuWcKMxkB2d9oQ+Pd6ZRy2sspZQqiOuXlcj2tKcWumwj9Gx1YXJmMykxExr6BMJ77bCbhoHmZCTtW2VBuS9bdv1MSVr8/jV+82dHOF04lxVqb5L6FAg41F2NecdL5uChj/UcivvwjihqXAd+0OLCgLFl3k7Myur6fwa6T4XxY1KcJbxI9NNNZb8WzdVYUXx5X3OqwX0L93gA+WGdH3UKBTwDFWUxm+PZsVImerD4s8oNWaEYHUZuMwNctDvBopgL5fUxSyDgT+Mo9AXgD2ihFDa1C1HpH3SKnAcfXp6eSMZYAzB3x1Lf0iPjqjHZKUQOojDr+QXD7dS0LTUtN2PlQejPEHQR585wKo+3zZPPkz2W2RGJZUAC+6N/GZPaSHkPvcjqpNcNSlH6tGRiNgqc2k3702FYoMHXdKmRhLbEQTmxMJ2RueNnOSQyN6aeUtANkLqxKFAu4zd1ZYcRQWymCYRmhGND6aRBHftXPxpnRTb3dXfWl6fZyA+oWFuGvixJ+GMm932lKM0H90sSV5/S1M366QlKtKTIahPJe3LmNOf/0wUHO6cejeCbm9PNbarnM2QfMVJBz+gk4FajyiB6OtAJYrfeif10f0dUY4kb9DfEf/jo/ywKomDwAAAAASUVORK5CYII=",pa=L({name:"myResources-guide",emits:["close"],setup(o,{emit:s}){const t=T({box:{height:"0px"},show:!1,steps:[{ele:"",eleRect:{},img:Z("myResourecs1.png"),handStyle:{top:"0.91rem"},imgStyle:{top:k(-4),left:k(-240),width:k(556),height:k(257)},btnsStyle:{bottom:k(30),left:k(-80)},eleRectPadding:{left:14,top:14,width:28,height:28},boxStyle:{borderRadius:"30px"}}],step:0}),g=v(!1),n=v({});(async()=>{var l;try{const i=await fe({guideTag:"teacher-guideInfo"});i.data?n.value=JSON.parse((l=i.data)==null?void 0:l.guideValue)||null:n.value={},n.value&&n.value.myResourcesGuide?g.value=!1:g.value=!0}catch(i){console.log(i)}})();const c=()=>{var i,f,y,p;const l=document.getElementById(`myResources-${t.step}`);if(l){const r=l.getBoundingClientRect(),m=((i=t.steps[t.step].eleRectPadding)==null?void 0:i.left)||0,S=((f=t.steps[t.step].eleRectPadding)==null?void 0:f.top)||0,W=((y=t.steps[t.step].eleRectPadding)==null?void 0:y.width)||0,V=((p=t.steps[t.step].eleRectPadding)==null?void 0:p.height)||0;t.box={left:r.x-m+"px",top:r.y-S+"px",width:r.width+W+"px",height:r.height+V+"px"},console.log(`coai-${t.step}`,t.box)}else a()};O(()=>{c(),window.addEventListener("resize",h)});const h=()=>{c()};ue(()=>{window.removeEventListener("resize",h)});const a=()=>{if(t.step>=4){d();return}t.step=t.step+1,c()},d=async()=>{n.value?n.value={myResourcesGuide:!0}:n.value.myResourcesGuide=!0;try{const l=await he({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(n.value)})}catch(l){console.log(l)}g.value=!1};return()=>e(B,null,[g.value?re(e("div",{"onUpdate:show":l=>g.value=l,class:["n-modal-mask","n-modal-mask-guide"]},[e("div",{class:I.content,onClick:()=>a()},[e("div",{class:I.backBtn,onClick:l=>{l.stopPropagation(),d()}},[A("跳过")]),e("div",{class:I.box,style:{...t.box,...t.steps[t.step].boxStyle},id:`modeType-${t.step}`},[t.steps.map((l,i)=>{var f,y,p,r;return e("div",{onClick:m=>m.stopPropagation(),class:I.item,style:l.type=="bottom"?{display:i===t.step?"":"none",left:`${(f=l.eleRect)==null?void 0:f.left}px`,top:`-${(y=l.imgStyle)==null?void 0:y.height}`}:{display:i===t.step?"":"none",left:`${(p=l.eleRect)==null?void 0:p.left}px`,top:`${(r=t.box)==null?void 0:r.height}`}},[e("img",{class:I.img,style:l.imgStyle,src:l.img},null),e("div",{class:I.btns,style:l.btnsStyle},[t.step+1==t.steps.length?e(B,null,[e("div",{class:[I.endBtn],onClick:()=>d()},[A("完成")])]):e("div",{class:I.btn,onClick:()=>a()},[A("下一步 ("),t.step+1,A("/"),t.steps.length,A(")")])])])})])])]),[[de,g.value,"show"]]):null])}}),ga=L({name:"share-resources",setup(){const o=_();xe();const s=T({searchWord:"",loading:!1,pageTotal:0,pagination:{page:1,rows:20},searchGroup:{type:"",name:"",bookVersionId:null,subjectId:null,sourceType:3},tableList:[],uploadStatus:!1,show:!1,item:{},editStatus:!1,editList:[],editIds:[],removeVisiable:!1,removeContent:"是否删除该资源?",type:"remove",removeItem:{}}),t=v(!1),g=async()=>{try{s.loading=!0;const{data:a}=await le({...s.searchGroup,...s.pagination});s.loading=!1,s.pageTotal=Number(a.total);const d=a.rows||[],l=[];d.forEach(i=>{l.push({id:i.id,coverImg:i.coverImg,type:i.type,title:i.name,isCollect:!!i.favoriteFlag,isSelected:i.sourceFrom==="PLATFORM",content:i.content,subjectId:i.subjectIds,enableFlag:i.enableFlag?1:0,openFlag:i.openFlag})}),s.tableList=l||[],setTimeout(()=>{t.value=!0},500)}catch(a){s.loading=!1}},n=async a=>{try{await oe({materialId:a.id,favoriteFlag:a.isCollect?0:1,type:a.type}),a.isCollect=!a.isCollect}catch(d){}},u=async a=>{s.pagination.page=1,s.searchGroup=Object.assign(s.searchGroup,a),g()},c=async()=>{try{await Qe(s.editIds),o.success("删除成功"),u(s.searchGroup),s.editIds=[]}catch(a){}},h=async()=>{try{await Ue({id:s.removeItem.id}),o.success("删除成功"),u(s.searchGroup)}catch(a){}};return O(()=>{g()}),()=>e(B,null,[e(Jt,{onSearch:a=>u(a),onUpload:()=>{s.editList=[],s.uploadStatus=!0},onUpdate:()=>{const a=[];if(s.tableList.forEach(d=>{s.editIds.indexOf(d.id)>-1&&a.push(d)}),s.editList=a||[],s.editList.length<=0){o.error("至少选择一条资源进行编辑");return}s.uploadStatus=!0},onEdit:a=>{s.editStatus=a,s.editStatus||(s.editIds=[])},onSelectAll:a=>{if(a){const d=[];s.tableList.forEach(l=>{d.push(l.id)}),s.editIds=d}else s.editIds=[]},onDelete:()=>{if(s.editIds.length<=0){o.error("至少选择一条资源进行删除");return}s.type="delete",s.removeContent="是否删除该资源?",s.removeVisiable=!0}},null),e(H,{show:s.loading,"onUpdate:show":a=>s.loading=a,style:{"min-height":"50vh"}},{default:()=>[e("div",{class:w.list},[s.tableList.map(a=>e("div",{class:w.itemSection},[e(z,{item:a,disabledMouseHover:!1,offShelf:!a.enableFlag,onOffShelf:()=>{s.type="remove",s.removeContent="该资源已下架,是否删除?",s.removeVisiable=!0,s.removeItem=a},onClick:d=>{d.type==="IMG"||!a.enableFlag||(s.show=!0,s.item=d)},onCollect:d=>n(d)},null),s.editStatus&&e("div",{class:[w.itemBg,s.editIds.includes(a.id)?w.itemBgChecked:""],onClick:()=>{const d=s.editIds.indexOf(a.id);d>-1?s.editIds.splice(d,1):s.editIds.push(a.id)}},[e("img",{src:s.editIds.includes(a.id)?da:ra,class:w.resourceDefault},null)])])),!s.loading&&s.tableList.length<=0&&e(pe,{style:{minHeight:"50vh"},description:"暂无资源"},null)])]}),e(se,{page:s.pagination.page,"onUpdate:page":a=>s.pagination.page=a,pageSize:s.pagination.rows,"onUpdate:pageSize":a=>s.pagination.rows=a,pageTotal:s.pageTotal,"onUpdate:pageTotal":a=>s.pageTotal=a,onList:g},null),e(ge,{show:s.show,"onUpdate:show":a=>s.show=a,item:s.item},null),e(J,{show:s.uploadStatus,"onUpdate:show":a=>s.uploadStatus=a,preset:"card",showIcon:!1,class:["modalTitle background",w.attendClassModal],title:s.editStatus?"修改资源":"上传资源",blockScroll:!1},{default:()=>[e(ua,{onClose:()=>s.uploadStatus=!1,onConfirm:()=>{s.editIds=[],s.editList=[],u(s.searchGroup)},list:s.editList},null)]}),t.value?e(pa,null,null):null,e(J,{show:s.removeVisiable,"onUpdate:show":a=>s.removeVisiable=a,preset:"card",class:["modalTitle",w.removeVisiable],title:"提示"},{default:()=>[e("div",{class:w.studentRemove},[e("p",null,[s.removeContent]),e(P,{class:w.btnGroupModal,justify:"center"},{default:()=>[e(R,{round:!0,type:"primary",onClick:()=>{s.type==="remove"?h():c(),s.removeVisiable=!1}},{default:()=>[A("确定")]}),e(R,{round:!0,onClick:()=>s.removeVisiable=!1},{default:()=>[A("取消")]})]})])]})])}}),fa="_list_2oig9_1",ha="_searchGroup_2oig9_9",ma="_btnType_2oig9_13",ya="_inputSearch_2oig9_48",Aa="_searchCatatory_2oig9_72",ba="_addTrain_2oig9_79",va="_spaceSection_2oig9_91",Sa="_collapseWrap_2oig9_97",Ca="_collaoseBtn_2oig9_103",wa="_isStart_2oig9_108",Ia="_collapsSection_2oig9_111",Ua="_isHidden_2oig9_114",M={list:fa,searchGroup:ha,btnType:ma,inputSearch:ya,searchCatatory:Aa,addTrain:ba,spaceSection:va,collapseWrap:Sa,collaoseBtn:Ca,isStart:wa,collapsSection:Ia,isHidden:Ua};function we(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!ce(o)}const ka=L({name:"search-group",emits:["search"],setup(o,{emit:s}){const t=X(),g=v([]),n=T({type:"",name:"",bookVersionId:null,subjectId:null}),u=()=>{s("search",n)},c=v(),h=v([]),a=v(0),d=v(0),l=v(0),i=v(!1),f=r=>{r!=null&&r.selfElRef&&h.value.push(r.selfElRef.parentNode)},y=r=>{i.value=r,p()},p=()=>{h.value=[...new Set(h.value)];let r=-1;h.value.forEach((m,S)=>{S===0?(l.value=1,r=m.offsetLeft):m.offsetLeft===r&&S!=0&&l.value++,i.value?m.style.display="block":l.value>1?m.style.display="none":m.style.display="block"})};return O(async()=>{g.value=[{label:"全部",value:""},...ie],await t.getMusicSheetCategory(),await t.getSubjects()}),()=>{let r,m;return e("div",{class:M.searchGroup},[e("div",{class:M.searchCatatory},[e(P,{size:"small",class:M.btnType},we(r=g.value.map(S=>e(R,{type:n.type===S.value?"primary":"default",secondary:n.type!==S.value,round:!0,size:"small",focusable:!1,onClick:()=>{n.type=S.value,u(),Ee(()=>{n.type==="MUSIC"&&(a.value=c.value.offsetHeight,d.value=c.value.offsetHeight/l.value,p())})}},{default:()=>[S.label]})))?r:{default:()=>[r]})]),e(q,{labelAlign:"left",labelPlacement:"left"},{default:()=>[n.type==="MUSIC"&&e("div",{class:[M.collapsSection]},[e(Q,{label:"教材:"},{default:()=>[e("div",{class:[M.collapseWrap,i.value?"":M.isHidden],ref:c},[e(P,{class:[M.spaceSection]},{default:()=>[t.getAllMusicCategories.map(S=>e(R,{ref:f,secondary:n.bookVersionId===S.id,quaternary:n.bookVersionId!==S.id,strong:!0,focusable:!1,type:n.bookVersionId===S.id?"primary":"default",onClick:()=>{n.bookVersionId=S.id,u()}},{default:()=>[S.name]})),l.value>1&&e("div",{style:{height:"var(--n-blank-height)",position:"absolute",display:"flex",alignItems:"center"},onClick:()=>{y(!i.value)}},[e(Y,{previewDisabled:!0,src:Ie,class:[M.collaoseBtn,i.value?M.isStart:""]},null)])]})])]})]),e(Q,{label:"乐器:"},{default:()=>[e(P,{class:M.spaceSection},we(m=t.getSubjectAllList.map(S=>e(R,{secondary:n.subjectId===S.id,quaternary:n.subjectId!==S.id,strong:!0,focusable:!1,type:n.subjectId===S.id?"primary":"default",onClick:()=>{n.subjectId=S.id,u()}},{default:()=>[S.name]})))?m:{default:()=>[m]})]}),e(ne,{class:M.inputSearch,round:!0,onSearch:S=>{n.name=S,u()}},null)]})])}}}),Ea=L({name:"myColloge-guide",emits:["close"],setup(o,{emit:s}){const t=T({box:{height:"0px"},show:!1,steps:[{ele:"",img:Z("myColloge1.png"),imgStyle:{top:k(-4),left:k(630),width:k(458),height:k(291)},btnsStyle:{bottom:k(96),left:k(790)},eleRectPadding:{left:7,top:7,width:14,height:14},type:"bottom"}],step:0}),g=v(!1),n=v({});(async()=>{var l;try{const i=await fe({guideTag:"teacher-guideInfo"});i.data?n.value=JSON.parse((l=i.data)==null?void 0:l.guideValue)||null:n.value={},n.value&&n.value.myColloge?g.value=!1:g.value=!0}catch(i){console.log(i)}})();const c=()=>{var i,f,y,p;const l=document.getElementById(`myColloge-${t.step}`);if(l){const r=l.getBoundingClientRect(),m=((i=t.steps[t.step].eleRectPadding)==null?void 0:i.left)||0,S=((f=t.steps[t.step].eleRectPadding)==null?void 0:f.top)||0,W=((y=t.steps[t.step].eleRectPadding)==null?void 0:y.width)||0,V=((p=t.steps[t.step].eleRectPadding)==null?void 0:p.height)||0;t.box={left:r.x-m+"px",top:r.y-S+"px",width:r.width+W+"px",height:r.height+V+"px"},console.log(`coai-${t.step}`,t.box)}else a()};O(()=>{c(),window.addEventListener("resize",h)});const h=()=>{c()};ue(()=>{window.removeEventListener("resize",h)});const a=()=>{if(t.step>=4){d();return}t.step=t.step+1,c()},d=async()=>{n.value?n.value.myColloge=!0:n.value={myColloge:!0};try{const l=await he({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(n.value)})}catch(l){console.log(l)}g.value=!1};return()=>e(B,null,[g.value?re(e("div",{"onUpdate:show":l=>g.value=l,class:["n-modal-mask","n-modal-mask-guide"]},[e("div",{class:I.content,onClick:()=>a()},[e("div",{class:I.backBtn,onClick:l=>{l.stopPropagation(),d()}},[A("跳过")]),e("div",{class:I.box,style:{...t.box},id:`modeType-${t.step}`},[t.steps.map((l,i)=>{var f,y,p,r;return e("div",{onClick:m=>m.stopPropagation(),class:I.item,style:l.type=="bottom"?{display:i===t.step?"":"none",left:`${(f=l.eleRect)==null?void 0:f.left}px`,top:`-${(y=l.imgStyle)==null?void 0:y.height}`}:{display:i===t.step?"":"none",left:`${(p=l.eleRect)==null?void 0:p.left}px`,top:`${(r=t.box)==null?void 0:r.height}`}},[e("img",{class:I.img,style:l.imgStyle,src:l.img},null),e("div",{class:I.btns,style:l.btnsStyle},[t.step+1==t.steps.length?e(B,null,[e("div",{class:[I.endBtn],onClick:()=>d()},[A("完成")])]):e("div",{class:I.btn,onClick:()=>a()},[A("下一步 ("),t.step+1,A("/"),t.steps.length,A(")")])])])})])])]),[[de,g.value,"show"]]):null])}}),xa=L({name:"share-resources",setup(){const o=_(),s=xe(),t=T({searchWord:"",loading:!1,pageTotal:0,pagination:{page:1,rows:20},searchGroup:{type:"",name:"",bookVersionId:null,subjectId:null,sourceType:4},tableList:[],show:!1,item:{}}),g=async()=>{try{t.loading=!0;const{data:a}=await le({...t.searchGroup,...t.pagination});t.loading=!1,t.pageTotal=Number(a.total);const d=a.rows||[],l=[];d.forEach(i=>{l.push({id:i.id,coverImg:i.coverImg,type:i.type,title:i.name,isCollect:!!i.favoriteFlag,isSelected:i.sourceFrom==="PLATFORM",content:i.content,subjectId:i.subjectIds,enableFlag:i.enableFlag?1:0,openFlag:i.openFlag})}),t.tableList=l||[],setTimeout(()=>{n.value=!0},500)}catch(a){t.loading=!1}},n=v(!1),u=async a=>{t.pagination.page=1,t.searchGroup=Object.assign(t.searchGroup,a),g()},c=async a=>{try{await oe({materialId:a.id,favoriteFlag:a.isCollect?0:1,type:a.type}),a.isCollect=!a.isCollect,u(t.searchGroup)}catch(d){}},h=async a=>{try{s.warning({title:"提示",content:"该资源已下架,是否删除?",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{await Ue({id:a.id}),o.success("删除成功"),u(t.searchGroup)}})}catch(d){}};return O(()=>{g()}),()=>e(B,null,[e(ka,{onSearch:a=>u(a)},null),e(H,{show:t.loading,"onUpdate:show":a=>t.loading=a,style:{"min-height":"50vh"}},{default:()=>[e("div",{class:M.list,id:"myColloge-0"},[t.tableList.map(a=>e(z,{item:a,offShelf:!a.enableFlag,onOffShelf:()=>h(a),disabledMouseHover:!1,onClick:d=>{d.type==="IMG"||!a.enableFlag||(t.show=!0,t.item=d)},onCollect:d=>c(d)},null)),!t.loading&&t.tableList.length<=0&&e(pe,{style:{minHeight:"50vh"},description:"暂无收藏资源"},null)])]}),e(se,{page:t.pagination.page,"onUpdate:page":a=>t.pagination.page=a,pageSize:t.pagination.rows,"onUpdate:pageSize":a=>t.pagination.rows=a,pageTotal:t.pageTotal,"onUpdate:pageTotal":a=>t.pageTotal=a,onList:g},null),e(ge,{show:t.show,"onUpdate:show":a=>t.show=a,item:t.item},null),n.value?e(Ea,null,null):null])}}),Wa=L({name:"student-studentList",setup(){return()=>e("div",{class:ae.listWrap},[e(Ze,{defaultValue:"myResources",paneClass:ae.paneTitle,justifyContent:"center",paneWrapperClass:ae.paneWrapperContainer},{default:()=>[e(ee,{name:"myResources",tab:"我的资源"},{default:()=>[e(ga,null,null)]}),e(ee,{name:"shareResources",tab:"共享资源"},{default:()=>[e(At,null,null)],tab:()=>e("span",{id:"shareResources-0"},[A("共享资源")])}),e(ee,{name:"myCollect",tab:"我的收藏"},{default:()=>[e(xa,null,null)]})]})])}});export{Wa as default};
|