index-legacy-e7ec6967-1694675857467.js 23 KB

1
  1. System.register(["./index-legacy-14d53adc-1694675857467.js","./isCollaose-legacy-fb29f84c-1694675857467.js","./index-legacy-35b1c5cd-1694675857467.js","./index-legacy-b4bde969-1694675857467.js","./catchData-legacy-0a8b2cdd-1694675857467.js","./index-legacy-d6165eed-1694675857467.js","./index-legacy-eadbcfa4-1694675857467.js","./contants-legacy-71b48e08-1694675857467.js"],(function(e,t){"use strict";var a,i,s,r,n,l,o,c,d,u,p,h,_,g,m,b,w,f,v,y,S,j,I,C,x,T,L,M,E,G,B,R,D,A,k,z,U,N,F,P,O,K,H,V,$,q,J,Y;return{setters:[e=>{a=e.T},e=>{i=e.v,s=e.w,r=e.j,n=e.C,l=e.m,o=e.h,c=e.f},e=>{d=e.cm,u=e.cR,p=e.d,h=e.cT,_=e.cU,g=e.L,m=e.dr,b=e.c$,w=e.aG,f=e.ds,v=e.b,y=e.e,S=e.r,j=e.n,I=e.f,C=e.N,x=e.g,T=e.w,L=e.j,M=e.k,E=e.F,G=e.dl,B=e.i,R=e.t,D=e.da,A=e.p,k=e.q,z=e.A,U=e.V,N=e.c5,F=e.v,P=e.c6},e=>{O=e.T},e=>{K=e.u},e=>{H=e.u,V=e.a},e=>{$=e.T},e=>{q=e.N,J=e.C,Y=e.e}],execute:function(){var t=document.createElement("style");t.textContent="._trainSettings_htbat_1 ._trainBtnGroup_htbat_1{padding:1.66666667vw 0 2.08333333vw;justify-content:center!important}._trainSettings_htbat_1 ._trainBtnGroup_htbat_1 .n-button{height:2.5vw!important;padding:0 2.1875vw}._trainSettings_htbat_1 ._searchGroup_htbat_9{display:flex;padding:1.35416667vw 2.08333333vw 0}._trainSettings_htbat_1 ._searchGroup_htbat_9 ._datetime_htbat_13{margin-left:2.08333333vw;display:inline-flex;align-items:center}._trainSettings_htbat_1 ._searchGroup_htbat_9 ._datetime_htbat_13 label{font-size:.78125rem;color:#666;line-height:1.09375vw}._trainSettings_htbat_1 ._searchGroup_htbat_9 .n-button{border-radius:.41666667vw;height:2.1875vw;font-size:.88541667rem;font-weight:600!important;padding:0 1.40625vw}._trainSettings_htbat_1 ._searchGroup_htbat_9 .n-button--default-type{background:#E8F4FF;color:#0378ec}._trainSettings_htbat_1 ._searchGroup_htbat_9 .n-button--default-type:not(.n-button--disabled):hover{background:#E8F4FF}._trainSettings_htbat_1 ._searchGroup_htbat_9 .n-button--default-type .n-button__border{border:1px solid #198CFE}._trainSettings_htbat_1 ._searchGroup_htbat_9 .n-input{border-radius:.41666667vw!important}._trainSettings_htbat_1 ._trainList_htbat_43{margin-top:1.45833333vw;max-height:50vh;padding:0 2.08333333vw}._trainSettings_htbat_1 ._trainList_htbat_43 ._listSection_htbat_48{min-height:50vh}._trainSettings_htbat_1 ._trainList_htbat_43 ._emptySection_htbat_51{display:flex;align-items:center}._trainSettings_htbat_1 ._trainList_htbat_43 .n-scrollbar-content{display:flex;gap:1.25vw;flex-wrap:wrap}._trainSettings_htbat_1 ._trainList_htbat_43 .n-spin-container{width:100%}._trainSettings_htbat_1 ._trainList_htbat_43 ._list_htbat_48{display:flex;flex-flow:row wrap;justify-content:flex-start;gap:1.04166667vw}._trainEditModal_htbat_69{width:25.72916667vw}._selectMusicModal_htbat_72{position:relative;width:70.41666667vw}._selectMusicModal_htbat_72 .n-card-header{position:absolute;top:0;left:0;right:0}._selectMusicModal_htbat_72 .n-card-header .n-card-header__main{color:#fff}._trainUpdate_my1j3_1{padding:1.25vw 1.5625vw}._trainUpdate_my1j3_1 ._updateBtnGroup_my1j3_4{padding:0;justify-content:center!important}._trainUpdate_my1j3_1 ._updateBtnGroup_my1j3_4 .n-button{height:2.5vw!important;min-width:8.125vw}._trainUpdate_my1j3_1 ._switch_my1j3_12{height:1.92708333vw!important;border-radius:.41666667vw}._trainUpdate_my1j3_1 ._switch_my1j3_12._active_my1j3_16{background:#198CFE;color:#fff}._trainUpdate_my1j3_1 .n-input-group-label{width:3.95833333vw;padding:0;text-align:center;background-color:#fff;border-radius:.41666667vw}._trainUpdate_my1j3_1 .n-input{border-radius:.41666667vw}._trainUpdate_my1j3_1 ._scoreGroup_my1j3_30{display:flex}._selectMusic_thw4j_1 .n-tabs-tab-pad{width:1.25vw!important}._selectMusic_thw4j_1 .n-tabs-nav{padding:.625vw 1.04166667vw 1.25vw}._selectMusic_thw4j_1 .n-tabs-tab{color:#8b8d98;font-size:max(1.14583333rem,14Px);padding-top:.625vw;padding-bottom:.3125vw;line-height:1.14583333vw}._selectMusic_thw4j_1 .n-tabs-tab.n-tabs-tab--active{font-weight:600!important;color:#131415!important}._selectMusic_thw4j_1 .n-tabs-tab__label{z-index:10}._selectMusic_thw4j_1 .n-tabs-bar{height:.52083333vw;background:linear-gradient(90deg,#77BBFF 0%,rgba(163,231,255,.22) 100%);z-index:0;bottom:.10416667vw}._selectMusic_thw4j_1 .n-tab-pane{padding-top:0!important}._selectMusic_thw4j_1 ._close_thw4j_30{padding:0}._selectMusic_thw4j_1 ._close_thw4j_30 .n-icon{font-size:var(--n-close-size);color:var(--n-close-icon-color)}._listContainer_thw4j_37{margin-bottom:1.04166667vw;max-height:50vh;min-height:50vh}._listContainer_thw4j_37 ._listSection_thw4j_42{min-height:50vh}._listContainer_thw4j_37 ._emptySection_thw4j_45{display:flex;align-items:center}._list_thw4j_37{margin-top:.52083333vw;padding:0 2.08333333vw;margin-bottom:.625vw;display:flex;flex-flow:row wrap;justify-content:flex-start;gap:1.14583333vw}._searchGroup_thw4j_58{position:relative;padding:0 2.08333333vw}._searchGroup_thw4j_58 .n-form-item .n-form-item-label{font-size:.88541667rem;font-weight:600;color:#131415;line-height:1.25vw}._searchGroup_thw4j_58 .n-form-item .n-button{--n-padding: 0 .72916667vw !important;height:1.66666667vw;font-size:.88541667rem;border-radius:.41666667vw;color:rgba(0,0,0,.6)}._searchGroup_thw4j_58 .n-form-item .n-button--primary-type{color:#131415}._searchGroup_thw4j_58 .n-form-item-feedback-wrapper{min-height:.72916667vw}._inputSearch_thw4j_81{position:absolute;top:.20833333vw;right:2.08333333vw;width:18.75vw!important;height:2.1875vw!important;font-size:.83333333rem}._inputSearch_thw4j_81 .n-input-wrapper{padding-left:.625vw;padding-right:.20833333vw}._inputSearch_thw4j_81 .n-input__input-el{height:2.1875vw!important}._inputSearch_thw4j_81 ._searchBtn_thw4j_96{height:1.77083333vw;border-radius:.41666667vw;font-size:.78125rem;font-weight:500}._spaceSection_thw4j_102{width:69%;gap:.41666667vw .625vw!important;padding-right:1.82291667vw}._spaceSection_thw4j_102>div{line-height:var(--n-blank-height)}._collapseWrap_thw4j_110{width:98%;display:flex;flex-direction:row;align-items:flex-end}._collaoseBtn_thw4j_116{width:1.66666667vw;height:1.66666667vw;cursor:pointer}._collaoseBtn_thw4j_116._isStart_thw4j_121{transform:rotate(-180deg)}._collapsSection_thw4j_124{padding-top:.15625vw}._isHidden_thw4j_127{overflow:hidden;transition:1s all ease-in}._hideButton_thw4j_131{visibility:hidden;height:0!important;line-height:0!important}\n",document.head.appendChild(t);const W=d("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",[u("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 ")]),Q=Object.assign(Object.assign({},_.props),{size:{type:String,default:"medium"},bordered:{type:Boolean,default:void 0}}),X=p({name:"InputGroupLabel",props:Q,setup(e){const{mergedBorderedRef:t,mergedClsPrefixRef:a,inlineThemeDisabled:i}=h(e),s=_("Input","-input-group-label",W,f,e,a),r=g((()=>{const{size:t}=e,{common:{cubicBezierEaseInOut:a},self:{groupLabelColor:i,borderRadius:r,groupLabelTextColor:n,lineHeight:l,groupLabelBorder:o,[m("fontSize",t)]:c,[m("height",t)]:d}}=s.value;return{"--n-bezier":a,"--n-group-label-color":i,"--n-group-label-border":o,"--n-border-radius":r,"--n-group-label-text-color":n,"--n-font-size":c,"--n-line-height":l,"--n-height":d}})),n=i?b("input-group-label",g((()=>e.size[0])),r,e):void 0;return{mergedClsPrefix:a,mergedBordered:t,cssVars:i?void 0:r,themeClass:null==n?void 0:n.themeClass,onRender:null==n?void 0:n.onRender}},render(){var e,t,a;const{mergedClsPrefix:i}=this;return null===(e=this.onRender)||void 0===e||e.call(this),w("div",{class:[`${i}-input-group-label`,this.themeClass],style:this.cssVars},null===(a=(t=this.$slots).default)||void 0===a?void 0:a.call(t),this.mergedBordered?w("div",{class:`${i}-input-group-label__border`}):null)}}),Z="_trainSettings_htbat_1",ee="_trainBtnGroup_htbat_1",te="_searchGroup_htbat_9",ae="_datetime_htbat_13",ie="_trainList_htbat_43",se="_listSection_htbat_48",re="_emptySection_htbat_51",ne="_list_htbat_48",le="_trainEditModal_htbat_69",oe="_selectMusicModal_htbat_72",ce="_trainUpdate_my1j3_1",de="_updateBtnGroup_my1j3_4",ue="_switch_my1j3_12",pe="_active_my1j3_16",he="_scoreGroup_my1j3_30",_e=e("T",p({name:"train-update",props:{item:{type:Object,default:()=>({})},type:{type:String,default:"train"}},emits:["close","confirm"],setup(e,{emit:t}){const a=v(),r=y({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}),n=S();return j((()=>{const t=e.item;t.trainId?(r.id=t.trainId,r.minScore=t.practiceChapterBegin,r.maxScore=t.practiceChapterEnd,r.practiceSpeed=t.practiceSpeed,r.type=t.trainingType,"PRACTICE"===t.trainingType?r.practiceTimes=t.trainingTimes:r.evaluationScore=t.trainingTimes,r.difficulty=t.evaluateDifficult||"BEGINNER",r.evaluationSpeed=t.evaluateSpeed):(r.minScore=1,r.maxScore=t.practiceChapterMax?t.practiceChapterMax:1),r.baseMaxScore=t.practiceChapterMax||99,r.musicId=t.id,r.musicName=t.musicName,r.coursewareKnowledgeDetailId=t.coursewareKnowledgeDetailId,r.subjectId=t.subjectId,r.coverImg=t.coverImg})),()=>I("div",{class:ce},[I(C,{ref:n,model:r,labelAlign:"right",labelPlacement:"left"},{default:()=>[I(x,{label:"训练方式",path:"type",rule:[{required:!0,message:"请选择训练方式"}]},{default:()=>[I(T,null,{default:()=>[I(L,{secondary:!0,class:[ue,"PRACTICE"===r.type?pe:""],onClick:()=>r.type="PRACTICE"},{default:()=>[M("练习")]}),I(L,{secondary:!0,class:[ue,"EVALUATION"===r.type?pe:""],onClick:()=>r.type="EVALUATION"},{default:()=>[M("评测")]})]})]}),"PRACTICE"===r.type&&I(E,null,[I("div",{class:he},[I(x,{label:"练习小节",path:"minScore",rule:[{required:!0,message:"请输入最小练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[I(G,{value:r.minScore,"onUpdate:value":[e=>r.minScore=e,()=>{r.maxScore=null}],showButton:!1,min:1,max:r.baseMaxScore,placeholder:"最小练习小节",clearable:!0},null)]}),I("div",{style:{"--n-feedback-height":"24px",display:"flex",alignItems:"center",margin:"-2px 2% 0 2%",marginBottom:"var(--n-feedback-height)"}},[M("-")]),I(x,{path:"maxScore",rule:[{required:!0,message:"请输入最大练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[I(G,{value:r.maxScore,"onUpdate:value":e=>r.maxScore=e,showButton:!1,min:r.minScore||1,max:r.baseMaxScore,placeholder:"最大练习小节",clearable:!0},null)]})]),I(x,{label:"练习速度",path:"practiceSpeed",rule:[{required:!0,message:"请输入练习速度",trigger:["blur","change"],type:"number"}]},{default:()=>[I(G,{min:60,max:270,showButton:!1,style:{width:"100%"},value:r.practiceSpeed,"onUpdate:value":e=>r.practiceSpeed=e,placeholder:"练习速度范围60~270",clearable:!0},null)]}),I(x,{label:"练习时长",path:"practiceTimes",rule:[{required:!0,message:"请输入练习时长",trigger:["blur","change"],type:"number"}]},{default:()=>[I(B,null,{default:()=>[I(G,{min:0,showButton:!1,style:{width:"100%"},value:r.practiceTimes,"onUpdate:value":e=>r.practiceTimes=e,placeholder:"请输入练习时长",clearable:!0},null),I(X,null,{default:()=>[M("分钟")]})]})]})]),"EVALUATION"===r.type&&I(E,null,[I(x,{label:"评测难度",path:"type",rule:[{required:!0,message:"请选择评测难度"}]},{default:()=>[I(T,null,{default:()=>[I(L,{secondary:!0,class:[ue,"BEGINNER"===r.difficulty?pe:""],onClick:()=>r.difficulty="BEGINNER"},{default:()=>[M("入门级")]}),I(L,{secondary:!0,class:[ue,"ADVANCED"===r.difficulty?pe:""],onClick:()=>r.difficulty="ADVANCED"},{default:()=>[M("进阶级")]}),I(L,{secondary:!0,class:[ue,"PERFORMER"===r.difficulty?pe:""],onClick:()=>r.difficulty="PERFORMER"},{default:()=>[M("大师级")]})]})]}),I(x,{label:"合格分数",path:"evaluationScore",rule:[{required:!0,message:"请输入合格分数",trigger:["blur","change"],type:"number"}]},{default:()=>[I(B,null,{default:()=>[I(G,{min:0,showButton:!1,style:{width:"100%"},value:r.evaluationScore,"onUpdate:value":e=>r.evaluationScore=e,placeholder:"请输入合格分数",clearable:!0},null),I(X,null,{default:()=>[M("分")]})]})]})]),I(T,{class:de},{default:()=>[I(L,{strong:!0,type:"default",round:!0,onClick:()=>t("close")},{default:()=>[M("取消")]}),I(L,{strong:!0,type:"primary",round:!0,onClick:()=>(async()=>{n.value?.validate((async n=>{if(!n){r.uploading=!0;try{const n={trainingType:r.type,musicId:r.musicId,musicName:r.musicName,coursewareKnowledgeDetailId:r.coursewareKnowledgeDetailId,subjectId:r.subjectId,id:r.id,coverImg:r.coverImg,trainingConfigJson:""},l={};"PRACTICE"===r.type?(l.practiceChapterBegin=r.minScore,l.practiceChapterEnd=r.maxScore,l.practiceSpeed=r.practiceSpeed,l.trainingTimes=r.practiceTimes):(l.evaluateDifficult=r.difficulty,l.evaluateSpeed=r.evaluationSpeed,l.trainingTimes=r.evaluationScore),l.practiceChapterMax=r.baseMaxScore,n.trainingConfigJson=l,"train"===e.type&&(r.id?(await i(n),a.success("修改成功")):(await s(n),a.success("添加成功"))),t("close"),t("confirm",n)}catch{}r.uploading=!1}}))})()},{default:()=>[M("确认")]})]})]})])}})),ge={selectMusic:"_selectMusic_thw4j_1",close:"_close_thw4j_30",listContainer:"_listContainer_thw4j_37",listSection:"_listSection_thw4j_42",emptySection:"_emptySection_thw4j_45",list:"_list_thw4j_37",searchGroup:"_searchGroup_thw4j_58",inputSearch:"_inputSearch_thw4j_81",searchBtn:"_searchBtn_thw4j_96",spaceSection:"_spaceSection_thw4j_102",collapseWrap:"_collapseWrap_thw4j_110",collaoseBtn:"_collaoseBtn_thw4j_116",isStart:"_isStart_thw4j_121",collapsSection:"_collapsSection_thw4j_124",isHidden:"_isHidden_thw4j_127",hideButton:"_hideButton_thw4j_131"},me=p({name:"search-group",emits:["search","add"],setup(e,{emit:t}){const a=K(),i=y({name:"",musicSheetCategoriesId:null}),s=H((()=>{t("search",i)}),500),n=S(),l=S([]),o=S(0),c=S(0),d=S(0),u=S(!1),p=S(!1),h=e=>{e?.selfElRef&&l.value.push(e.selfElRef.parentNode)},_=()=>{try{l.value=[...new Set(l.value)];let e=-1;l.value.forEach(((t,a)=>{0===a?(d.value=1,e=t.offsetLeft):t.offsetLeft===e&&0!=a&&d.value++,u.value?t.style.display="block":d.value>1?t.style.display="none":t.style.display="block"})),p.value=!0}catch{}};return j((async()=>{await a.getMusicSheetCategory(),await a.getSubjects(),o.value=n.value?.offsetHeight,c.value=n.value?.offsetHeight/d.value,_()})),()=>I("div",{class:ge.searchGroup},[I(C,{labelAlign:"left",labelPlacement:"left"},{default:()=>[I("div",{class:ge.collapsSection},[I(x,{label:"教材:"},{default:()=>[I("div",{class:[ge.collapseWrap,p.value?"":ge.hideButton,u.value?"":ge.isHidden],ref:n},[I(T,{class:[ge.spaceSection]},{default:()=>[a.getAllMusicCategories.map((e=>I(L,{ref:h,secondary:i.musicSheetCategoriesId===e.id,quaternary:i.musicSheetCategoriesId!==e.id,strong:!0,focusable:!1,type:i.musicSheetCategoriesId===e.id?"primary":"default",onClick:()=>{i.musicSheetCategoriesId=e.id,s()}},{default:()=>[e.name]}))),d.value>1&&I("div",{style:{height:"var(--n-blank-height)",position:"absolute",display:"flex",alignItems:"center"},onClick:()=>{var e;e=!u.value,u.value=e,_()}},[I(R,{previewDisabled:!0,src:r,class:[ge.collaoseBtn,u.value?ge.isStart:""]},null)])]})])]})]),I(O,{class:ge.inputSearch,round:!0,onSearch:e=>{i.name=e,s()}},null)]})])}}),be=e("u",D("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(e){this.subjectId=e},setBaseCourseware(e){this.baseCourseware=e},setSelectKey(e){this.selectKey=e},setLessonCoursewareId(e){this.lessonCoursewareId=e},setLessonCoursewareDetailId(e){this.lessonCoursewareDetailId=e},setTreeList(e){this.treeList=e},setCoursewareList(e){this.coursewareList=e},setTrainList(e){this.trainList=e},setTabType(e){this.tabType=e},setSelectMusicStatus(e){this.selectMusicStatus=e},setSelectResourceStatus(e){this.selectResourceStatus=e},setIsAddResource(e){this.isAddResource=e},setIsAddTrain(e){this.isAddTrain=e},setIsEditResource(e){this.isEditResource=e},setIsEditTrain(e){this.iseditTrain=e},setSubjectList(e){this.subjectList=e},setClassGroupId(e){this.classGroupId=e}}})),we=e("S",p({name:"select-music",props:{type:{type:String,default:""}},emits:["add"],setup(e,{emit:t}){console.log(e.type);const a=be(),i=y({loading:!1,finshed:!1,pagination:{page:1,rows:20},searchGroup:{name:"",musicSheetCategoriesId:"",status:1,versionFlag:!1,subjectId:null},tableList:[],show:!1,item:{},isShowAddDisabled:!a.getIsEditTrain}),s=async()=>{try{1===i.pagination.page&&(i.loading=!0);const{data:e}=await l({...i.searchGroup,...i.pagination,subjectId:a.getSubjectId});i.loading=!1;const t=e.rows||[],s=[];t.forEach((e=>{s.push({id:e.id,coverImg:e.musicSvg,type:"MUSIC",title:e.musicSheetName,isCollect:!1,isSelected:!0,content:e.id,xmlFileUrl:e.xmlFileUrl})})),i.tableList.push(...s),i.finshed=e.pages<=e.current}catch{i.loading=!1}},r=V((e=>{i.pagination.page=1,i.tableList=[],i.searchGroup=Object.assign(i.searchGroup,e),s()}),500),o=H((()=>{i.pagination.page=i.pagination.page+1,s()}),500);return j((()=>{"homework"===e.type&&(i.isShowAddDisabled=!1),s()})),()=>I("div",{class:ge.selectMusic},[I(A,{animated:!0,defaultValue:"shareResources",paneClass:ge.paneTitle,justifyContent:"center",paneWrapperClass:ge.paneWrapperContainer},{default:()=>[I(k,{name:"shareResources",tab:"选择曲目"},{default:()=>[I(me,{onSearch:e=>r(e)},null),I(q,{class:ge.listContainer,onScroll:e=>{const t=e.target?.clientHeight,a=e.target?.scrollTop,s=e.target?.scrollHeight;t+a+20>=s&&!i.finshed&&!i.loading&&o()}},{default:()=>[I(z,{show:i.loading,size:"small"},{default:()=>[I("div",{class:[ge.listSection,!i.loading&&i.tableList.length<=0?ge.emptySection:""]},[i.tableList.length>0&&I("div",{class:ge.list},[i.tableList.map((e=>I(n,{isShowAdd:!0,isShowCollect:!1,item:e,onAdd:()=>t("add",e),disabledMouseHover:!1,onClick:()=>{"IMG"!==e.type&&(i.show=!0,i.item=e)}},null)))]),!i.loading&&i.tableList.length<=0&&I($,null,null)])]})]})]})]}),I(J,{show:i.show,"onUpdate:show":e=>i.show=e,item:i.item},null)])}}));e("a",p({name:"train-settings",props:{detailId:{type:String,default:""},subjectId:{type:String,default:""},classGroupId:{type:String,default:""}},emits:["close","confirm"],setup(e,{emit:t}){const i=v(),s=y({type:"add",btnLoading:!1,loadingStatus:!1,editStatus:!1,editItem:{},selectMusicStatus:!1,trainList:[],currentTime:U(U().format("YYYY-MM-DD")).valueOf(),expireDate:U().add(7,"day").format("YYYY-MM-DD")}),r=(e,t)=>{let a=[];return a="EVALUATION"===e?[`${Y[t.evaluateDifficult]}`,"全部小节",`${t.trainingTimes}分合格`]:[`${t.practiceChapterBegin}-${t.practiceChapterEnd}小节`,`速度${t.practiceSpeed}`,`${t.trainingTimes}分钟`],a},n=async()=>{if(s.expireDate)if(s.trainList.length<=0)i.error("训练内容不能为空");else{s.btnLoading=!0;try{const a=s.trainList||[],r=[];a.forEach((e=>{r.push({trainingType:e.trainingType,musicId:e.musicId,trainingConfigJsonObject:e.trainingConfigJson})}));const n={lessonTrainingDetails:r,expireDate:s.expireDate+" 23:59:59",classGroupId:e.classGroupId};await c(n),i.success("布置成功"),t("close"),t("confirm")}catch{}s.btnLoading=!1}else i.error("请选择截止日期")};return j((()=>{e.detailId&&e.subjectId&&(async()=>{s.loadingStatus=!0;try{const{data:t}=await o({coursewareKnowledgeDetailId:e.detailId,subjectId:e.subjectId,page:1,rows:99}),a=t.rows||[],i=[];a.forEach((e=>{const t=r(e.trainingType,e.trainingConfigJson);i.push({typeList:t||[],...e})})),s.trainList=i||[]}catch{}s.loadingStatus=!1})()})),()=>I("div",{class:Z},[I("div",{class:te},[I(L,{onClick:()=>{s.selectMusicStatus=!0,s.type="add"}},{default:()=>[M("添加作业")]}),I("div",{class:ae},[I("label",null,[M("截止时间:")]),I(N,{style:{width:"200px"},placeholder:"请选择截止日期","formatted-value":s.expireDate,"onUpdate:formatted-value":e=>s.expireDate=e,type:"date",valueFormat:"yyyy-MM-dd",isDateDisabled:e=>e<s.currentTime},null)])]),I(q,{class:ie},{default:()=>[I(z,{show:s.loadingStatus},{default:()=>[I("div",{class:[se,!s.loadingStatus&&s.trainList.length<=0?re:""]},[s.trainList.length>0&&I("div",{class:ne},[s.trainList.map(((e,t)=>I(a,{item:e,type:"homework",onEdit:e=>{const{trainingConfigJson:t,id:a,musicId:i,...r}=e;s.editItem={...r,id:i,trainId:a,...t},console.log(s.editItem),s.type="update",s.editStatus=!0},onDelete:()=>{s.trainList.splice(t,1)}},null)))]),!s.loadingStatus&&s.trainList.length<=0&&I($,{description:"暂无作业"},null)])]})]}),I(T,{class:ee},{default:()=>[I(L,{strong:!0,type:"default",round:!0,onClick:()=>t("close")},{default:()=>[M("取消布置")]}),I(L,{strong:!0,type:"primary",round:!0,disabled:s.trainList.length<=0,onClick:n},{default:()=>[M("立即布置")]})]}),I(F,{show:s.editStatus,"onUpdate:show":e=>s.editStatus=e,class:["modalTitle background",le],preset:"card",title:"作业设置"},{default:()=>[I(_e,{item:s.editItem,type:"homework",onClose:()=>s.editStatus=!1,onConfirm:e=>{console.log(e,"update",s);const t=r(e.trainingType,e.trainingConfigJson);"update"===s.type?s.trainList.forEach((a=>{a.id===e.id&&(a.trainingType=e.trainingType,a.trainingConfigJson=e.trainingConfigJson,a.typeList=t)})):s.trainList.push({...e,id:+new Date,musicName:s.editItem.title,typeList:t}),s.editItem={}}},null)]}),I(F,{show:s.selectMusicStatus,"onUpdate:show":e=>s.selectMusicStatus=e,class:["modalTitle",oe],preset:"card",title:"选择曲目"},{default:()=>[I(we,{type:"homework",onAdd:t=>{s.selectMusicStatus=!1,(async t=>{let a="init",i=null;try{const e=await P.get(t.xmlFileUrl,{mode:"cors"}),s=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("part");i=s[0]?.getElementsByTagName("measure"),a="success"}catch(r){a="error"}t.practiceChapterMax="success"==a?i.length:0,t.coursewareKnowledgeDetailId=e.detailId,t.subjectId=e.subjectId,s.editItem=t,s.editStatus=!0})(t)}},null)]})])}}))}}}));