1 |
- import{ag as O,aO as q,d as T,aQ as V,aR as U,U as j,dw as M,a_ as $,ak as G,dx as W,bd as J,b as Q,e as N,r as y,p as L,f as s,N as H,g as C,w as R,j as v,k as b,bv as E,F as D,i as k,v as X,A as Y,a4 as Z,q as ee,t as B}from"./index-4551292f-1708401218274.js";import{i as te,C as se,m as ae,f as re}from"./api-299a81f3-1708401218274.js";import{T as le}from"./index-7182e59f-1708401218274.js";import{u as ie}from"./catchData-f8948d0f-1708401218274.js";import{a as z,u as oe}from"./index-d11b1662-1708401218274.js";import{T as ne}from"./index-a0a5064d-1708401218274.js";import{u as K}from"./index-c5960134-1708401218274.js";import{N as ue,C as ce}from"./index-d3a94be2-1708401218274.js";const de=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 ")]),pe=Object.assign(Object.assign({},U.props),{size:{type:String,default:"medium"},bordered:{type:Boolean,default:void 0}}),P=T({name:"InputGroupLabel",props:pe,setup(t){const{mergedBorderedRef:o,mergedClsPrefixRef:e,inlineThemeDisabled:a}=V(t),n=U("Input","-input-group-label",de,W,t,e),r=j(()=>{const{size:g}=t,{common:{cubicBezierEaseInOut:d},self:{groupLabelColor:l,borderRadius:c,groupLabelTextColor:p,lineHeight:m,groupLabelBorder:_,[M("fontSize",g)]:w,[M("height",g)]:I}}=n.value;return{"--n-bezier":d,"--n-group-label-color":l,"--n-group-label-border":_,"--n-border-radius":c,"--n-group-label-text-color":p,"--n-font-size":w,"--n-line-height":m,"--n-height":I}}),u=a?$("input-group-label",j(()=>t.size[0]),r,t):void 0;return{mergedClsPrefix:e,mergedBordered:o,cssVars:a?void 0:r,themeClass:u==null?void 0:u.themeClass,onRender:u==null?void 0:u.onRender}},render(){var t,o,e;const{mergedClsPrefix:a}=this;return(t=this.onRender)===null||t===void 0||t.call(this),G("div",{class:["".concat(a,"-input-group-label"),this.themeClass],style:this.cssVars},(e=(o=this.$slots).default)===null||e===void 0?void 0:e.call(o),this.mergedBordered?G("div",{class:"".concat(a,"-input-group-label__border")}):null)}}),he=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 o;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&&((o=a.knowledgeList)==null||o.forEach(n=>{n.id===this.selectKey&&(t=n.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}}}),ge="_trainUpdate_my1j3_1",fe="_updateBtnGroup_my1j3_4",me="_active_my1j3_16",be="_scoreGroup_my1j3_30",f={trainUpdate:ge,updateBtnGroup:fe,switch:"_switch_my1j3_12",active:me,scoreGroup:be},Ve=T({name:"train-update",props:{item:{type:Object,default:()=>({})},type:{type:String,default:"train"}},emits:["close","confirm"],setup(t,{emit:o}){Q();const e=N({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=y(),n=async()=>{var r;(r=a.value)==null||r.validate(async u=>{if(!u){e.uploading=!0;try{const g={trainingType:e.type,musicId:e.musicId,musicName:e.musicName,coursewareKnowledgeDetailId:e.coursewareKnowledgeDetailId,subjectId:e.subjectId,id:e.id,coverImg:e.coverImg,trainingConfigJson:""},d={};d.practiceChapterBegin=e.minScore,d.practiceChapterEnd=e.maxScore,e.type==="PRACTICE"?(d.practiceSpeed=e.practiceSpeed,d.trainingTimes=e.practiceTimes):(d.evaluateDifficult=e.difficulty,d.evaluateSpeed=e.evaluationSpeed,d.trainingTimes=e.evaluationScore),d.practiceChapterMax=e.baseMaxScore,g.trainingConfigJson=d,o("close"),o("confirm",g)}catch(g){}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:f.trainUpdate},[s(H,{ref:a,model:e,labelAlign:"right",labelPlacement:"left"},{default:()=>[s(C,{label:"训练方式",path:"type",rule:[{required:!0,message:"请选择训练方式"}]},{default:()=>[s(R,null,{default:()=>[s(v,{secondary:!0,class:[f.switch,e.type==="PRACTICE"?f.active:""],onClick:()=>e.type="PRACTICE"},{default:()=>[b("练习")]}),s(v,{secondary:!0,class:[f.switch,e.type==="EVALUATION"?f.active:""],onClick:()=>e.type="EVALUATION"},{default:()=>[b("评测")]})]})]}),s("div",{class:f.scoreGroup},[s(C,{label:e.type==="PRACTICE"?"练习小节":"评测小节",path:"minScore",rule:[{required:!0,message:"请输入最小练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[s(E,{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)"}},[b("-")]),s(C,{path:"maxScore",rule:[{required:!0,message:"请输入最大练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[s(E,{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(C,{label:"练习速度",path:"practiceSpeed",rule:[{required:!0,message:"请输入练习速度",trigger:["blur","change"],type:"number"}]},{default:()=>[s(E,{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(C,{label:"练习时长",path:"practiceTimes",rule:[{required:!0,message:"请输入练习时长",trigger:["blur","change"],type:"number"}]},{default:()=>[s(k,null,{default:()=>[s(E,{min:0,showButton:!1,style:{width:"100%"},value:e.practiceTimes,"onUpdate:value":r=>e.practiceTimes=r,placeholder:"请输入练习时长",clearable:!0},null),s(P,null,{default:()=>[b("分钟")]})]})]})]),e.type==="EVALUATION"&&s(D,null,[s(C,{label:"评测难度",path:"type",rule:[{required:!0,message:"请选择评测难度"}]},{default:()=>[s(R,null,{default:()=>[s(v,{secondary:!0,class:[f.switch,e.difficulty==="BEGINNER"?f.active:""],onClick:()=>e.difficulty="BEGINNER"},{default:()=>[b("入门级")]}),s(v,{secondary:!0,class:[f.switch,e.difficulty==="ADVANCED"?f.active:""],onClick:()=>e.difficulty="ADVANCED"},{default:()=>[b("进阶级")]}),s(v,{secondary:!0,class:[f.switch,e.difficulty==="PERFORMER"?f.active:""],onClick:()=>e.difficulty="PERFORMER"},{default:()=>[b("大师级")]})]})]}),s(C,{label:"合格分数",path:"evaluationScore",rule:[{required:!0,message:"请输入合格分数",trigger:["blur","change"],type:"number"}]},{default:()=>[s(k,null,{default:()=>[s(E,{min:0,showButton:!1,style:{width:"100%"},value:e.evaluationScore,"onUpdate:value":r=>e.evaluationScore=r,placeholder:"请输入合格分数",clearable:!0},null),s(P,null,{default:()=>[b("分")]})]})]})]),s(R,{class:f.updateBtnGroup},{default:()=>[s(v,{strong:!0,type:"default",round:!0,onClick:()=>o("close")},{default:()=>[b("取消")]}),s(v,{strong:!0,type:"primary",round:!0,onClick:()=>n()},{default:()=>[b("确认")]})]})]})])}}),ye="_selectMusic_fj7p5_1",Se="_close_fj7p5_37",Ce="_listContainer_fj7p5_44",x={selectMusic:ye,close:Se,listContainer:Ce},ve="_selectMusic_rrl4p_1",Ie="_close_rrl4p_1",_e="_listContainer_rrl4p_8",we="_emptySection_rrl4p_11",Ee="_list_rrl4p_8",Te="_searchGroup_rrl4p_24",Re="_inputSearch_rrl4p_47",Le="_searchBtn_rrl4p_62",Be="_spaceSection_rrl4p_68",xe="_collapseWrap_rrl4p_76",Ae="_collaoseBtn_rrl4p_82",Ne="_isStart_rrl4p_87",Fe="_collapsSection_rrl4p_90",je="_isHidden_rrl4p_93",Me="_hideButton_rrl4p_97",h={selectMusic:ve,close:Ie,listContainer:_e,emptySection:we,list:Ee,searchGroup:Te,inputSearch:Re,searchBtn:Le,spaceSection:Be,collapseWrap:xe,collaoseBtn:Ae,isStart:Ne,collapsSection:Fe,isHidden:je,hideButton:Me},Ge=T({name:"search-group",emits:["search","add"],setup(t,{emit:o}){const e=ie(),a=N({name:"",musicSheetCategoriesId:null}),n=()=>{o("search",a)},r=z(()=>{n()},500),u=y(),g=y([]),d=y(0),l=y(0),c=y(0),p=y(!1),m=y(!1),_=i=>{i!=null&&i.selfElRef&&g.value.push(i.selfElRef.parentNode)},w=i=>{p.value=i,I()},I=()=>{try{g.value=[...new Set(g.value)];let i=-1;g.value.forEach((S,F)=>{F===0?(c.value=1,i=S.offsetLeft):S.offsetLeft===i&&F!=0&&c.value++,p.value?S.style.display="block":c.value>1?S.style.display="none":S.style.display="block"}),m.value=!0}catch(i){}};return L(async()=>{var i,S;await e.getMusicSheetCategory(),await e.getSubjects(),d.value=(i=u.value)==null?void 0:i.offsetHeight,l.value=((S=u.value)==null?void 0:S.offsetHeight)/c.value,I()}),()=>s("div",{class:h.searchGroup},[s(H,{labelAlign:"left",labelPlacement:"left"},{default:()=>[s("div",{class:h.collapsSection},[s(C,{label:"教材:"},{default:()=>[s("div",{class:[h.collapseWrap,m.value?"":h.hideButton,p.value?"":h.isHidden],ref:u},[s(R,{class:[h.spaceSection]},{default:()=>[e.getAllMusicCategories.map(i=>s(v,{ref:_,secondary:a.musicSheetCategoriesId===i.id,quaternary:a.musicSheetCategoriesId!==i.id,strong:!0,focusable:!1,type:a.musicSheetCategoriesId===i.id?"primary":"default",onClick:()=>{a.musicSheetCategoriesId=i.id,r()}},{default:()=>[i.name]})),c.value>1&&s("div",{style:{height:"var(--n-blank-height)",position:"absolute",display:"flex",alignItems:"center"},onClick:()=>{w(!p.value)}},[s(X,{previewDisabled:!0,src:te,class:[h.collaoseBtn,p.value?h.isStart:""]},null)])]})])]})]),s(le,{class:h.inputSearch,round:!0,onSearch:i=>{a.name=i,r()}},null)]})])}}),De=t=>{if(t==="shareResources")return 2;if(t==="myResources")return 3;if(t==="myCollect")return 4},A=T({name:"select-music",props:{type:{type:String,default:""}},emits:["add"],setup(t,{emit:o}){const e=he(),a=N({searchHeight:"0px",loading:!1,finshed:!1,pagination:{page:1,rows:20},searchGroup:{name:"",type:"MUSIC",musicSheetCategoriesId:"",sourceType:De(t.type),status:1,versionFlag:!1,subjectId:null},tableList:[],show:!1,item:{},isShowAddDisabled:!e.getIsEditTrain}),n="musicSearchGroup"+ +new Date,r=async()=>{try{a.pagination.page===1&&(a.loading=!0);const{data:l}=await ae({...a.searchGroup,...a.pagination,subjectId:e.getSubjectId});a.loading=!1;const c=l.rows||[],p=[];c.forEach(m=>{p.push({id:m.id,coverImg:m.musicSvg,type:"MUSIC",title:m.musicSheetName,isCollect:!1,isSelected:!0,content:m.id,xmlFileUrl:m.xmlFileUrl})}),a.tableList.push(...p),a.finshed=l.pages<=l.current}catch(l){a.loading=!1}},u=oe(l=>{a.pagination.page=1,a.tableList=[],a.searchGroup=Object.assign(a.searchGroup,l),r()},500),g=z(()=>{a.pagination.page=a.pagination.page+1,r()},500),d=async l=>{try{await re({materialId:l.id,favoriteFlag:l.isCollect?0:1,type:l.type}),l.isCollect=!l.isCollect}catch(c){}};return L(()=>{K(document.querySelector("."+n),l=>{const c=l[0],{height:p}=c.contentRect;a.searchHeight=p+"px"}),t.type==="homework"&&(a.isShowAddDisabled=!1),r()}),()=>s("div",{class:h.selectMusic},[s("div",{class:n},[s(Ge,{onSearch:l=>u(l)},null)]),s(ue,{class:h.listContainer,style:{"max-height":"calc(85vh - var(--modal-lesson-tab-height) - ".concat(a.searchHeight," - 12px) ")},onScroll:l=>{var _,w,I;const c=(_=l.target)==null?void 0:_.clientHeight,p=(w=l.target)==null?void 0:w.scrollTop,m=(I=l.target)==null?void 0:I.scrollHeight;c+p+20>=m&&!a.finshed&&!a.loading&&g()}},{default:()=>[s(Y,{show:a.loading,size:"small"},{default:()=>[s("div",{style:{"min-height":"calc(85vh - var(--modal-lesson-tab-height) - ".concat(a.searchHeight," - 12px)")},class:[h.listSection,!a.loading&&a.tableList.length<=0?h.emptySection:""]},[a.tableList.length>0&&s("div",{class:h.list},[a.tableList.map(l=>s(se,{isShowAdd:!0,isShowCollect:!0,item:l,onAdd:()=>o("add",l),disabledMouseHover:!1,onClick:()=>{l.type!=="IMG"&&(a.show=!0,a.item=l)},onCollect:c=>d(c)},null))]),!a.loading&&a.tableList.length<=0&&s(ne,null,null)])]})]}),s(ce,{show:a.show,"onUpdate:show":l=>a.show=l,item:a.item},null)])}}),$e=T({name:"select-music",props:{type:{type:String,default:"myResources"},from:{type:String,default:""}},emits:["select","add"],setup(t,{emit:o}){const{type:e}=Z(t),a=y(e.value);return L(()=>{K(document.querySelector(".select-resource .n-tabs-nav--top"),n=>{const r=n[0],{height:u}=r.contentRect;document.documentElement.style.setProperty("--modal-lesson-tab-height",u+"px")})}),()=>s("div",{class:[x.selectMusic,"select-resource"]},[s(ee,{animated:!0,value:a.value,paneClass:x.paneTitle,justifyContent:"center",paneWrapperClass:x.paneWrapperContainer,"onUpdate:value":n=>{a.value=n}},{default:()=>[s(B,{name:"myResources",tab:"我的曲目"},{default:()=>[s(A,{type:"myResources",onAdd:n=>o("add",n)},null)]}),s(B,{name:"shareResources",tab:"共享曲目"},{default:()=>[s(A,{type:"shareResources"},null)]}),s(B,{name:"myCollect",tab:"收藏曲目"},{default:()=>[s(A,{type:"myCollect"},null)]})]})])}});export{$e as S,Ve as T,he as u};
|