index-legacy-c395b4d9-1694078809672.js 23 KB

1
  1. System.register(["./index-legacy-a9b7951a-1694078809672.js","./isCollaose-legacy-ef637d9f-1694078809672.js","./index-legacy-da1c415f-1694078809672.js","./index-legacy-69441be7-1694078809672.js","./catchData-legacy-1c3de09a-1694078809672.js","./index-legacy-c82e2503-1694078809672.js","./index-legacy-29bcc766-1694078809672.js","./contants-legacy-4ea2bc50-1694078809672.js"],(function(e,t){"use strict";var a,i,s,n,r,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,D,R,A,k,z,U,N,F,P,O,K,H,V,$,q,J,Y,W=document.createElement("style");return W.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(W),{setters:[e=>{a=e.T},e=>{i=e.v,s=e.w,n=e.j,r=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,D=e.t,R=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(){const t=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 ")]),W=Object.assign(Object.assign({},_.props),{size:{type:String,default:"medium"},bordered:{type:Boolean,default:void 0}}),Q=p({name:"InputGroupLabel",props:W,setup(e){const{mergedBorderedRef:a,mergedClsPrefixRef:i,inlineThemeDisabled:s}=h(e),n=_("Input","-input-group-label",t,f,e,i),r=g((()=>{const{size:t}=e,{common:{cubicBezierEaseInOut:a},self:{groupLabelColor:i,borderRadius:s,groupLabelTextColor:r,lineHeight:l,groupLabelBorder:o,[m("fontSize",t)]:c,[m("height",t)]:d}}=n.value;return{"--n-bezier":a,"--n-group-label-color":i,"--n-group-label-border":o,"--n-border-radius":s,"--n-group-label-text-color":r,"--n-font-size":c,"--n-line-height":l,"--n-height":d}})),l=s?b("input-group-label",g((()=>e.size[0])),r,e):void 0;return{mergedClsPrefix:i,mergedBordered:a,cssVars:s?void 0:r,themeClass:null==l?void 0:l.themeClass,onRender:null==l?void 0:l.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)}}),X="_trainSettings_htbat_1",Z="_trainBtnGroup_htbat_1",ee="_searchGroup_htbat_9",te="_datetime_htbat_13",ae="_trainList_htbat_43",ie="_listSection_htbat_48",se="_emptySection_htbat_51",ne="_list_htbat_48",re="_trainEditModal_htbat_69",le="_selectMusicModal_htbat_72",oe="_trainUpdate_my1j3_1",ce="_updateBtnGroup_my1j3_4",de="_switch_my1j3_12",ue="_active_my1j3_16",pe="_scoreGroup_my1j3_30",he=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(),n=y({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}),r=S();return j((()=>{const t=e.item;t.trainId?(n.id=t.trainId,n.minScore=t.practiceChapterBegin,n.maxScore=t.practiceChapterEnd,n.practiceSpeed=t.practiceSpeed,n.type=t.trainingType,"PRACTICE"===t.trainingType?n.practiceTimes=t.trainingTimes:n.evaluationScore=t.trainingTimes,n.difficulty=t.evaluateDifficult||"BEGINNER",n.evaluationSpeed=t.evaluateSpeed):(n.minScore=1,n.maxScore=t.practiceChapterMax?t.practiceChapterMax:1),n.baseMaxScore=t.practiceChapterMax||99,n.musicId=t.id,n.coursewareKnowledgeDetailId=t.coursewareKnowledgeDetailId,n.subjectId=t.subjectId,n.coverImg=t.coverImg})),()=>I("div",{class:oe},[I(C,{ref:r,model:n,labelAlign:"right",labelPlacement:"left"},{default:()=>[I(x,{label:"训练方式",path:"type",rule:[{required:!0,message:"请选择训练方式"}]},{default:()=>[I(T,null,{default:()=>[I(L,{secondary:!0,class:[de,"PRACTICE"===n.type?ue:""],onClick:()=>n.type="PRACTICE"},{default:()=>[M("练习")]}),I(L,{secondary:!0,class:[de,"EVALUATION"===n.type?ue:""],onClick:()=>n.type="EVALUATION"},{default:()=>[M("评测")]})]})]}),"PRACTICE"===n.type&&I(E,null,[I("div",{class:pe},[I(x,{label:"练习小节",path:"minScore",rule:[{required:!0,message:"请输入最小练习小节",trigger:["blur","change"],type:"number"}]},{default:()=>[I(G,{value:n.minScore,"onUpdate:value":[e=>n.minScore=e,()=>{n.maxScore=null}],showButton:!1,min:1,max:n.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:n.maxScore,"onUpdate:value":e=>n.maxScore=e,showButton:!1,min:n.minScore||1,max:n.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:n.practiceSpeed,"onUpdate:value":e=>n.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:n.practiceTimes,"onUpdate:value":e=>n.practiceTimes=e,placeholder:"请输入练习时长",clearable:!0},null),I(Q,null,{default:()=>[M("分钟")]})]})]})]),"EVALUATION"===n.type&&I(E,null,[I(x,{label:"评测难度",path:"type",rule:[{required:!0,message:"请选择评测难度"}]},{default:()=>[I(T,null,{default:()=>[I(L,{secondary:!0,class:[de,"BEGINNER"===n.difficulty?ue:""],onClick:()=>n.difficulty="BEGINNER"},{default:()=>[M("入门级")]}),I(L,{secondary:!0,class:[de,"ADVANCED"===n.difficulty?ue:""],onClick:()=>n.difficulty="ADVANCED"},{default:()=>[M("进阶级")]}),I(L,{secondary:!0,class:[de,"PERFORMER"===n.difficulty?ue:""],onClick:()=>n.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:n.evaluationScore,"onUpdate:value":e=>n.evaluationScore=e,placeholder:"请输入合格分数",clearable:!0},null),I(Q,null,{default:()=>[M("分")]})]})]})]),I(T,{class:ce},{default:()=>[I(L,{strong:!0,type:"default",round:!0,onClick:()=>t("close")},{default:()=>[M("取消")]}),I(L,{strong:!0,type:"primary",round:!0,onClick:()=>(async()=>{r.value?.validate((async r=>{if(!r){n.uploading=!0;try{const r={trainingType:n.type,musicId:n.musicId,coursewareKnowledgeDetailId:n.coursewareKnowledgeDetailId,subjectId:n.subjectId,id:n.id,coverImg:n.coverImg,trainingConfigJson:""},l={};"PRACTICE"===n.type?(l.practiceChapterBegin=n.minScore,l.practiceChapterEnd=n.maxScore,l.practiceSpeed=n.practiceSpeed,l.trainingTimes=n.practiceTimes):(l.evaluateDifficult=n.difficulty,l.evaluateSpeed=n.evaluationSpeed,l.trainingTimes=n.evaluationScore),l.practiceChapterMax=n.baseMaxScore,r.trainingConfigJson=l,"train"===e.type&&(n.id?(await i(r),a.success("修改成功")):(await s(r),a.success("添加成功"))),t("close"),t("confirm",r)}catch{}n.uploading=!1}}))})()},{default:()=>[M("确认")]})]})]})])}})),_e={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"},ge=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),r=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=r.value.offsetHeight,c.value=r.value.offsetHeight/d.value,_()})),()=>I("div",{class:_e.searchGroup},[I(C,{labelAlign:"left",labelPlacement:"left"},{default:()=>[I("div",{class:_e.collapsSection},[I(x,{label:"教材:"},{default:()=>[I("div",{class:[_e.collapseWrap,p.value?"":_e.hideButton,u.value?"":_e.isHidden],ref:r},[I(T,{class:[_e.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(D,{previewDisabled:!0,src:n,class:[_e.collaoseBtn,u.value?_e.isStart:""]},null)])]})])]})]),I(O,{class:_e.inputSearch,round:!0,onSearch:e=>{i.name=e,s()}},null)]})])}}),me=e("u",R("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}}})),be=e("S",p({name:"select-music",props:{type:{type:String,default:""}},emits:["add"],setup(e,{emit:t}){console.log(e.type);const a=me(),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}},n=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:_e.selectMusic},[I(A,{animated:!0,defaultValue:"shareResources",paneClass:_e.paneTitle,justifyContent:"center",paneWrapperClass:_e.paneWrapperContainer},{default:()=>[I(k,{name:"shareResources",tab:"选择曲目"},{default:()=>[I(ge,{onSearch:e=>n(e)},null),I(q,{class:_e.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:[_e.listSection,!i.loading&&i.tableList.length<=0?_e.emptySection:""]},[i.tableList.length>0&&I("div",{class:_e.list},[i.tableList.map((e=>I(r,{isShowAdd:!0,isShowCollect:!1,item:e,isShowAddDisabled:i.isShowAddDisabled,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")}),n=(e,t)=>{let a=[];return a="EVALUATION"===e?[`${Y[t.evaluateDifficult]}`,"全部小节",`${t.trainingTimes}分合格`]:[`${t.practiceChapterBegin}-${t.practiceChapterEnd}小节`,`速度${t.practiceSpeed}`,`${t.trainingTimes}分钟`],a},r=async()=>{if(s.expireDate)if(s.trainList.length<=0)i.error("训练内容不能为空");else{s.btnLoading=!0;try{const a=s.trainList||[],n=[];a.forEach((e=>{n.push({trainingType:e.trainingType,musicId:e.musicId,trainingConfigJsonObject:e.trainingConfigJson})}));const r={lessonTrainingDetails:n,expireDate:s.expireDate+" 23:59:59",classGroupId:e.classGroupId};await c(r),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=n(e.trainingType,e.trainingConfigJson);i.push({typeList:t||[],...e})})),s.trainList=i||[]}catch{}s.loadingStatus=!1})()})),()=>I("div",{class:X},[I("div",{class:ee},[I(L,{onClick:()=>{s.selectMusicStatus=!0,s.type="add"}},{default:()=>[M("添加作业")]}),I("div",{class:te},[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:ae},{default:()=>[I(z,{show:s.loadingStatus},{default:()=>[I("div",{class:[ie,!s.loadingStatus&&s.trainList.length<=0?se:""]},[s.trainList.length>0&&I("div",{class:ne},[s.trainList.map((e=>I(a,{item:e,type:"homework",onEdit:e=>{const{trainingConfigJson:t,id:a,musicId:i,...n}=e;s.editItem={...n,id:i,trainId:a,...t},console.log(s.editItem),s.type="update",s.editStatus=!0},onDelete:()=>{const t=s.trainList.findIndex((t=>t.id===e.id));s.trainList.splice(t,1)}},null)))]),!s.loadingStatus&&s.trainList.length<=0&&I($,{description:"暂无作业"},null)])]})]}),I(T,{class:Z},{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:r},{default:()=>[M("立即布置")]})]}),I(F,{show:s.editStatus,"onUpdate:show":e=>s.editStatus=e,class:["modalTitle background",re],preset:"card",title:"作业设置"},{default:()=>[I(he,{item:s.editItem,type:"homework",onClose:()=>s.editStatus=!1,onConfirm:e=>{console.log(e,"update",s);const t=n(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",le],preset:"card",title:"选择曲目"},{default:()=>[I(be,{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(n){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)]})])}}))}}}));