1 |
- import{ac as O,ad as q,d as w,a8 as V,al as H,X as M,dH as G,am as $,aa as j,dI as W,bv as J,b as Q,e as F,r as b,p as L,f as s,N as U,g as I,w as R,j as _,k as y,dA as T,F as D,i as k,v as X,y as Y,C as Z,bG as ee,q as te,t as x}from"./index-b5d795c3-1711617551545.js";import{i as se,C as ae,m as re,f as ie}from"./api-6a3840c3-1711617551545.js";import{T as le}from"./index-45f92ba4-1711617551545.js";import{u as oe}from"./catchData-cd60b28d-1711617551545.js";import{a as z,u as ne}from"./index-08708473-1711617551545.js";import{T as ue}from"./index-6ff67e88-1711617551545.js";import{u as K}from"./index-4806286c-1711617551545.js";import{C as ce}from"./index-cf6ce3df-1711617551545.js";import{N as de}from"./Scrollbar-399b413d-1711617551545.js";const pe=O("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",[q("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 ")]),he=Object.assign(Object.assign({},H.props),{size:{type:String,default:"medium"},bordered:{type:Boolean,default:void 0}}),P=w({name:"InputGroupLabel",props:he,setup(t){const{mergedBorderedRef:n,mergedClsPrefixRef:e,inlineThemeDisabled:a}=V(t),l=H("Input","-input-group-label",pe,W,t,e),r=M(()=>{const{size:f}=t,{common:{cubicBezierEaseInOut:h},self:{groupLabelColor:i,borderRadius:u,groupLabelTextColor:d,lineHeight:p,groupLabelBorder:S,[G("fontSize",f)]:C,[G("height",f)]:E}}=l.value;return{"--n-bezier":h,"--n-group-label-color":i,"--n-group-label-border":S,"--n-border-radius":u,"--n-group-label-text-color":d,"--n-font-size":C,"--n-line-height":p,"--n-height":E}}),c=a?$("input-group-label",M(()=>t.size[0]),r,t):void 0;return{mergedClsPrefix:e,mergedBordered:n,cssVars:a?void 0:r,themeClass:c==null?void 0:c.themeClass,onRender:c==null?void 0:c.onRender}},render(){var t,n,e;const{mergedClsPrefix:a}=this;return(t=this.onRender)===null||t===void 0||t.call(this),j("div",{class:["".concat(a,"-input-group-label"),this.themeClass],style:this.cssVars},(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n),this.mergedBordered?j("div",{class:"".concat(a,"-input-group-label__border")}):null)}}),ge=J("prepare-lessons-store",{state:()=>({subjectId:null,baseCourseware:{},selectKey:"",lessonCoursewareId:"",subjectList:[],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},getBaseCourseware(){return this.baseCourseware},getSelectKey(){return this.selectKey},getSelectName(){var n;let t="";for(let e=0;e<this.getTreeList.length;e++){const a=this.getTreeList[e];a.id===this.selectKey&&(t=a.name),!t&&a.knowledgeList.length>0&&((n=a.knowledgeList)==null||n.forEach(l=>{l.id===this.selectKey&&(t=l.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},getClassGroupId(){return this.classGroupId}},actions:{setSubjectId(t){this.subjectId=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},setClassGroupId(t){this.classGroupId=t}}}),fe="_trainUpdate_my1j3_1",me="_updateBtnGroup_my1j3_4",ye="_active_my1j3_16",be="_scoreGroup_my1j3_30",m={trainUpdate:fe,updateBtnGroup:me,switch:"_switch_my1j3_12",active:ye,scoreGroup:be},Je=w({name:"train-update",props:{item:{type:Object,default:()=>({})},type:{type:String,default:"train"}},emits:["close","confirm"],setup(t,{emit:n}){Q();const e=F({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}),a=b(),l=async()=>{var r;(r=a.value)==null||r.validate(async c=>{if(!c){e.uploading=!0;try{const f={trainingType:e.type,musicId:e.musicId,musicName:e.musicName,coursewareKnowledgeDetailId:e.coursewareKnowledgeDetailId,subjectId:e.subjectId,id:e.id,coverImg:e.coverImg,trainingConfigJson:""},h={};h.practiceChapterBegin=e.minScore,h.practiceChapterEnd=e.maxScore,e.type==="PRACTICE"?(h.practiceSpeed=e.practiceSpeed,h.trainingTimes=e.practiceTimes):(h.evaluateDifficult=e.difficulty,h.evaluateSpeed=e.evaluationSpeed,h.trainingTimes=e.evaluationScore),h.practiceChapterMax=e.baseMaxScore,f.trainingConfigJson=h,n("close"),n("confirm",f)}catch(f){}e.uploading=!1}})};return L(()=>{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}),()=>s("div",{class:m.trainUpdate},[s(U,{ref:a,model:e,labelAlign:"right",labelPlacement:"left"},{default:()=>[s(I,{label:"训练方式",path:"type",rule:[{required:!0,message:"请选择训练方式"}]},{default:()=>[s(R,null,{default:()=>[s(_,{secondary:!0,class:[m.switch,e.type==="PRACTICE"?m.active:""],onClick:()=>e.type="PRACTICE"},{default:()=>[y("练习")]}),s(_,{secondary:!0,class:[m.switch,e.type==="EVALUATION"?m.active:""],onClick:()=>e.type="EVALUATION"},{default:()=>[y("评测")]})]})]}),s("div",{class:m.scoreGroup},[s(I,{label:e.type==="PRACTICE"?"练习小节":"评测小节",path:"minScore",rule:[{required:!0,message:"请输入最小练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[s(T,{value:e.minScore,"onUpdate:value":[r=>e.minScore=r,()=>{e.maxScore=null}],showButton:!1,min:1,max:e.baseMaxScore,placeholder:"最小练习小节",clearable:!0},null)]}),s("div",{style:{"--n-feedback-height":"24px",display:"flex",alignItems:"center",margin:"-2px 2% 0 2%",marginBottom:"var(--n-feedback-height)"}},[y("-")]),s(I,{path:"maxScore",rule:[{required:!0,message:"请输入最大练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[s(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"&&s(D,null,[s(I,{label:"练习速度",path:"practiceSpeed",rule:[{required:!0,message:"请输入练习速度",trigger:["blur","change"],type:"number"}]},{default:()=>[s(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)]}),s(I,{label:"练习时长",path:"practiceTimes",rule:[{required:!0,message:"请输入练习时长",trigger:["blur","change"],type:"number"}]},{default:()=>[s(k,null,{default:()=>[s(T,{min:0,showButton:!1,style:{width:"100%"},value:e.practiceTimes,"onUpdate:value":r=>e.practiceTimes=r,placeholder:"请输入练习时长",clearable:!0},null),s(P,null,{default:()=>[y("分钟")]})]})]})]),e.type==="EVALUATION"&&s(D,null,[s(I,{label:"评测难度",path:"type",rule:[{required:!0,message:"请选择评测难度"}]},{default:()=>[s(R,null,{default:()=>[s(_,{secondary:!0,class:[m.switch,e.difficulty==="BEGINNER"?m.active:""],onClick:()=>e.difficulty="BEGINNER"},{default:()=>[y("入门级")]}),s(_,{secondary:!0,class:[m.switch,e.difficulty==="ADVANCED"?m.active:""],onClick:()=>e.difficulty="ADVANCED"},{default:()=>[y("进阶级")]}),s(_,{secondary:!0,class:[m.switch,e.difficulty==="PERFORMER"?m.active:""],onClick:()=>e.difficulty="PERFORMER"},{default:()=>[y("大师级")]})]})]}),s(I,{label:"合格分数",path:"evaluationScore",rule:[{required:!0,message:"请输入合格分数",trigger:["blur","change"],type:"number"}]},{default:()=>[s(k,null,{default:()=>[s(T,{min:0,showButton:!1,style:{width:"100%"},value:e.evaluationScore,"onUpdate:value":r=>e.evaluationScore=r,placeholder:"请输入合格分数",clearable:!0},null),s(P,null,{default:()=>[y("分")]})]})]})]),s(R,{class:m.updateBtnGroup},{default:()=>[s(_,{strong:!0,type:"default",round:!0,onClick:()=>n("close")},{default:()=>[y("取消")]}),s(_,{strong:!0,type:"primary",round:!0,onClick:()=>l()},{default:()=>[y("确认")]})]})]})])}}),Se="_selectMusic_fj7p5_1",Ce="_close_fj7p5_37",ve="_listContainer_fj7p5_44",A={selectMusic:Se,close:Ce,listContainer:ve},Ie="_selectMusic_6iu97_1",_e="_close_6iu97_1",Ee="_listContainer_6iu97_8",Te="_emptySection_6iu97_11",we="_list_6iu97_8",Re="_searchGroup_6iu97_24",Le="_inputSearch_6iu97_47",xe="_searchBtn_6iu97_62",Ae="_spaceSection_6iu97_68",Be="_collapseWrap_6iu97_76",Fe="_collaoseBtn_6iu97_82",Ne="_isStart_6iu97_87",Me="_collapsSection_6iu97_90",Ge="_collapsSectionEmpty_6iu97_93",je="_isHidden_6iu97_97",De="_hideButton_6iu97_101",g={selectMusic:Ie,close:_e,listContainer:Ee,emptySection:Te,list:we,searchGroup:Re,inputSearch:Le,searchBtn:xe,spaceSection:Ae,collapseWrap:Be,collaoseBtn:Fe,isStart:Ne,collapsSection:Me,collapsSectionEmpty:Ge,isHidden:je,hideButton:De},ke=w({name:"search-group",props:{type:{type:String,default:""}},emits:["search","add"],setup(t,{emit:n}){const e=oe(),a=F({name:"",musicSheetCategoriesId:null}),l=()=>{n("search",a)},r=z(()=>{l()},500),c=b(),f=b([]),h=b(0),i=b(0),u=b(0),d=b(!1),p=b(!1),S=o=>{o!=null&&o.selfElRef&&f.value.push(o.selfElRef.parentNode)},C=o=>{d.value=o,E()},E=()=>{try{f.value=[...new Set(f.value)];let o=-1;f.value.forEach((v,N)=>{N===0?(u.value=1,o=v.offsetLeft):v.offsetLeft===o&&N!=0&&u.value++,d.value?v.style.display="block":u.value>1?v.style.display="none":v.style.display="block"}),p.value=!0}catch(o){}};return L(async()=>{var o,v;await e.getMusicSheetCategory(),await e.getSubjects(),h.value=(o=c.value)==null?void 0:o.offsetHeight,i.value=((v=c.value)==null?void 0:v.offsetHeight)/u.value,E()}),()=>s("div",{class:g.searchGroup},[s(U,{labelAlign:"left",labelPlacement:"left"},{default:()=>[s("div",{class:[g.collapsSection,t.type==="myResources"&&g.collapsSectionEmpty]},[s(I,{label:"教材:"},{default:()=>[s("div",{class:[g.collapseWrap,p.value?"":g.hideButton,d.value?"":g.isHidden],ref:c},[s(R,{class:[g.spaceSection]},{default:()=>[e.getAllMusicCategories.map(o=>s(_,{ref:S,secondary:a.musicSheetCategoriesId===o.id,quaternary:a.musicSheetCategoriesId!==o.id,strong:!0,focusable:!1,type:a.musicSheetCategoriesId===o.id?"primary":"default",onClick:()=>{a.musicSheetCategoriesId=o.id,r()}},{default:()=>[o.name]})),u.value>1&&s("div",{style:{height:"var(--n-blank-height)",position:"absolute",display:"flex",alignItems:"center"},onClick:()=>{C(!d.value)}},[s(X,{previewDisabled:!0,src:se,class:[g.collaoseBtn,d.value?g.isStart:""]},null)])]})])]})]),s(le,{class:[g.inputSearch],round:!0,onSearch:o=>{a.name=o,r()}},null)]})])}}),Pe=t=>{if(t==="shareResources")return 2;if(t==="myResources")return 3;if(t==="myCollect")return 4},B=w({name:"select-music",props:{type:{type:String,default:""}},emits:["add"],setup(t,{emit:n}){const e=ge(),a=F({searchHeight:"0px",loading:!1,finshed:!1,pagination:{page:1,rows:20},searchGroup:{name:"",type:"MUSIC",musicSheetCategoriesId:"",sourceType:Pe(t.type),status:1,versionFlag:!1,subjectId:null},tableList:[],show:!1,item:{},isShowAddDisabled:!e.getIsEditTrain}),l="musicSearchGroup"+ +new Date,r=async()=>{try{a.pagination.page===1&&(a.loading=!0);const{data:i}=await re({...a.searchGroup,...a.pagination});a.loading=!1;const u=i.rows||[],d=[];u.forEach(p=>{const S=e.getTrainList.findIndex(C=>C.musicId===p.id);d.push({id:p.id,coverImg:p.coverImg||p.musicSvg,type:"MUSIC",title:p.name,isCollect:!!p.favoriteFlag,isSelected:p.sourceFrom==="PLATFORM",content:p.id,xmlFileUrl:p.xmlFileUrl,exist:S!==-1})}),a.tableList.push(...d),a.finshed=i.pages<=i.current}catch(i){a.loading=!1}};Y(()=>e.trainList,()=>{a.tableList.forEach(i=>{const u=e.getTrainList.findIndex(d=>d.musicId===i.id);i.exist=u!==-1})},{deep:!0,immediate:!0});const c=ne(i=>{a.pagination.page=1,a.tableList=[],a.searchGroup=Object.assign(a.searchGroup,i),r()},500),f=z(()=>{a.pagination.page=a.pagination.page+1,r()},500),h=async i=>{try{await ie({materialId:i.id,favoriteFlag:i.isCollect?0:1,type:i.type}),i.isCollect=!i.isCollect}catch(u){}};return L(()=>{K(document.querySelector("."+l),i=>{const u=i[0],{height:d}=u.contentRect;a.searchHeight=d+"px"}),t.type==="homework"&&(a.isShowAddDisabled=!1),r()}),()=>s("div",{class:g.selectMusic},[s("div",{class:l},[s(ke,{type:t.type,onSearch:i=>c(i)},null)]),s(de,{class:g.listContainer,style:{"max-height":"calc(85vh - var(--modal-lesson-tab-height) - ".concat(a.searchHeight," - 12px) ")},onScroll:i=>{var S,C,E;const u=(S=i.target)==null?void 0:S.clientHeight,d=(C=i.target)==null?void 0:C.scrollTop,p=(E=i.target)==null?void 0:E.scrollHeight;u+d+20>=p&&!a.finshed&&!a.loading&&f()}},{default:()=>[s(Z,{show:a.loading,size:"small"},{default:()=>[s("div",{style:{"min-height":"calc(85vh - var(--modal-lesson-tab-height) - ".concat(a.searchHeight," - 12px)")},class:[g.listSection,!a.loading&&a.tableList.length<=0?g.emptySection:""]},[a.tableList.length>0&&s("div",{class:g.list},[a.tableList.map(i=>s(ae,{isShowAdd:!0,isShowCollect:!0,item:i,onAdd:()=>n("add",i),disabledMouseHover:!1,onClick:()=>{i.type!=="IMG"&&(a.show=!0,a.item=i)},onCollect:u=>h(u)},null))]),!a.loading&&a.tableList.length<=0&&s(ue,null,null)])]})]}),s(ce,{show:a.show,"onUpdate:show":i=>a.show=i,item:a.item},null)])}}),Qe=w({name:"select-music",props:{type:{type:String,default:"myResources"},from:{type:String,default:""}},emits:["select","add"],setup(t,{emit:n}){const{type:e}=ee(t),a=b(e.value);return L(()=>{K(document.querySelector(".select-resource .n-tabs-nav--top"),l=>{const r=l[0],{height:c}=r.contentRect;document.documentElement.style.setProperty("--modal-lesson-tab-height",c+"px")})}),()=>s("div",{class:[A.selectMusic,"select-resource"]},[s(te,{animated:!0,value:a.value,paneClass:A.paneTitle,justifyContent:"center",paneWrapperClass:A.paneWrapperContainer,"onUpdate:value":l=>{a.value=l}},{default:()=>[s(x,{name:"myResources",tab:"我的曲目"},{default:()=>[s(B,{type:"myResources",onAdd:l=>n("add",l)},null)]}),s(x,{name:"shareResources",tab:"共享曲目"},{default:()=>[s(B,{type:"shareResources",onAdd:l=>n("add",l)},null)]}),s(x,{name:"myCollect",tab:"收藏曲目"},{default:()=>[s(B,{type:"myCollect",onAdd:l=>n("add",l)},null)]})]})])}});export{Qe as S,Je as T,ge as u};
|