index-264ffa87.js 12 KB

1234567891011121314151617181920212223242526272829
  1. import{k as G,n as M,u as q,m as P}from"./api-b69de3b5.js";import{G as U,c$ as k,d as I,O as z,Q as F,U as T,dt as _,d6 as O,V as B,du as V,df as K,b as H,e as w,r as $,q as E,f as t,N as L,g as m,Z as v,j as f,k as d,F as A,aa as b,i as R,b6 as J,m as W,n as Q,t as Z}from"./index-049c043f.js";import{C as X}from"./index-5f4c8db8.js";import{T as Y}from"./index-e7e0d582.js";import{u as N,b as ee}from"./index-0117f8f1.js";import{T as te}from"./index-d66d1228.js";import{N as ae}from"./Scrollbar-6b149e3c.js";const se=U("input-group-label",`
  2. position: relative;
  3. user-select: none;
  4. -webkit-user-select: none;
  5. box-sizing: border-box;
  6. padding: 0 12px;
  7. display: inline-block;
  8. border-radius: var(--n-border-radius);
  9. background-color: var(--n-group-label-color);
  10. color: var(--n-group-label-text-color);
  11. font-size: var(--n-font-size);
  12. line-height: var(--n-height);
  13. height: var(--n-height);
  14. flex-shrink: 0;
  15. white-space: nowrap;
  16. transition:
  17. color .3s var(--n-bezier),
  18. background-color .3s var(--n-bezier),
  19. box-shadow .3s var(--n-bezier);
  20. `,[k("border",`
  21. position: absolute;
  22. left: 0;
  23. right: 0;
  24. top: 0;
  25. bottom: 0;
  26. border-radius: inherit;
  27. border: var(--n-group-label-border);
  28. transition: border-color .3s var(--n-bezier);
  29. `)]),re=Object.assign(Object.assign({},F.props),{size:{type:String,default:"medium"},bordered:{type:Boolean,default:void 0}}),x=I({name:"InputGroupLabel",props:re,setup(a){const{mergedBorderedRef:n,mergedClsPrefixRef:i,inlineThemeDisabled:e}=z(a),c=F("Input","-input-group-label",se,V,a,i),g=T(()=>{const{size:r}=a,{common:{cubicBezierEaseInOut:o},self:{groupLabelColor:u,borderRadius:h,groupLabelTextColor:S,lineHeight:y,groupLabelBorder:C,[_("fontSize",r)]:j,[_("height",r)]:D}}=c.value;return{"--n-bezier":o,"--n-group-label-color":u,"--n-group-label-border":C,"--n-border-radius":h,"--n-group-label-text-color":S,"--n-font-size":j,"--n-line-height":y,"--n-height":D}}),s=e?O("input-group-label",T(()=>a.size[0]),g,a):void 0;return{mergedClsPrefix:i,mergedBordered:n,cssVars:e?void 0:g,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){var a,n,i;const{mergedClsPrefix:e}=this;return(a=this.onRender)===null||a===void 0||a.call(this),B("div",{class:[`${e}-input-group-label`,this.themeClass],style:this.cssVars},(i=(n=this.$slots).default)===null||i===void 0?void 0:i.call(n),this.mergedBordered?B("div",{class:`${e}-input-group-label__border`}):null)}}),ie=K("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(a){this.subjectId=a},setBaseCourseware(a){this.baseCourseware=a},setSelectKey(a){this.selectKey=a},setLessonCoursewareId(a){this.lessonCoursewareId=a},setLessonCoursewareDetailId(a){this.lessonCoursewareDetailId=a},setTreeList(a){this.treeList=a},setCoursewareList(a){this.coursewareList=a},setTrainList(a){this.trainList=a},setTabType(a){this.tabType=a},setSelectMusicStatus(a){this.selectMusicStatus=a},setSelectResourceStatus(a){this.selectResourceStatus=a},setIsAddResource(a){this.isAddResource=a},setIsAddTrain(a){this.isAddTrain=a},setIsEditResource(a){this.isEditResource=a},setIsEditTrain(a){this.iseditTrain=a}}}),ue="_trainUpdate_my1j3_1",le="_updateBtnGroup_my1j3_4",ne="_active_my1j3_16",oe="_scoreGroup_my1j3_30",l={trainUpdate:ue,updateBtnGroup:le,switch:"_switch_my1j3_12",active:ne,scoreGroup:oe},Re=I({name:"train-update",props:{item:{type:Object,default:()=>({})},type:{type:String,default:"train"}},emits:["close","confirm"],setup(a,{emit:n}){const i=H(),e=w({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}),c=$(),g=async()=>{var s;(s=c.value)==null||s.validate(async r=>{if(!r){e.uploading=!0;try{const o={trainingType:e.type,musicId:e.musicId,coursewareKnowledgeDetailId:e.coursewareKnowledgeDetailId,subjectId:e.subjectId,id:e.id,coverImg:e.coverImg,trainingConfigJson:""},u={};e.type==="PRACTICE"?(u.practiceChapterBegin=e.minScore,u.practiceChapterEnd=e.maxScore,u.practiceSpeed=e.practiceSpeed,u.trainingTimes=e.practiceTimes):(u.evaluateDifficult=e.difficulty,u.evaluateSpeed=e.evaluationSpeed,u.trainingTimes=e.evaluationScore),u.practiceChapterMax=e.baseMaxScore,o.trainingConfigJson=u,a.type==="train"&&(e.id?(await G(o),i.success("修改成功")):(await M(o),i.success("添加成功"))),n("close"),n("confirm",o)}catch(o){}e.uploading=!1}})};return E(()=>{const s=a.item;s.trainId?(e.id=s.trainId,e.minScore=s.practiceChapterBegin,e.maxScore=s.practiceChapterEnd,e.practiceSpeed=s.practiceSpeed,e.type=s.trainingType,s.trainingType==="PRACTICE"?e.practiceTimes=s.trainingTimes:e.evaluationScore=s.trainingTimes,e.difficulty=s.evaluateDifficult||"BEGINNER",e.evaluationSpeed=s.evaluateSpeed):(e.minScore=1,e.maxScore=s.practiceChapterMax?s.practiceChapterMax:1),e.baseMaxScore=s.practiceChapterMax||99,e.musicId=s.id,e.coursewareKnowledgeDetailId=s.coursewareKnowledgeDetailId,e.subjectId=s.subjectId,e.coverImg=s.coverImg}),()=>t("div",{class:l.trainUpdate},[t(L,{ref:c,model:e,labelAlign:"right",labelPlacement:"left"},{default:()=>[t(m,{label:"训练方式",path:"type",rule:[{required:!0,message:"请选择训练方式"}]},{default:()=>[t(v,null,{default:()=>[t(f,{secondary:!0,class:[l.switch,e.type==="PRACTICE"?l.active:""],onClick:()=>e.type="PRACTICE"},{default:()=>[d("练习")]}),t(f,{secondary:!0,class:[l.switch,e.type==="EVALUATION"?l.active:""],onClick:()=>e.type="EVALUATION"},{default:()=>[d("评测")]})]})]}),e.type==="PRACTICE"&&t(A,null,[t("div",{class:l.scoreGroup},[t(m,{label:"练习小节",path:"minScore",rule:[{required:!0,message:"请输入最小练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[t(b,{value:e.minScore,"onUpdate:value":[s=>e.minScore=s,()=>{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)"}},[d("-")]),t(m,{path:"maxScore",rule:[{required:!0,message:"请输入最大练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[t(b,{value:e.maxScore,"onUpdate:value":s=>e.maxScore=s,showButton:!1,min:e.minScore||1,max:e.baseMaxScore,placeholder:"最大练习小节",clearable:!0},null)]})]),t(m,{label:"练习速度",path:"practiceSpeed",rule:[{required:!0,message:"请输入练习速度",trigger:["blur","change"],type:"number"}]},{default:()=>[t(b,{min:60,max:270,showButton:!1,style:{width:"100%"},value:e.practiceSpeed,"onUpdate:value":s=>e.practiceSpeed=s,placeholder:"练习速度范围60~270",clearable:!0},null)]}),t(m,{label:"练习时长",path:"practiceTimes",rule:[{required:!0,message:"请输入练习时长",trigger:["blur","change"],type:"number"}]},{default:()=>[t(R,null,{default:()=>[t(b,{min:0,showButton:!1,style:{width:"100%"},value:e.practiceTimes,"onUpdate:value":s=>e.practiceTimes=s,placeholder:"请输入练习时长",clearable:!0},null),t(x,null,{default:()=>[d("分钟")]})]})]})]),e.type==="EVALUATION"&&t(A,null,[t(m,{label:"评测难度",path:"type",rule:[{required:!0,message:"请选择评测难度"}]},{default:()=>[t(v,null,{default:()=>[t(f,{secondary:!0,class:[l.switch,e.difficulty==="BEGINNER"?l.active:""],onClick:()=>e.difficulty="BEGINNER"},{default:()=>[d("入门级")]}),t(f,{secondary:!0,class:[l.switch,e.difficulty==="ADVANCED"?l.active:""],onClick:()=>e.difficulty="ADVANCED"},{default:()=>[d("进阶级")]}),t(f,{secondary:!0,class:[l.switch,e.difficulty==="PERFORMER"?l.active:""],onClick:()=>e.difficulty="PERFORMER"},{default:()=>[d("大师级")]})]})]}),t(m,{label:"评测速度",path:"evaluationSpeed",rule:[{required:!0,message:"请输入评测速度",trigger:["blur","change"],type:"number"}]},{default:()=>[t(b,{min:60,max:270,showButton:!1,style:{width:"100%"},value:e.evaluationSpeed,"onUpdate:value":s=>e.evaluationSpeed=s,placeholder:"评测速度范围60~270",clearable:!0},null)]}),t(m,{label:"合格分数",path:"evaluationScore",rule:[{required:!0,message:"请输入合格分数",trigger:["blur","change"],type:"number"}]},{default:()=>[t(R,null,{default:()=>[t(b,{min:0,showButton:!1,style:{width:"100%"},value:e.evaluationScore,"onUpdate:value":s=>e.evaluationScore=s,placeholder:"请输入合格分数",clearable:!0},null),t(x,null,{default:()=>[d("分")]})]})]})]),t(v,{class:l.updateBtnGroup},{default:()=>[t(f,{strong:!0,type:"default",round:!0,onClick:()=>n("close")},{default:()=>[d("取消")]}),t(f,{strong:!0,type:"primary",round:!0,onClick:()=>g()},{default:()=>[d("确认")]})]})]})])}}),ce="_selectMusic_wqg1y_1",de="_close_wqg1y_30",pe="_listContainer_wqg1y_37",ge="_listSection_wqg1y_42",he="_emptySection_wqg1y_45",me="_list_wqg1y_37",fe="_searchGroup_wqg1y_58",be="_inputSearch_wqg1y_80",Se="_searchBtn_wqg1y_95",ye="_spaceSection_wqg1y_101",p={selectMusic:ce,close:de,listContainer:pe,listSection:ge,emptySection:he,list:me,searchGroup:fe,inputSearch:be,searchBtn:Se,spaceSection:ye};function Ce(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!J(a)}const ve=I({name:"search-group",emits:["search","add"],setup(a,{emit:n}){const i=q(),e=w({name:"",musicSheetCategoriesId:null}),c=()=>{n("search",e)},g=N(()=>{c()},500);return E(async()=>{await i.getMusicSheetCategory(),await i.getSubjects()}),()=>{let s;return t("div",{class:p.searchGroup},[t(L,{labelAlign:"left",labelPlacement:"left"},{default:()=>[t(m,{label:"教材:"},{default:()=>[t(v,{class:p.spaceSection},Ce(s=i.getAllMusicCategories.map(r=>t(f,{secondary:e.musicSheetCategoriesId===r.id,quaternary:e.musicSheetCategoriesId!==r.id,strong:!0,focusable:!1,type:e.musicSheetCategoriesId===r.id?"primary":"default",onClick:()=>{e.musicSheetCategoriesId=r.id,g()}},{default:()=>[r.name]})))?s:{default:()=>[s]})]}),t(Y,{class:p.inputSearch,round:!0,onSearch:r=>{e.name=r,g()}},null)]})])}}}),xe=I({name:"select-music",emits:["add"],setup(a,{emit:n}){const i=ie(),e=w({loading:!1,finshed:!1,pagination:{page:1,rows:20},searchGroup:{name:"",musicSheetCategoriesId:"",status:1,versionFlag:!1,subjectId:null},tableList:[]}),c=async()=>{try{e.pagination.page===1&&(e.loading=!0);const{data:r}=await P({...e.searchGroup,...e.pagination,subjectId:i.getSubjectId});e.loading=!1;const o=r.rows||[],u=[];o.forEach(h=>{u.push({id:h.id,coverImg:h.musicSvg,type:"MUSIC",title:h.musicSheetName,isCollect:!1,isSelected:!0,content:h.id,xmlFileUrl:h.xmlFileUrl})}),e.tableList.push(...u),e.finshed=r.pages<=r.current}catch(r){e.loading=!1}},g=ee(r=>{e.pagination.page=1,e.tableList=[],e.searchGroup=Object.assign(e.searchGroup,r),c()},500),s=N(()=>{e.pagination.page=e.pagination.page+1,c()},500);return E(()=>{c()}),()=>t("div",{class:p.selectMusic},[t(W,{animated:!0,defaultValue:"shareResources",paneClass:p.paneTitle,justifyContent:"center",paneWrapperClass:p.paneWrapperContainer},{default:()=>[t(Q,{name:"shareResources",tab:"选择曲目"},{default:()=>[t(ve,{onSearch:r=>g(r)},null),t(ae,{class:p.listContainer,onScroll:r=>{var S,y,C;const o=(S=r.target)==null?void 0:S.clientHeight,u=(y=r.target)==null?void 0:y.scrollTop,h=(C=r.target)==null?void 0:C.scrollHeight;o+u+20>=h&&!e.finshed&&!e.loading&&s()}},{default:()=>[t(Z,{show:e.loading,size:"small"},{default:()=>[t("div",{class:[p.listSection,!e.loading&&e.tableList.length<=0?p.emptySection:""]},[e.tableList.length>0&&t("div",{class:p.list},[e.tableList.map(r=>t(X,{isShowAdd:!0,isShowCollect:!1,item:r,isShowAddDisabled:i.getIsEditTrain,onAdd:()=>n("add",r)},null))]),!e.loading&&e.tableList.length<=0&&t(te,null,null)])]})]})]})]})])}});export{xe as S,Re as T,ie as u};