index-ba04c67f-1714304141006.js 18 KB

1
  1. import{ad as V,ae as $,d as x,a9 as W,am as z,S as G,da as D,an as J,ab as k,db as Q,aW as X,b as Y,e as A,r as y,p as B,f as a,N as O,g as C,w as L,j as _,k as b,d5 as T,F as P,i as U,v as Z,aA as ee,B as te,y as se,C as ae,b6 as re,q as ne,t as R}from"./index-3c72d77b-1714304141006.js";import{i as ie,C as le,m as ue,f as oe}from"./api-54491047-1714304141006.js";import{T as ce}from"./index-9bf08c33-1714304141006.js";import{u as de}from"./catchData-a4bb2b1e-1714304141006.js";import{a as K,u as pe}from"./index-6273bbc3-1714304141006.js";import{T as me}from"./index-9c933a15-1714304141006.js";import{u as q}from"./index-c17d6824-1714304141006.js";import{C as he}from"./index-2e99646a-1714304141006.js";import{N as fe}from"./Scrollbar-e9353195-1714304141006.js";const ge=V("input-group-label","\n position: relative;\n user-select: none;\n -webkit-user-select: none;\n box-sizing: border-box;\n padding: 0 12px;\n display: inline-block;\n border-radius: var(--n-border-radius);\n background-color: var(--n-group-label-color);\n color: var(--n-group-label-text-color);\n font-size: var(--n-font-size);\n line-height: var(--n-height);\n height: var(--n-height);\n flex-shrink: 0;\n white-space: nowrap;\n transition: \n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n",[$("border","\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n border-radius: inherit;\n border: var(--n-group-label-border);\n transition: border-color .3s var(--n-bezier);\n ")]),ve=Object.assign(Object.assign({},z.props),{size:{type:String,default:"medium"},bordered:{type:Boolean,default:void 0}}),H=x({name:"InputGroupLabel",props:ve,setup(t){const{mergedBorderedRef:n,mergedClsPrefixRef:e,inlineThemeDisabled:s}=W(t),u=z("Input","-input-group-label",ge,Q,t,e),r=G(()=>{const{size:v}=t,{common:{cubicBezierEaseInOut:p},self:{groupLabelColor:i,borderRadius:f,groupLabelTextColor:m,lineHeight:d,groupLabelBorder:S,[D("fontSize",v)]:I,[D("height",v)]:w}}=u.value;return{"--n-bezier":p,"--n-group-label-color":i,"--n-group-label-border":S,"--n-border-radius":f,"--n-group-label-text-color":m,"--n-font-size":I,"--n-line-height":d,"--n-height":w}}),h=s?J("input-group-label",G(()=>t.size[0]),r,t):void 0;return{mergedClsPrefix:e,mergedBordered:n,cssVars:s?void 0:r,themeClass:h==null?void 0:h.themeClass,onRender:h==null?void 0:h.onRender}},render(){var t,n,e;const{mergedClsPrefix:s}=this;return(t=this.onRender)===null||t===void 0||t.call(this),k("div",{class:["".concat(s,"-input-group-label"),this.themeClass],style:this.cssVars},(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n),this.mergedBordered?k("div",{class:"".concat(s,"-input-group-label__border")}):null)}}),be=X("prepare-lessons-store",{state:()=>({subjectId:null,instrumentId:null,baseCourseware:{},selectKey:"",lessonCoursewareId:"",subjectList:[],instrumentList:[],lessonCoursewareDetailId:"",treeList:[],coursewareList:[],trainList:[],tabType:"courseware",selectMusicStatus:!1,selectResourceStatus:!1,isAddResource:!1,isEditResource:!1,iseditTrain:!1,isAddTrain:!1,classGroupId:null}),getters:{getSubjectId(){return this.subjectId},getInstrumentId(){return this.instrumentId},getBaseCourseware(){return this.baseCourseware},getSelectKey(){return this.selectKey},getSelectName(){var n;let t="";for(let e=0;e<this.getTreeList.length;e++){const s=this.getTreeList[e];s.id===this.selectKey&&(t=s.name),!t&&s.knowledgeList.length>0&&((n=s.knowledgeList)==null||n.forEach(u=>{u.id===this.selectKey&&(t=u.name)}))}return t},getLessonCoursewareId(){return this.lessonCoursewareId},getLessonCoursewareDetailId(){return this.lessonCoursewareDetailId},getTreeList(){return this.treeList},getCoursewareList(){return this.coursewareList},getTrainList(){return this.trainList},getTabType(){return this.tabType},getSelectMusicStatus(){return this.selectMusicStatus},getSelectResourceStatus(){return this.selectResourceStatus},getIsAddResource(){return this.isAddResource},getIsEditResource(){return this.isEditResource},getIsEditTrain(){return this.iseditTrain},getIsAddTrain(){return this.isAddTrain},getSubjectList(){return this.subjectList},getInstrumentList(){return this.instrumentList},getFormatInstrumentList(){const t=[];return this.instrumentList.forEach(n=>{n.value=n.id,n.label=n.name,n.instruments&&n.instruments.length>0&&n.instruments.forEach(s=>{s.label=s.name,s.value=s.id});const e={value:n.id,label:n.name,id:n.id,name:n.name,instruments:[]};n.instruments&&(n.instruments.length==1?(e.value=n.instruments[0].id,e.label=n.instruments[0].name,e.id=n.id,e.name=n.name):n.instruments.length>1&&n.instruments.forEach(s=>{s.label=s.name,s.value=s.id,e.instruments.push({label:s.name,value:s.id,id:s.id,name:s.name})})),t.push(e)}),t},getSingleInstrumentList(){const t=[];return this.instrumentList.forEach(n=>{Array.isArray(n.instruments)&&n.instruments.forEach(e=>{t.push(e)})}),t},getClassGroupId(){return this.classGroupId}},actions:{setSubjectId(t){this.subjectId=t},setInstrumentId(t){this.instrumentId=t},setBaseCourseware(t){this.baseCourseware=t},setSelectKey(t){this.selectKey=t},setLessonCoursewareId(t){this.lessonCoursewareId=t},setLessonCoursewareDetailId(t){this.lessonCoursewareDetailId=t},setTreeList(t){this.treeList=t},setCoursewareList(t){this.coursewareList=t},setTrainList(t){this.trainList=t},setTabType(t){this.tabType=t},setSelectMusicStatus(t){this.selectMusicStatus=t},setSelectResourceStatus(t){this.selectResourceStatus=t},setIsAddResource(t){this.isAddResource=t},setIsAddTrain(t){this.isAddTrain=t},setIsEditResource(t){this.isEditResource=t},setIsEditTrain(t){this.iseditTrain=t},setSubjectList(t){this.subjectList=t},setInstrumentList(t){this.instrumentList=t},setClassGroupId(t){this.classGroupId=t}}}),Se="_trainUpdate_my1j3_1",ye="_updateBtnGroup_my1j3_4",Ce="_active_my1j3_16",Ie="_scoreGroup_my1j3_30",g={trainUpdate:Se,updateBtnGroup:ye,switch:"_switch_my1j3_12",active:Ce,scoreGroup:Ie},nt=x({name:"train-update",props:{item:{type:Object,default:()=>({})},type:{type:String,default:"train"}},emits:["close","confirm"],setup(t,{emit:n}){Y();const e=A({id:null,uploading:!1,baseMaxScore:99,type:"PRACTICE",musicId:"",musicName:"",coursewareKnowledgeDetailId:"",minScore:null,maxScore:null,subjectId:"",coverImg:"",practiceSpeed:null,practiceTimes:null,difficulty:"BEGINNER",evaluationSpeed:null,evaluationScore:null}),s=y(),u=async()=>{var r;(r=s.value)==null||r.validate(async h=>{if(!h){e.uploading=!0;try{const v={trainingType:e.type,musicId:e.musicId,musicName:e.musicName,coursewareKnowledgeDetailId:e.coursewareKnowledgeDetailId,subjectId:e.subjectId,id:e.id,coverImg:e.coverImg,trainingConfigJson:""},p={};p.practiceChapterBegin=e.minScore,p.practiceChapterEnd=e.maxScore,e.type==="PRACTICE"?(p.practiceSpeed=e.practiceSpeed,p.trainingTimes=e.practiceTimes):(p.evaluateDifficult=e.difficulty,p.evaluateSpeed=e.evaluationSpeed,p.trainingTimes=e.evaluationScore),p.practiceChapterMax=e.baseMaxScore,v.trainingConfigJson=p,n("close"),n("confirm",v)}catch(v){}e.uploading=!1}})};return B(()=>{const r=t.item;r.trainId?(e.id=r.trainId,e.practiceSpeed=r.practiceSpeed,e.type=r.trainingType,e.minScore=r.practiceChapterBegin,e.maxScore=r.practiceChapterEnd,r.trainingType==="PRACTICE"?e.practiceTimes=r.trainingTimes:e.evaluationScore=r.trainingTimes,e.difficulty=r.evaluateDifficult||"BEGINNER",e.evaluationSpeed=r.evaluateSpeed):(e.minScore=1,e.maxScore=r.practiceChapterMax?r.practiceChapterMax:1),e.baseMaxScore=r.practiceChapterMax||99,e.musicId=r.id,e.musicName=r.musicName,e.coursewareKnowledgeDetailId=r.coursewareKnowledgeDetailId,e.subjectId=r.subjectId,e.coverImg=r.coverImg}),()=>a("div",{class:g.trainUpdate},[a(O,{ref:s,model:e,labelAlign:"right",labelPlacement:"left"},{default:()=>[a(C,{label:"训练方式",path:"type",rule:[{required:!0,message:"请选择训练方式"}]},{default:()=>[a(L,null,{default:()=>[a(_,{secondary:!0,class:[g.switch,e.type==="PRACTICE"?g.active:""],onClick:()=>e.type="PRACTICE"},{default:()=>[b("练习")]}),a(_,{secondary:!0,class:[g.switch,e.type==="EVALUATION"?g.active:""],onClick:()=>e.type="EVALUATION"},{default:()=>[b("评测")]})]})]}),a("div",{class:g.scoreGroup},[a(C,{label:e.type==="PRACTICE"?"练习小节":"评测小节",path:"minScore",rule:[{required:!0,message:"请输入最小练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[a(T,{value:e.minScore,"onUpdate:value":[r=>e.minScore=r,()=>{e.maxScore=null}],showButton:!1,min:1,max:e.baseMaxScore,placeholder:"最小练习小节",clearable:!0},null)]}),a("div",{style:{"--n-feedback-height":"24px",display:"flex",alignItems:"center",margin:"-2px 2% 0 2%",marginBottom:"var(--n-feedback-height)"}},[b("-")]),a(C,{path:"maxScore",rule:[{required:!0,message:"请输入最大练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[a(T,{value:e.maxScore,"onUpdate:value":r=>e.maxScore=r,showButton:!1,min:e.minScore||1,max:e.baseMaxScore,placeholder:"最大练习小节",clearable:!0},null)]})]),e.type==="PRACTICE"&&a(P,null,[a(C,{label:"练习速度",path:"practiceSpeed",rule:[{required:!0,message:"请输入练习速度",trigger:["blur","change"],type:"number"}]},{default:()=>[a(T,{min:60,max:270,showButton:!1,style:{width:"100%"},value:e.practiceSpeed,"onUpdate:value":r=>e.practiceSpeed=r,placeholder:"练习速度范围60~270",clearable:!0},null)]}),a(C,{label:"练习时长",path:"practiceTimes",rule:[{required:!0,message:"请输入练习时长",trigger:["blur","change"],type:"number"}]},{default:()=>[a(U,null,{default:()=>[a(T,{min:0,showButton:!1,style:{width:"100%"},value:e.practiceTimes,"onUpdate:value":r=>e.practiceTimes=r,placeholder:"请输入练习时长",clearable:!0},null),a(H,null,{default:()=>[b("分钟")]})]})]})]),e.type==="EVALUATION"&&a(P,null,[a(C,{label:"评测难度",path:"type",rule:[{required:!0,message:"请选择评测难度"}]},{default:()=>[a(L,null,{default:()=>[a(_,{secondary:!0,class:[g.switch,e.difficulty==="BEGINNER"?g.active:""],onClick:()=>e.difficulty="BEGINNER"},{default:()=>[b("入门级")]}),a(_,{secondary:!0,class:[g.switch,e.difficulty==="ADVANCED"?g.active:""],onClick:()=>e.difficulty="ADVANCED"},{default:()=>[b("进阶级")]}),a(_,{secondary:!0,class:[g.switch,e.difficulty==="PERFORMER"?g.active:""],onClick:()=>e.difficulty="PERFORMER"},{default:()=>[b("大师级")]})]})]}),a(C,{label:"合格分数",path:"evaluationScore",rule:[{required:!0,message:"请输入合格分数",trigger:["blur","change"],type:"number"}]},{default:()=>[a(U,null,{default:()=>[a(T,{min:0,showButton:!1,style:{width:"100%"},value:e.evaluationScore,"onUpdate:value":r=>e.evaluationScore=r,placeholder:"请输入合格分数",clearable:!0},null),a(H,null,{default:()=>[b("分")]})]})]})]),a(L,{class:g.updateBtnGroup},{default:()=>[a(_,{strong:!0,type:"default",round:!0,onClick:()=>n("close")},{default:()=>[b("取消")]}),a(_,{strong:!0,type:"primary",round:!0,onClick:()=>u()},{default:()=>[b("确认")]})]})]})])}}),_e="_selectMusic_fj7p5_1",Ee="_close_fj7p5_37",we="_listContainer_fj7p5_44",j={selectMusic:_e,close:Ee,listContainer:we},Te="_selectMusic_1juv9_1",Le="_close_1juv9_1",xe="_listContainer_1juv9_8",Ae="_emptySection_1juv9_11",Be="_list_1juv9_8",Re="_searchGroup_1juv9_24",je="_inputSearch_1juv9_47",Fe="_searchBtn_1juv9_62",Ne="_popSelect_1juv9_68",Me="_spaceSection2_1juv9_78",Ge="_textBtn_1juv9_87",De="_iconArrow_1juv9_99",ke="_textBtnActive_1juv9_108",Pe="_spaceSection_1juv9_78",Ue="_collapseWrap_1juv9_124",He="_collaoseBtn_1juv9_130",ze="_isStart_1juv9_135",Oe="_collapsSection_1juv9_138",Ke="_collapsSectionEmpty_1juv9_141",qe="_isHidden_1juv9_146",Ve="_hideButton_1juv9_150",o={selectMusic:Te,close:Le,listContainer:xe,emptySection:Ae,list:Be,searchGroup:Re,inputSearch:je,searchBtn:Fe,popSelect:Ne,spaceSection2:Me,textBtn:Ge,iconArrow:De,textBtnActive:ke,spaceSection:Pe,collapseWrap:Ue,collaoseBtn:He,isStart:ze,collapsSection:Oe,collapsSectionEmpty:Ke,isHidden:qe,hideButton:Ve};function $e(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!te(t)}const We=x({name:"search-group",props:{type:{type:String,default:""}},emits:["search","add"],setup(t,{emit:n}){const e=de(),s=A({name:"",musicSheetCategoriesId:null,musicalInstrumentId:null}),u=A({tempSubjectId:null}),r=()=>{n("search",s)},h=K(()=>{r()},500),v=y(),p=y([]),i=y(0),f=y(0),m=y(0),d=y(!1),S=y(!1),I=c=>{c!=null&&c.selfElRef&&p.value.push(c.selfElRef.parentNode)},w=c=>{d.value=c,N()},N=()=>{try{p.value=[...new Set(p.value)];let c=-1;p.value.forEach((l,E)=>{E===0?(m.value=1,c=l.offsetLeft):l.offsetLeft===c&&E!=0&&m.value++,d.value?l.style.display="block":m.value>1?l.style.display="none":l.style.display="block"}),S.value=!0}catch(c){}},M=c=>{const l={};return c==null||c.forEach(E=>{E.id===s.musicalInstrumentId&&(l.selected=!0,l.name=E.name)}),l};return B(async()=>{var c,l;await e.getMusicSheetCategory(),await e.getSubjects(),i.value=(c=v.value)==null?void 0:c.offsetHeight,f.value=((l=v.value)==null?void 0:l.offsetHeight)/m.value,N()}),()=>{let c;return a("div",{class:o.searchGroup},[a(O,{labelAlign:"left",labelPlacement:"left"},{default:()=>[a("div",{class:[o.collapsSection,t.type==="myResources"&&o.collapsSectionEmpty]},[a(C,{label:"教材:"},{default:()=>[a("div",{class:[o.collapseWrap,S.value?"":o.hideButton,d.value?"":o.isHidden],ref:v},[a(L,{class:[o.spaceSection]},{default:()=>[e.getAllMusicCategories.map(l=>a(_,{ref:I,secondary:s.musicSheetCategoriesId===l.id,quaternary:s.musicSheetCategoriesId!==l.id,strong:!0,focusable:!1,type:s.musicSheetCategoriesId===l.id?"primary":"default",onClick:()=>{s.musicSheetCategoriesId=l.id,h()}},{default:()=>[l.name]})),m.value>1&&a("div",{style:{height:"var(--n-blank-height)",position:"absolute",display:"flex",alignItems:"center"},onClick:()=>{w(!d.value)}},[a(Z,{previewDisabled:!0,src:ie,class:[o.collaoseBtn,d.value?o.isStart:""]},null)])]})])]})]),a(C,{label:"乐器:"},{default:()=>[a(L,{class:o.spaceSection2},$e(c=e.getSubjectInstruments.map(l=>l.instruments&&l.instruments.length>1?a(ee,{options:l.instruments,trigger:"hover",scrollable:!0,value:u.tempSubjectId,"onUpdate:value":[E=>u.tempSubjectId=E,()=>{s.musicalInstrumentId=u.tempSubjectId,r()}],key:l.value,class:[o.popSelect]},{default:()=>[a("span",{class:[o.textBtn,M(l.instruments).selected&&o.textBtnActive]},[M(l.instruments).name||l.name,a("i",{class:o.iconArrow},null)])]}):a("span",{class:[o.textBtn,s.musicalInstrumentId===l.value&&o.textBtnActive],onClick:()=>{s.musicalInstrumentId=l.value,u.tempSubjectId=null,r()}},[l.name])))?c:{default:()=>[c]})]}),a(ce,{class:[o.inputSearch],round:!0,onSearch:l=>{s.name=l,h()}},null)]})])}}}),Je=t=>{if(t==="shareResources")return 2;if(t==="myResources")return 3;if(t==="myCollect")return 4},F=x({name:"select-music",props:{type:{type:String,default:""},from:{type:String,default:""}},emits:["add"],setup(t,{emit:n}){const e=be(),s=A({searchHeight:"0px",loading:!1,finshed:!1,pagination:{page:1,rows:20},searchGroup:{name:"",type:"MUSIC",musicSheetCategoriesId:"",musicalInstrumentId:"",sourceType:Je(t.type),status:1,versionFlag:!1,subjectId:null},tableList:[],show:!1,item:{},isShowAddDisabled:!e.getIsEditTrain}),u="musicSearchGroup"+ +new Date,r=async()=>{try{s.pagination.page===1&&(s.loading=!0);const{data:i}=await ue({...s.searchGroup,...s.pagination});s.loading=!1;const f=i.rows||[],m=[];f.forEach(d=>{const S=e.getTrainList.findIndex(I=>I.musicId===d.id);m.push({id:d.id,coverImg:d.coverImg||d.musicSvg,type:"MUSIC",title:d.name,isCollect:!!d.favoriteFlag,isSelected:d.sourceFrom==="PLATFORM",refFlag:d.refFlag,content:d.id,xmlFileUrl:d.xmlFileUrl,exist:S!==-1})}),s.tableList.push(...m),s.finshed=i.pages<=i.current}catch(i){s.loading=!1}};se(()=>e.trainList,()=>{s.tableList.forEach(i=>{const f=e.getTrainList.findIndex(m=>m.musicId===i.id);i.exist=f!==-1})},{deep:!0,immediate:!0});const h=pe(i=>{s.pagination.page=1,s.tableList=[],s.searchGroup=Object.assign(s.searchGroup,i),r()},500),v=K(()=>{s.pagination.page=s.pagination.page+1,r()},500),p=async i=>{try{await oe({materialId:i.id,favoriteFlag:i.isCollect?0:1,type:i.type}),i.isCollect=!i.isCollect}catch(f){}};return B(()=>{q(document.querySelector("."+u),i=>{const f=i[0],{height:m}=f.contentRect;s.searchHeight=m+"px"}),t.type==="homework"&&(s.isShowAddDisabled=!1),r()}),()=>a("div",{class:o.selectMusic},[a("div",{class:u},[a(We,{type:t.type,onSearch:i=>h(i)},null)]),a(fe,{class:o.listContainer,style:{"max-height":"calc(85vh - var(--modal-lesson-tab-height) - ".concat(s.searchHeight," - 12px) ")},onScroll:i=>{var S,I,w;const f=(S=i.target)==null?void 0:S.clientHeight,m=(I=i.target)==null?void 0:I.scrollTop,d=(w=i.target)==null?void 0:w.scrollHeight;f+m+20>=d&&!s.finshed&&!s.loading&&v()}},{default:()=>[a(ae,{show:s.loading,size:"small"},{default:()=>[a("div",{style:{"min-height":"calc(85vh - var(--modal-lesson-tab-height) - ".concat(s.searchHeight," - 12px)")},class:[o.listSection,!s.loading&&s.tableList.length<=0?o.emptySection:""]},[s.tableList.length>0&&a("div",{class:o.list},[s.tableList.map(i=>a(le,{isShowAdd:!0,isShowCollect:!0,item:i,onAdd:()=>n("add",i),disabledMouseHover:!1,onClick:()=>{i.type!=="IMG"&&(s.show=!0,s.item=i)},onCollect:f=>p(f)},null))]),!s.loading&&s.tableList.length<=0&&a(me,null,null)])]})]}),a(he,{from:t.from,show:s.show,"onUpdate:show":i=>s.show=i,item:s.item},null)])}}),it=x({name:"select-music",props:{type:{type:String,default:"myResources"},from:{type:String,default:""}},emits:["select","add"],setup(t,{emit:n}){const{type:e}=re(t),s=y(e.value);return B(()=>{q(document.querySelector(".select-resource .n-tabs-nav--top"),u=>{const r=u[0],{height:h}=r.contentRect;document.documentElement.style.setProperty("--modal-lesson-tab-height",h+"px")})}),()=>a("div",{class:[j.selectMusic,"select-resource"]},[a(ne,{animated:!0,value:s.value,paneClass:j.paneTitle,justifyContent:"center",paneWrapperClass:j.paneWrapperContainer,"onUpdate:value":u=>{s.value=u}},{default:()=>[a(R,{name:"myResources",tab:"我的曲目"},{default:()=>[a(F,{from:t.from,type:"myResources",onAdd:u=>n("add",u)},null)]}),a(R,{name:"shareResources",tab:"共享曲目"},{default:()=>[a(F,{from:t.from,type:"shareResources",onAdd:u=>n("add",u)},null)]}),a(R,{name:"myCollect",tab:"收藏曲目"},{default:()=>[a(F,{from:t.from,type:"myCollect",onAdd:u=>n("add",u)},null)]})]})])}});export{it as S,nt as T,be as u};