1 |
- import{T as q}from"./index-51d9afb4-1694675857467.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-ec00c669-1694675857467.js";import{cm as te,cR as se,d as L,cT as ae,cU as U,L as x,dr as D,c$ as ie,aG as R,ds as re,b as $,e as A,r as I,n as M,f as t,N as z,g as w,w as T,j as b,k as g,F as G,dl as E,i as N,t as le,da as ne,p as ue,q as oe,A as H,V as j,c5 as ce,v as k,c6 as de}from"./index-54f41458-1694675857467.js";import{T as pe}from"./index-bcfcaaf0-1694675857467.js";import{u as he}from"./catchData-40463961-1694675857467.js";import{u as O,a as ge}from"./index-1ee69226-1694675857467.js";import{T as K}from"./index-f159c5ee-1694675857467.js";import{N as V,C as fe,e as me}from"./contants-825bfb6e-1694675857467.js";const Se=te("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",[se("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 ")]),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=x(()=>{const{size:n}=s,{common:{cubicBezierEaseInOut:a},self:{groupLabelColor:r,borderRadius:l,groupLabelTextColor:u,lineHeight:h,groupLabelBorder:C,[D("fontSize",n)]:_,[D("height",n)]:B}}=m.value;return{"--n-bezier":a,"--n-group-label-color":r,"--n-group-label-border":C,"--n-border-radius":l,"--n-group-label-text-color":u,"--n-font-size":_,"--n-line-height":h,"--n-height":B}}),i=e?ie("input-group-label",x(()=>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),R("div",{class:["".concat(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?R("div",{class:"".concat(e,"-input-group-label__border")}):null)}}),ye="_trainSettings_htbat_1",Ce="_trainBtnGroup_htbat_1",ve="_searchGroup_htbat_9",Ie="_datetime_htbat_13",we="_trainList_htbat_43",_e="_listSection_htbat_48",Ee="_emptySection_htbat_51",Te="_list_htbat_48",Le="_trainEditModal_htbat_69",Be="_selectMusicModal_htbat_72",y={trainSettings:ye,trainBtnGroup:Ce,searchGroup:ve,datetime:Ie,trainList:we,listSection:_e,emptySection:Ee,list:Te,trainEditModal:Le,selectMusicModal:Be},Ae="_trainUpdate_my1j3_1",Me="_updateBtnGroup_my1j3_4",je="_active_my1j3_16",Fe="_scoreGroup_my1j3_30",f={trainUpdate:Ae,updateBtnGroup:Me,switch:"_switch_my1j3_12",active:je,scoreGroup:Fe},xe=L({name:"train-update",props:{item:{type:Object,default:()=>({})},type:{type:String,default:"train"}},emits:["close","confirm"],setup(s,{emit:d}){const c=$(),e=A({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}),m=I(),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,musicName:e.musicName,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 M(()=>{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.musicName=i.musicName,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(w,{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(G,null,[t("div",{class:f.scoreGroup},[t(w,{label:"练习小节",path:"minScore",rule:[{required:!0,message:"请输入最小练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[t(E,{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(w,{path:"maxScore",rule:[{required:!0,message:"请输入最大练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[t(E,{value:e.maxScore,"onUpdate:value":i=>e.maxScore=i,showButton:!1,min:e.minScore||1,max:e.baseMaxScore,placeholder:"最大练习小节",clearable:!0},null)]})]),t(w,{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":i=>e.practiceSpeed=i,placeholder:"练习速度范围60~270",clearable:!0},null)]}),t(w,{label:"练习时长",path:"practiceTimes",rule:[{required:!0,message:"请输入练习时长",trigger:["blur","change"],type:"number"}]},{default:()=>[t(N,null,{default:()=>[t(E,{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(G,null,[t(w,{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(w,{label:"合格分数",path:"evaluationScore",rule:[{required:!0,message:"请输入合格分数",trigger:["blur","change"],type:"number"}]},{default:()=>[t(N,null,{default:()=>[t(E,{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("确认")]})]})]})])}}),De="_selectMusic_thw4j_1",Re="_close_thw4j_30",Ge="_listContainer_thw4j_37",Ne="_listSection_thw4j_42",ke="_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:De,close:Re,listContainer:Ge,listSection:Ne,emptySection:ke,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=A({name:"",musicSheetCategoriesId:null}),m=()=>{d("search",e)},S=O(()=>{m()},500),i=I(),n=I([]),a=I(0),r=I(0),l=I(0),u=I(!1),h=I(!1),C=o=>{o!=null&&o.selfElRef&&n.value.push(o.selfElRef.parentNode)},_=o=>{u.value=o,B()},B=()=>{try{n.value=[...new Set(n.value)];let o=-1;n.value.forEach((v,F)=>{F===0?(l.value=1,o=v.offsetLeft):v.offsetLeft===o&&F!=0&&l.value++,u.value?v.style.display="block":l.value>1?v.style.display="none":v.style.display="block"}),h.value=!0}catch(o){}};return M(async()=>{var o,v;await c.getMusicSheetCategory(),await c.getSubjects(),a.value=(o=i.value)==null?void 0:o.offsetHeight,r.value=((v=i.value)==null?void 0:v.offsetHeight)/l.value,B()}),()=>t("div",{class:p.searchGroup},[t(z,{labelAlign:"left",labelPlacement:"left"},{default:()=>[t("div",{class:p.collapsSection},[t(w,{label:"教材:"},{default:()=>[t("div",{class:[p.collapseWrap,h.value?"":p.hideButton,u.value?"":p.isHidden],ref:i},[t(T,{class:[p.spaceSection]},{default:()=>[c.getAllMusicCategories.map(o=>t(b,{ref:C,secondary:e.musicSheetCategoriesId===o.id,quaternary:e.musicSheetCategoriesId!==o.id,strong:!0,focusable:!1,type:e.musicSheetCategoriesId===o.id?"primary":"default",onClick:()=>{e.musicSheetCategoriesId=o.id,S()}},{default:()=>[o.name]})),l.value>1&&t("div",{style:{height:"var(--n-blank-height)",position:"absolute",display:"flex",alignItems:"center"},onClick:()=>{_(!u.value)}},[t(le,{previewDisabled:!0,src:J,class:[p.collaoseBtn,u.value?p.isStart:""]},null)])]})])]})]),t(pe,{class:p.inputSearch,round:!0,onSearch:o=>{e.name=o,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=A({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 M(()=>{s.type==="homework"&&(e.isShowAddDisabled=!1),m()}),()=>t("div",{class:p.selectMusic},[t(ue,{animated:!0,defaultValue:"shareResources",paneClass:p.paneTitle,justifyContent:"center",paneWrapperClass:p.paneWrapperContainer},{default:()=>[t(oe,{name:"shareResources",tab:"选择曲目"},{default:()=>[t(Je,{onSearch:n=>S(n)},null),t(V,{class:p.listContainer,onScroll:n=>{var u,h,C;const a=(u=n.target)==null?void 0:u.clientHeight,r=(h=n.target)==null?void 0:h.scrollTop,l=(C=n.target)==null?void 0:C.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,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=A({type:"add",btnLoading:!1,loadingStatus:!1,editStatus:!1,editItem:{},selectMusicStatus:!1,trainList:[],currentTime:j(j().format("YYYY-MM-DD")).valueOf(),expireDate:j().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(u=>{const h=S(u.trainingType,u.trainingConfigJson);l.push({typeList:h||[],...u})}),e.trainList=l||[]}catch(a){}e.loadingStatus=!1},S=(a,r)=>{let l=[];return a==="EVALUATION"?l=["".concat(me[r.evaluateDifficult]),"全部小节","".concat(r.trainingTimes,"分合格")]:l=["".concat(r.practiceChapterBegin,"-").concat(r.practiceChapterEnd,"小节"),"速度".concat(r.practiceSpeed),"".concat(r.trainingTimes,"分钟")],l},i=async a=>{var u;let r="init",l=null;try{const h=await de.get(a.xmlFileUrl,{mode:"cors"});l=(u=new DOMParser().parseFromString(h,"text/xml").getElementsByTagName("part")[0])==null?void 0:u.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(u=>{r.push({trainingType:u.trainingType,musicId:u.musicId,trainingConfigJsonObject:u.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 M(()=>{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(ce,{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,r)=>t(q,{item:a,type:"homework",onEdit:l=>{const{trainingConfigJson:u,id:h,musicId:C,..._}=l;e.editItem={..._,id:C,trainId:h,...u},console.log(e.editItem),e.type="update",e.editStatus=!0},onDelete:()=>{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(k,{show:e.editStatus,"onUpdate:show":a=>e.editStatus=a,class:["modalTitle background",y.trainEditModal],preset:"card",title:"作业设置"},{default:()=>[t(xe,{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(k,{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,xe as T,nt as a,Qe as u};
|