index-a9a10738-1694078809672.js 18 KB

123456789101112131415161718192021222324252627282930
  1. import{T as q}from"./index-a771a6b5-1694078809672.js";import{v as Y,w as W,j as J,C as Q,m as X,h as Z,f as ee}from"./isCollaose-2ffd9935-1694078809672.js";import{cm as te,cR as se,d as L,cT as ae,cU as U,L as B,dr as R,c$ as ie,aG as G,ds as re,b as $,e as j,r as C,n as x,f as t,N as z,g as I,w as T,j as b,k as g,F as N,dl as _,i as k,t as le,da as ne,p as oe,q as ce,A as H,V as D,c5 as ue,v as F,c6 as de}from"./index-ce8959eb-1694078809672.js";import{T as pe}from"./index-04d5089f-1694078809672.js";import{u as he}from"./catchData-3be69512-1694078809672.js";import{u as O,a as ge}from"./index-4ed60982-1694078809672.js";import{T as K}from"./index-b4d77148-1694078809672.js";import{N as V,C as fe,e as me}from"./contants-ee65eda7-1694078809672.js";const Se=te("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. `,[se("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. `)]),be=Object.assign(Object.assign({},U.props),{size:{type:String,default:"medium"},bordered:{type:Boolean,default:void 0}}),P=L({name:"InputGroupLabel",props:be,setup(s){const{mergedBorderedRef:d,mergedClsPrefixRef:c,inlineThemeDisabled:e}=ae(s),m=U("Input","-input-group-label",Se,re,s,c),S=B(()=>{const{size:n}=s,{common:{cubicBezierEaseInOut:a},self:{groupLabelColor:r,borderRadius:l,groupLabelTextColor:o,lineHeight:h,groupLabelBorder:v,[R("fontSize",n)]:E,[R("height",n)]:M}}=m.value;return{"--n-bezier":a,"--n-group-label-color":r,"--n-group-label-border":v,"--n-border-radius":l,"--n-group-label-text-color":o,"--n-font-size":E,"--n-line-height":h,"--n-height":M}}),i=e?ie("input-group-label",B(()=>s.size[0]),S,s):void 0;return{mergedClsPrefix:c,mergedBordered:d,cssVars:e?void 0:S,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var s,d,c;const{mergedClsPrefix:e}=this;return(s=this.onRender)===null||s===void 0||s.call(this),G("div",{class:[`${e}-input-group-label`,this.themeClass],style:this.cssVars},(c=(d=this.$slots).default)===null||c===void 0?void 0:c.call(d),this.mergedBordered?G("div",{class:`${e}-input-group-label__border`}):null)}}),ye="_trainSettings_htbat_1",ve="_trainBtnGroup_htbat_1",Ce="_searchGroup_htbat_9",Ie="_datetime_htbat_13",we="_trainList_htbat_43",_e="_listSection_htbat_48",Te="_emptySection_htbat_51",Le="_list_htbat_48",Ee="_trainEditModal_htbat_69",Me="_selectMusicModal_htbat_72",y={trainSettings:ye,trainBtnGroup:ve,searchGroup:Ce,datetime:Ie,trainList:we,listSection:_e,emptySection:Te,list:Le,trainEditModal:Ee,selectMusicModal:Me},je="_trainUpdate_my1j3_1",xe="_updateBtnGroup_my1j3_4",De="_active_my1j3_16",Ae="_scoreGroup_my1j3_30",f={trainUpdate:je,updateBtnGroup:xe,switch:"_switch_my1j3_12",active:De,scoreGroup:Ae},Be=L({name:"train-update",props:{item:{type:Object,default:()=>({})},type:{type:String,default:"train"}},emits:["close","confirm"],setup(s,{emit:d}){const c=$(),e=j({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}),m=C(),S=async()=>{var i;(i=m.value)==null||i.validate(async n=>{if(!n){e.uploading=!0;try{const a={trainingType:e.type,musicId:e.musicId,coursewareKnowledgeDetailId:e.coursewareKnowledgeDetailId,subjectId:e.subjectId,id:e.id,coverImg:e.coverImg,trainingConfigJson:""},r={};e.type==="PRACTICE"?(r.practiceChapterBegin=e.minScore,r.practiceChapterEnd=e.maxScore,r.practiceSpeed=e.practiceSpeed,r.trainingTimes=e.practiceTimes):(r.evaluateDifficult=e.difficulty,r.evaluateSpeed=e.evaluationSpeed,r.trainingTimes=e.evaluationScore),r.practiceChapterMax=e.baseMaxScore,a.trainingConfigJson=r,s.type==="train"&&(e.id?(await Y(a),c.success("修改成功")):(await W(a),c.success("添加成功"))),d("close"),d("confirm",a)}catch(a){}e.uploading=!1}})};return x(()=>{const i=s.item;i.trainId?(e.id=i.trainId,e.minScore=i.practiceChapterBegin,e.maxScore=i.practiceChapterEnd,e.practiceSpeed=i.practiceSpeed,e.type=i.trainingType,i.trainingType==="PRACTICE"?e.practiceTimes=i.trainingTimes:e.evaluationScore=i.trainingTimes,e.difficulty=i.evaluateDifficult||"BEGINNER",e.evaluationSpeed=i.evaluateSpeed):(e.minScore=1,e.maxScore=i.practiceChapterMax?i.practiceChapterMax:1),e.baseMaxScore=i.practiceChapterMax||99,e.musicId=i.id,e.coursewareKnowledgeDetailId=i.coursewareKnowledgeDetailId,e.subjectId=i.subjectId,e.coverImg=i.coverImg}),()=>t("div",{class:f.trainUpdate},[t(z,{ref:m,model:e,labelAlign:"right",labelPlacement:"left"},{default:()=>[t(I,{label:"训练方式",path:"type",rule:[{required:!0,message:"请选择训练方式"}]},{default:()=>[t(T,null,{default:()=>[t(b,{secondary:!0,class:[f.switch,e.type==="PRACTICE"?f.active:""],onClick:()=>e.type="PRACTICE"},{default:()=>[g("练习")]}),t(b,{secondary:!0,class:[f.switch,e.type==="EVALUATION"?f.active:""],onClick:()=>e.type="EVALUATION"},{default:()=>[g("评测")]})]})]}),e.type==="PRACTICE"&&t(N,null,[t("div",{class:f.scoreGroup},[t(I,{label:"练习小节",path:"minScore",rule:[{required:!0,message:"请输入最小练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[t(_,{value:e.minScore,"onUpdate:value":[i=>e.minScore=i,()=>{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(I,{path:"maxScore",rule:[{required:!0,message:"请输入最大练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[t(_,{value:e.maxScore,"onUpdate:value":i=>e.maxScore=i,showButton:!1,min:e.minScore||1,max:e.baseMaxScore,placeholder:"最大练习小节",clearable:!0},null)]})]),t(I,{label:"练习速度",path:"practiceSpeed",rule:[{required:!0,message:"请输入练习速度",trigger:["blur","change"],type:"number"}]},{default:()=>[t(_,{min:60,max:270,showButton:!1,style:{width:"100%"},value:e.practiceSpeed,"onUpdate:value":i=>e.practiceSpeed=i,placeholder:"练习速度范围60~270",clearable:!0},null)]}),t(I,{label:"练习时长",path:"practiceTimes",rule:[{required:!0,message:"请输入练习时长",trigger:["blur","change"],type:"number"}]},{default:()=>[t(k,null,{default:()=>[t(_,{min:0,showButton:!1,style:{width:"100%"},value:e.practiceTimes,"onUpdate:value":i=>e.practiceTimes=i,placeholder:"请输入练习时长",clearable:!0},null),t(P,null,{default:()=>[g("分钟")]})]})]})]),e.type==="EVALUATION"&&t(N,null,[t(I,{label:"评测难度",path:"type",rule:[{required:!0,message:"请选择评测难度"}]},{default:()=>[t(T,null,{default:()=>[t(b,{secondary:!0,class:[f.switch,e.difficulty==="BEGINNER"?f.active:""],onClick:()=>e.difficulty="BEGINNER"},{default:()=>[g("入门级")]}),t(b,{secondary:!0,class:[f.switch,e.difficulty==="ADVANCED"?f.active:""],onClick:()=>e.difficulty="ADVANCED"},{default:()=>[g("进阶级")]}),t(b,{secondary:!0,class:[f.switch,e.difficulty==="PERFORMER"?f.active:""],onClick:()=>e.difficulty="PERFORMER"},{default:()=>[g("大师级")]})]})]}),t(I,{label:"合格分数",path:"evaluationScore",rule:[{required:!0,message:"请输入合格分数",trigger:["blur","change"],type:"number"}]},{default:()=>[t(k,null,{default:()=>[t(_,{min:0,showButton:!1,style:{width:"100%"},value:e.evaluationScore,"onUpdate:value":i=>e.evaluationScore=i,placeholder:"请输入合格分数",clearable:!0},null),t(P,null,{default:()=>[g("分")]})]})]})]),t(T,{class:f.updateBtnGroup},{default:()=>[t(b,{strong:!0,type:"default",round:!0,onClick:()=>d("close")},{default:()=>[g("取消")]}),t(b,{strong:!0,type:"primary",round:!0,onClick:()=>S()},{default:()=>[g("确认")]})]})]})])}}),Re="_selectMusic_thw4j_1",Ge="_close_thw4j_30",Ne="_listContainer_thw4j_37",ke="_listSection_thw4j_42",Fe="_emptySection_thw4j_45",Pe="_list_thw4j_37",Ue="_searchGroup_thw4j_58",$e="_inputSearch_thw4j_81",ze="_searchBtn_thw4j_96",He="_spaceSection_thw4j_102",Oe="_collapseWrap_thw4j_110",Ke="_collaoseBtn_thw4j_116",Ve="_isStart_thw4j_121",qe="_collapsSection_thw4j_124",Ye="_isHidden_thw4j_127",We="_hideButton_thw4j_131",p={selectMusic:Re,close:Ge,listContainer:Ne,listSection:ke,emptySection:Fe,list:Pe,searchGroup:Ue,inputSearch:$e,searchBtn:ze,spaceSection:He,collapseWrap:Oe,collaoseBtn:Ke,isStart:Ve,collapsSection:qe,isHidden:Ye,hideButton:We},Je=L({name:"search-group",emits:["search","add"],setup(s,{emit:d}){const c=he(),e=j({name:"",musicSheetCategoriesId:null}),m=()=>{d("search",e)},S=O(()=>{m()},500),i=C(),n=C([]),a=C(0),r=C(0),l=C(0),o=C(!1),h=C(!1),v=u=>{u!=null&&u.selfElRef&&n.value.push(u.selfElRef.parentNode)},E=u=>{o.value=u,M()},M=()=>{try{n.value=[...new Set(n.value)];let u=-1;n.value.forEach((w,A)=>{A===0?(l.value=1,u=w.offsetLeft):w.offsetLeft===u&&A!=0&&l.value++,o.value?w.style.display="block":l.value>1?w.style.display="none":w.style.display="block"}),h.value=!0}catch(u){}};return x(async()=>{await c.getMusicSheetCategory(),await c.getSubjects(),a.value=i.value.offsetHeight,r.value=i.value.offsetHeight/l.value,M()}),()=>t("div",{class:p.searchGroup},[t(z,{labelAlign:"left",labelPlacement:"left"},{default:()=>[t("div",{class:p.collapsSection},[t(I,{label:"教材:"},{default:()=>[t("div",{class:[p.collapseWrap,h.value?"":p.hideButton,o.value?"":p.isHidden],ref:i},[t(T,{class:[p.spaceSection]},{default:()=>[c.getAllMusicCategories.map(u=>t(b,{ref:v,secondary:e.musicSheetCategoriesId===u.id,quaternary:e.musicSheetCategoriesId!==u.id,strong:!0,focusable:!1,type:e.musicSheetCategoriesId===u.id?"primary":"default",onClick:()=>{e.musicSheetCategoriesId=u.id,S()}},{default:()=>[u.name]})),l.value>1&&t("div",{style:{height:"var(--n-blank-height)",position:"absolute",display:"flex",alignItems:"center"},onClick:()=>{E(!o.value)}},[t(le,{previewDisabled:!0,src:J,class:[p.collaoseBtn,o.value?p.isStart:""]},null)])]})])]})]),t(pe,{class:p.inputSearch,round:!0,onSearch:u=>{e.name=u,S()}},null)]})])}}),Qe=ne("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},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(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},setSubjectList(s){this.subjectList=s},setClassGroupId(s){this.classGroupId=s}}}),Xe=L({name:"select-music",props:{type:{type:String,default:""}},emits:["add"],setup(s,{emit:d}){console.log(s.type);const c=Qe(),e=j({loading:!1,finshed:!1,pagination:{page:1,rows:20},searchGroup:{name:"",musicSheetCategoriesId:"",status:1,versionFlag:!1,subjectId:null},tableList:[],show:!1,item:{},isShowAddDisabled:!c.getIsEditTrain}),m=async()=>{try{e.pagination.page===1&&(e.loading=!0);const{data:n}=await X({...e.searchGroup,...e.pagination,subjectId:c.getSubjectId});e.loading=!1;const a=n.rows||[],r=[];a.forEach(l=>{r.push({id:l.id,coverImg:l.musicSvg,type:"MUSIC",title:l.musicSheetName,isCollect:!1,isSelected:!0,content:l.id,xmlFileUrl:l.xmlFileUrl})}),e.tableList.push(...r),e.finshed=n.pages<=n.current}catch(n){e.loading=!1}},S=ge(n=>{e.pagination.page=1,e.tableList=[],e.searchGroup=Object.assign(e.searchGroup,n),m()},500),i=O(()=>{e.pagination.page=e.pagination.page+1,m()},500);return x(()=>{s.type==="homework"&&(e.isShowAddDisabled=!1),m()}),()=>t("div",{class:p.selectMusic},[t(oe,{animated:!0,defaultValue:"shareResources",paneClass:p.paneTitle,justifyContent:"center",paneWrapperClass:p.paneWrapperContainer},{default:()=>[t(ce,{name:"shareResources",tab:"选择曲目"},{default:()=>[t(Je,{onSearch:n=>S(n)},null),t(V,{class:p.listContainer,onScroll:n=>{var o,h,v;const a=(o=n.target)==null?void 0:o.clientHeight,r=(h=n.target)==null?void 0:h.scrollTop,l=(v=n.target)==null?void 0:v.scrollHeight;a+r+20>=l&&!e.finshed&&!e.loading&&i()}},{default:()=>[t(H,{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(n=>t(Q,{isShowAdd:!0,isShowCollect:!1,item:n,isShowAddDisabled:e.isShowAddDisabled,onAdd:()=>d("add",n),disabledMouseHover:!1,onClick:()=>{n.type!=="IMG"&&(e.show=!0,e.item=n)}},null))]),!e.loading&&e.tableList.length<=0&&t(K,null,null)])]})]})]})]}),t(fe,{show:e.show,"onUpdate:show":n=>e.show=n,item:e.item},null)])}}),nt=L({name:"train-settings",props:{detailId:{type:String,default:""},subjectId:{type:String,default:""},classGroupId:{type:String,default:""}},emits:["close","confirm"],setup(s,{emit:d}){const c=$(),e=j({type:"add",btnLoading:!1,loadingStatus:!1,editStatus:!1,editItem:{},selectMusicStatus:!1,trainList:[],currentTime:D(D().format("YYYY-MM-DD")).valueOf(),expireDate:D().add(7,"day").format("YYYY-MM-DD")}),m=async()=>{e.loadingStatus=!0;try{const{data:a}=await Z({coursewareKnowledgeDetailId:s.detailId,subjectId:s.subjectId,page:1,rows:99}),r=a.rows||[],l=[];r.forEach(o=>{const h=S(o.trainingType,o.trainingConfigJson);l.push({typeList:h||[],...o})}),e.trainList=l||[]}catch(a){}e.loadingStatus=!1},S=(a,r)=>{let l=[];return a==="EVALUATION"?l=[`${me[r.evaluateDifficult]}`,"全部小节",`${r.trainingTimes}分合格`]:l=[`${r.practiceChapterBegin}-${r.practiceChapterEnd}小节`,`速度${r.practiceSpeed}`,`${r.trainingTimes}分钟`],l},i=async a=>{var o;let r="init",l=null;try{const h=await de.get(a.xmlFileUrl,{mode:"cors"});l=(o=new DOMParser().parseFromString(h,"text/xml").getElementsByTagName("part")[0])==null?void 0:o.getElementsByTagName("measure"),r="success"}catch(h){r="error"}r=="success"?a.practiceChapterMax=l.length:a.practiceChapterMax=0,a.coursewareKnowledgeDetailId=s.detailId,a.subjectId=s.subjectId,e.editItem=a,e.editStatus=!0},n=async()=>{if(!e.expireDate){c.error("请选择截止日期");return}if(e.trainList.length<=0){c.error("训练内容不能为空");return}e.btnLoading=!0;try{const a=e.trainList||[],r=[];a.forEach(o=>{r.push({trainingType:o.trainingType,musicId:o.musicId,trainingConfigJsonObject:o.trainingConfigJson})});const l={lessonTrainingDetails:r,expireDate:e.expireDate+" 23:59:59",classGroupId:s.classGroupId};await ee(l),c.success("布置成功"),d("close"),d("confirm")}catch(a){}e.btnLoading=!1};return x(()=>{s.detailId&&s.subjectId&&m()}),()=>t("div",{class:y.trainSettings},[t("div",{class:y.searchGroup},[t(b,{onClick:()=>{e.selectMusicStatus=!0,e.type="add"}},{default:()=>[g("添加作业")]}),t("div",{class:y.datetime},[t("label",null,[g("截止时间:")]),t(ue,{style:{width:"200px"},placeholder:"请选择截止日期","formatted-value":e.expireDate,"onUpdate:formatted-value":a=>e.expireDate=a,type:"date",valueFormat:"yyyy-MM-dd",isDateDisabled:a=>a<e.currentTime},null)])]),t(V,{class:y.trainList},{default:()=>[t(H,{show:e.loadingStatus},{default:()=>[t("div",{class:[y.listSection,!e.loadingStatus&&e.trainList.length<=0?y.emptySection:""]},[e.trainList.length>0&&t("div",{class:y.list},[e.trainList.map(a=>t(q,{item:a,type:"homework",onEdit:r=>{const{trainingConfigJson:l,id:o,musicId:h,...v}=r;e.editItem={...v,id:h,trainId:o,...l},console.log(e.editItem),e.type="update",e.editStatus=!0},onDelete:()=>{const r=e.trainList.findIndex(l=>l.id===a.id);e.trainList.splice(r,1)}},null))]),!e.loadingStatus&&e.trainList.length<=0&&t(K,{description:"暂无作业"},null)])]})]}),t(T,{class:y.trainBtnGroup},{default:()=>[t(b,{strong:!0,type:"default",round:!0,onClick:()=>d("close")},{default:()=>[g("取消布置")]}),t(b,{strong:!0,type:"primary",round:!0,disabled:e.trainList.length<=0,onClick:n},{default:()=>[g("立即布置")]})]}),t(F,{show:e.editStatus,"onUpdate:show":a=>e.editStatus=a,class:["modalTitle background",y.trainEditModal],preset:"card",title:"作业设置"},{default:()=>[t(Be,{item:e.editItem,type:"homework",onClose:()=>e.editStatus=!1,onConfirm:a=>{console.log(a,"update",e);const r=S(a.trainingType,a.trainingConfigJson);e.type==="update"?e.trainList.forEach(l=>{l.id===a.id&&(l.trainingType=a.trainingType,l.trainingConfigJson=a.trainingConfigJson,l.typeList=r)}):e.trainList.push({...a,id:+new Date,musicName:e.editItem.title,typeList:r}),e.editItem={}}},null)]}),t(F,{show:e.selectMusicStatus,"onUpdate:show":a=>e.selectMusicStatus=a,class:["modalTitle",y.selectMusicModal],preset:"card",title:"选择曲目"},{default:()=>[t(Xe,{type:"homework",onAdd:a=>{e.selectMusicStatus=!1,i(a)}},null)]})])}});export{Xe as S,Be as T,nt as a,Qe as u};