index-74fed98a.js 13 KB

1
  1. import{k as U,n as z,u as H,m as K}from"./catchData-da0e46be.js";import{M as V,cZ as O,d as T,W as q,X as G,_ as k,dt as x,d4 as W,$ as F,du as $,dd as J,b as X,e as R,r as b,n as A,f as t,N as j,g as S,v as w,j as C,k as g,F as N,dr as E,i as M,y as Z,p as Q,q as Y,A as ee}from"./index-ea33af14.js";import{i as te,C as se,a as ae}from"./isCollaose-b71f0b59.js";import{T as re}from"./index-d23a91d1.js";import{u as P,b as ie}from"./index-a89a78d5.js";import{T as le}from"./index-36ed9891.js";import{N as oe}from"./Scrollbar-cb4032aa.js";const ne=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",[O("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 ")]),ue=Object.assign(Object.assign({},G.props),{size:{type:String,default:"medium"},bordered:{type:Boolean,default:void 0}}),D=T({name:"InputGroupLabel",props:ue,setup(s){const{mergedBorderedRef:p,mergedClsPrefixRef:o,inlineThemeDisabled:e}=q(s),h=G("Input","-input-group-label",ne,$,s,o),m=k(()=>{const{size:r}=s,{common:{cubicBezierEaseInOut:c},self:{groupLabelColor:i,borderRadius:u,groupLabelTextColor:f,lineHeight:v,groupLabelBorder:y,[x("fontSize",r)]:B,[x("height",r)]:_}}=h.value;return{"--n-bezier":c,"--n-group-label-color":i,"--n-group-label-border":y,"--n-border-radius":u,"--n-group-label-text-color":f,"--n-font-size":B,"--n-line-height":v,"--n-height":_}}),a=e?W("input-group-label",k(()=>s.size[0]),m,s):void 0;return{mergedClsPrefix:o,mergedBordered:p,cssVars:e?void 0:m,themeClass:a==null?void 0:a.themeClass,onRender:a==null?void 0:a.onRender}},render(){var s,p,o;const{mergedClsPrefix:e}=this;return(s=this.onRender)===null||s===void 0||s.call(this),F("div",{class:["".concat(e,"-input-group-label"),this.themeClass],style:this.cssVars},(o=(p=this.$slots).default)===null||o===void 0?void 0:o.call(p),this.mergedBordered?F("div",{class:"".concat(e,"-input-group-label__border")}):null)}}),ce=J("prepare-lessons-store",{state:()=>({subjectId:null,baseCourseware:{},selectKey:"",lessonCoursewareId:"",lessonCoursewareDetailId:"",treeList:[],coursewareList:[],trainList:[],tabType:"courseware",selectMusicStatus:!1,selectResourceStatus:!1,isAddResource:!1,isEditResource:!1,iseditTrain:!1,isAddTrain:!1}),getters:{getSubjectId(){return this.subjectId},getBaseCourseware(){return this.baseCourseware},getSelectKey(){return this.selectKey},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}},actions:{setSubjectId(s){this.subjectId=s},setBaseCourseware(s){this.baseCourseware=s},setSelectKey(s){this.selectKey=s},setLessonCoursewareId(s){this.lessonCoursewareId=s},setLessonCoursewareDetailId(s){this.lessonCoursewareDetailId=s},setTreeList(s){this.treeList=s},setCoursewareList(s){this.coursewareList=s},setTrainList(s){this.trainList=s},setTabType(s){this.tabType=s},setSelectMusicStatus(s){this.selectMusicStatus=s},setSelectResourceStatus(s){this.selectResourceStatus=s},setIsAddResource(s){this.isAddResource=s},setIsAddTrain(s){this.isAddTrain=s},setIsEditResource(s){this.isEditResource=s},setIsEditTrain(s){this.iseditTrain=s}}}),de="_trainUpdate_my1j3_1",pe="_updateBtnGroup_my1j3_4",he="_active_my1j3_16",fe="_scoreGroup_my1j3_30",d={trainUpdate:de,updateBtnGroup:pe,switch:"_switch_my1j3_12",active:he,scoreGroup:fe},Pe=T({name:"train-update",props:{item:{type:Object,default:()=>({})},type:{type:String,default:"train"}},emits:["close","confirm"],setup(s,{emit:p}){const o=X(),e=R({id:null,uploading:!1,baseMaxScore:99,type:"PRACTICE",musicId:"",coursewareKnowledgeDetailId:"",minScore:null,maxScore:null,subjectId:"",coverImg:"",practiceSpeed:null,practiceTimes:null,difficulty:"BEGINNER",evaluationSpeed:null,evaluationScore:null}),h=b(),m=async()=>{var a;(a=h.value)==null||a.validate(async r=>{if(!r){e.uploading=!0;try{const c={trainingType:e.type,musicId:e.musicId,coursewareKnowledgeDetailId:e.coursewareKnowledgeDetailId,subjectId:e.subjectId,id:e.id,coverImg:e.coverImg,trainingConfigJson:""},i={};e.type==="PRACTICE"?(i.practiceChapterBegin=e.minScore,i.practiceChapterEnd=e.maxScore,i.practiceSpeed=e.practiceSpeed,i.trainingTimes=e.practiceTimes):(i.evaluateDifficult=e.difficulty,i.evaluateSpeed=e.evaluationSpeed,i.trainingTimes=e.evaluationScore),i.practiceChapterMax=e.baseMaxScore,c.trainingConfigJson=i,s.type==="train"&&(e.id?(await U(c),o.success("修改成功")):(await z(c),o.success("添加成功"))),p("close"),p("confirm",c)}catch(c){}e.uploading=!1}})};return A(()=>{const a=s.item;a.trainId?(e.id=a.trainId,e.minScore=a.practiceChapterBegin,e.maxScore=a.practiceChapterEnd,e.practiceSpeed=a.practiceSpeed,e.type=a.trainingType,a.trainingType==="PRACTICE"?e.practiceTimes=a.trainingTimes:e.evaluationScore=a.trainingTimes,e.difficulty=a.evaluateDifficult||"BEGINNER",e.evaluationSpeed=a.evaluateSpeed):(e.minScore=1,e.maxScore=a.practiceChapterMax?a.practiceChapterMax:1),e.baseMaxScore=a.practiceChapterMax||99,e.musicId=a.id,e.coursewareKnowledgeDetailId=a.coursewareKnowledgeDetailId,e.subjectId=a.subjectId,e.coverImg=a.coverImg}),()=>t("div",{class:d.trainUpdate},[t(j,{ref:h,model:e,labelAlign:"right",labelPlacement:"left"},{default:()=>[t(S,{label:"训练方式",path:"type",rule:[{required:!0,message:"请选择训练方式"}]},{default:()=>[t(w,null,{default:()=>[t(C,{secondary:!0,class:[d.switch,e.type==="PRACTICE"?d.active:""],onClick:()=>e.type="PRACTICE"},{default:()=>[g("练习")]}),t(C,{secondary:!0,class:[d.switch,e.type==="EVALUATION"?d.active:""],onClick:()=>e.type="EVALUATION"},{default:()=>[g("评测")]})]})]}),e.type==="PRACTICE"&&t(N,null,[t("div",{class:d.scoreGroup},[t(S,{label:"练习小节",path:"minScore",rule:[{required:!0,message:"请输入最小练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[t(E,{value:e.minScore,"onUpdate:value":[a=>e.minScore=a,()=>{e.maxScore=null}],showButton:!1,min:1,max:e.baseMaxScore,placeholder:"最小练习小节",clearable:!0},null)]}),t("div",{style:{"--n-feedback-height":"24px",display:"flex",alignItems:"center",margin:"-2px 2% 0 2%",marginBottom:"var(--n-feedback-height)"}},[g("-")]),t(S,{path:"maxScore",rule:[{required:!0,message:"请输入最大练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[t(E,{value:e.maxScore,"onUpdate:value":a=>e.maxScore=a,showButton:!1,min:e.minScore||1,max:e.baseMaxScore,placeholder:"最大练习小节",clearable:!0},null)]})]),t(S,{label:"练习速度",path:"practiceSpeed",rule:[{required:!0,message:"请输入练习速度",trigger:["blur","change"],type:"number"}]},{default:()=>[t(E,{min:60,max:270,showButton:!1,style:{width:"100%"},value:e.practiceSpeed,"onUpdate:value":a=>e.practiceSpeed=a,placeholder:"练习速度范围60~270",clearable:!0},null)]}),t(S,{label:"练习时长",path:"practiceTimes",rule:[{required:!0,message:"请输入练习时长",trigger:["blur","change"],type:"number"}]},{default:()=>[t(M,null,{default:()=>[t(E,{min:0,showButton:!1,style:{width:"100%"},value:e.practiceTimes,"onUpdate:value":a=>e.practiceTimes=a,placeholder:"请输入练习时长",clearable:!0},null),t(D,null,{default:()=>[g("分钟")]})]})]})]),e.type==="EVALUATION"&&t(N,null,[t(S,{label:"评测难度",path:"type",rule:[{required:!0,message:"请选择评测难度"}]},{default:()=>[t(w,null,{default:()=>[t(C,{secondary:!0,class:[d.switch,e.difficulty==="BEGINNER"?d.active:""],onClick:()=>e.difficulty="BEGINNER"},{default:()=>[g("入门级")]}),t(C,{secondary:!0,class:[d.switch,e.difficulty==="ADVANCED"?d.active:""],onClick:()=>e.difficulty="ADVANCED"},{default:()=>[g("进阶级")]}),t(C,{secondary:!0,class:[d.switch,e.difficulty==="PERFORMER"?d.active:""],onClick:()=>e.difficulty="PERFORMER"},{default:()=>[g("大师级")]})]})]}),t(S,{label:"合格分数",path:"evaluationScore",rule:[{required:!0,message:"请输入合格分数",trigger:["blur","change"],type:"number"}]},{default:()=>[t(M,null,{default:()=>[t(E,{min:0,showButton:!1,style:{width:"100%"},value:e.evaluationScore,"onUpdate:value":a=>e.evaluationScore=a,placeholder:"请输入合格分数",clearable:!0},null),t(D,null,{default:()=>[g("分")]})]})]})]),t(w,{class:d.updateBtnGroup},{default:()=>[t(C,{strong:!0,type:"default",round:!0,onClick:()=>p("close")},{default:()=>[g("取消")]}),t(C,{strong:!0,type:"primary",round:!0,onClick:()=>m()},{default:()=>[g("确认")]})]})]})])}}),ge="_selectMusic_ofk47_1",me="_close_ofk47_30",be="_listContainer_ofk47_37",Se="_listSection_ofk47_42",Ce="_emptySection_ofk47_45",ve="_list_ofk47_37",ye="_searchGroup_ofk47_58",Ie="_inputSearch_ofk47_81",Ee="_searchBtn_ofk47_96",_e="_spaceSection_ofk47_102",we="_collapseWrap_ofk47_108",Te="_collaoseBtn_ofk47_114",Be="_isStart_ofk47_119",Re="_collapsSection_ofk47_122",Ae="_isHidden_ofk47_125",Le="_hideButton_ofk47_129",n={selectMusic:ge,close:me,listContainer:be,listSection:Se,emptySection:Ce,list:ve,searchGroup:ye,inputSearch:Ie,searchBtn:Ee,spaceSection:_e,collapseWrap:we,collaoseBtn:Te,isStart:Be,collapsSection:Re,isHidden:Ae,hideButton:Le},ke=T({name:"search-group",emits:["search","add"],setup(s,{emit:p}){const o=H(),e=R({name:"",musicSheetCategoriesId:null}),h=()=>{p("search",e)},m=P(()=>{h()},500),a=b(),r=b([]),c=b(0),i=b(0),u=b(0),f=b(!1),v=b(!1),y=l=>{l!=null&&l.selfElRef&&r.value.push(l.selfElRef.parentNode)},B=l=>{f.value=l,_()},_=()=>{try{r.value=[...new Set(r.value)];let l=-1;r.value.forEach((I,L)=>{L===0?(u.value=1,l=I.offsetLeft):I.offsetLeft===l&&L!=0&&u.value++,f.value?I.style.display="block":u.value>1?I.style.display="none":I.style.display="block"}),v.value=!0}catch(l){}};return A(async()=>{await o.getMusicSheetCategory(),await o.getSubjects(),c.value=a.value.offsetHeight,i.value=a.value.offsetHeight/u.value,_()}),()=>t("div",{class:n.searchGroup},[t(j,{labelAlign:"left",labelPlacement:"left"},{default:()=>[t("div",{class:n.collapsSection},[t(S,{label:"教材:"},{default:()=>[t("div",{class:[n.collapseWrap,v.value?"":n.hideButton,f.value?"":n.isHidden],ref:a},[t(w,{class:[n.spaceSection]},{default:()=>[o.getAllMusicCategories.map(l=>t(C,{ref:y,secondary:e.musicSheetCategoriesId===l.id,quaternary:e.musicSheetCategoriesId!==l.id,strong:!0,focusable:!1,type:e.musicSheetCategoriesId===l.id?"primary":"default",onClick:()=>{e.musicSheetCategoriesId=l.id,m()}},{default:()=>[l.name]})),u.value>1&&t("div",{style:{height:"var(--n-blank-height)",position:"absolute",display:"flex",alignItems:"center"},onClick:()=>{B(!f.value)}},[t(Z,{previewDisabled:!0,src:te,class:[n.collaoseBtn,f.value?n.isStart:""]},null)])]})])]})]),t(re,{class:n.inputSearch,round:!0,onSearch:l=>{e.name=l,m()}},null)]})])}}),Ue=T({name:"select-music",emits:["add"],setup(s,{emit:p}){const o=ce(),e=R({loading:!1,finshed:!1,pagination:{page:1,rows:20},searchGroup:{name:"",musicSheetCategoriesId:"",status:1,versionFlag:!1,subjectId:null},tableList:[],show:!1,item:{}}),h=async()=>{try{e.pagination.page===1&&(e.loading=!0);const{data:r}=await K({...e.searchGroup,...e.pagination,subjectId:o.getSubjectId});e.loading=!1;const c=r.rows||[],i=[];c.forEach(u=>{i.push({id:u.id,coverImg:u.musicSvg,type:"MUSIC",title:u.musicSheetName,isCollect:!1,isSelected:!0,content:u.id,xmlFileUrl:u.xmlFileUrl})}),e.tableList.push(...i),e.finshed=r.pages<=r.current}catch(r){e.loading=!1}},m=ie(r=>{e.pagination.page=1,e.tableList=[],e.searchGroup=Object.assign(e.searchGroup,r),h()},500),a=P(()=>{e.pagination.page=e.pagination.page+1,h()},500);return A(()=>{h()}),()=>t("div",{class:n.selectMusic},[t(Q,{animated:!0,defaultValue:"shareResources",paneClass:n.paneTitle,justifyContent:"center",paneWrapperClass:n.paneWrapperContainer},{default:()=>[t(Y,{name:"shareResources",tab:"选择曲目"},{default:()=>[t(ke,{onSearch:r=>m(r)},null),t(oe,{class:n.listContainer,onScroll:r=>{var f,v,y;const c=(f=r.target)==null?void 0:f.clientHeight,i=(v=r.target)==null?void 0:v.scrollTop,u=(y=r.target)==null?void 0:y.scrollHeight;c+i+20>=u&&!e.finshed&&!e.loading&&a()}},{default:()=>[t(ee,{show:e.loading,size:"small"},{default:()=>[t("div",{class:[n.listSection,!e.loading&&e.tableList.length<=0?n.emptySection:""]},[e.tableList.length>0&&t("div",{class:n.list},[e.tableList.map(r=>t(se,{isShowAdd:!0,isShowCollect:!1,item:r,isShowAddDisabled:o.getIsEditTrain,onAdd:()=>p("add",r),disabledMouseHover:!1,onClick:()=>{r.type!=="IMG"&&(e.show=!0,e.item=r)}},null))]),!e.loading&&e.tableList.length<=0&&t(le,null,null)])]})]})]})]}),t(ae,{show:e.show,"onUpdate:show":r=>e.show=r,item:e.item},null)])}});export{Ue as S,Pe as T,ce as u};