index-legacy-1d85f51f.js 15 KB

1
  1. System.register(["./index.module-legacy-18bec45e.js","./index-legacy-0020b5f7.js","./index-legacy-b60f1b90.js","./index-legacy-23c5a113.js","./api-legacy-8c504e0c.js","./index-legacy-b924748a.js","./Scrollbar-legacy-fbd5b649.js","./api-legacy-6925c164.js","./index-legacy-7b01b2b8.js","./contants-legacy-0f3fe700.js","./add-legacy-e7111c9d.js","./searchs-legacy-3b019a5a.js"],(function(e,a){"use strict";var l,t,s,u,n,o,i,c,r,d,p,v,g,h,m,y,f,b,w,C,k,A,L,x,j,I,R,U,G,E,T,B,S,V,N,F,O,W,q,D,M,P,Y,K,Q;return{setters:[e=>{l=e.s},e=>{t=e.S},e=>{s=e.C},e=>{u=e.P},e=>{n=e.b,o=e.c,i=e.g,c=e.d,r=e.a,d=e.e},e=>{p=e.d,v=e.e,g=e.b,h=e.r,m=e.f,y=e.N,f=e.g,b=e.Z,w=e.W,C=e.j,k=e.k,A=e.Q,L=e.q,x=e.cj,j=e.l,I=e.ck,R=e.cl,U=e.o,G=e.aX,E=e.u,T=e.V,B=e.ca,S=e.F,V=e.ci,N=e.A},e=>{F=e.N},e=>{O=e.u,W=e.q,q=e.c,D=e.l,M=e.b},e=>{P=e.u},e=>{Y=e.g,K=e.c},e=>{Q=e.a},null],execute:function(){const a=p({props:{activeRow:{type:Object,default:()=>({id:""})},gradeNumList:{type:Array,default:()=>[]},classArray:{type:Array,default:()=>[]}},name:"resetStudent",emits:["close","getList"],setup(e,{emit:a}){const t=v({uploading:!1}),u=g(),o=h(),i=v({currentGradeNum:null,currentClass:null});return()=>m("div",{class:[l.addClass]},[m(y,{"label-placement":"left",model:i,ref:o},{default:()=>[m(f,{path:"currentGradeNum",rule:[{required:!0,message:"请选择年级"}]},{default:()=>[m(s,b({style:{width:"400px"},options:e.gradeNumList,placeholder:"选择年级",clearable:!0},{value:i.currentGradeNum,"onUpdate:value":e=>i.currentGradeNum=e}),null)]}),m(f,{path:"currentClass",rule:[{required:!0,message:"请选择班级"}]},{default:()=>[m(s,b({style:{width:"400px"},options:e.classArray,placeholder:"选择班级",clearable:!0},{value:i.currentClass,"onUpdate:value":e=>i.currentClass=e}),null)]})]}),m(w,{class:l.btnGroup,justify:"center"},{default:()=>[m(C,{round:!0,onClick:()=>a("close")},{default:()=>[k("取消")]}),m(C,{round:!0,loading:t.uploading,onClick:()=>{o.value.validate((async e=>{if(console.log(i),console.log(e),!e)try{await n({...i}),u.success("新增成功"),a("close"),a("getList")}catch(l){console.log(l)}}))},type:"primary"},{default:()=>[k("保存")]})]})])}});function Z(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!G(e)}const z=p({props:{activeRow:{type:Object,default:()=>({id:""})}},name:"RestStudentBox",emits:["close","getList"],setup(e,{emit:a}){const s=g(),u=v({uploading:!1});h([]),h([]),h();const n=h([]);console.log(e.activeRow,"activeRow");const r=v({name:"",id:""}),d=h([]),p=h([]),y=h(null),f=h([]),G=h([]),E=h(null),T=h([]),B=async e=>await i({page:1,rows:999,classGroupId:e}),S=A((()=>(p.value||[]).filter((e=>-1!=e.label.indexOf(y.value||""))))),V=A((()=>(G.value||[]).filter((e=>-1!=e.label.indexOf(E.value||"")))));return L((async()=>{(async()=>{try{const a=await o({page:1,rows:9999});n.value=a.data.rows.map((a=>({label:a.name,key:a.id,disabled:a.id==e.activeRow.id}))),n.value[0].disabled?(r.name=n.value[1].label,r.id=n.value[1].key):(r.name=n.value[0].label,r.id=n.value[0].key);const l=await B(r.id);G.value=l.data.rows.map((e=>({label:e.nickname+"("+e.id+")",value:e.id})))}catch(a){console.log(a)}})();const a=await B(e.activeRow.id);p.value=a.data.rows.map((e=>({label:e.nickname+"("+e.id+")",value:e.id})))})),()=>{let o,i;return m("div",{class:[l.container,l.resetStudentWrap]},[m("div",{class:l.studentTransfer},[m("div",{class:l.studentTransferList},[m("div",{class:l.studentLeft},[m("div",{class:l.listTop},[m("p",null,[e.activeRow.name]),m("span",null,[k("(当前班级)")])]),m("div",{class:l.listCore},[m(x,{class:l.chioseCheckAllBox},{default:()=>[m(j,{onUpdateChecked:e=>{S.value.length===d.value.length?d.value=[]:d.value=S.value.map((e=>e.value))},checked:S.value.length===d.value.length,indeterminate:d.value.length>0&&S.value.length!==d.value.length,label:"全选"},null)]}),m(x,null,{default:()=>[m(t,b({placeholder:"请输入学生姓名"},{class:l.searchInput,searchWord:y.value,onChangeValue:e=>y.value=e}),null)]}),m(F,{style:"max-height: 204px;min-height: 204px;margin-top:14px;"},{default:()=>[m(I,{value:d.value,"onUpdate:value":e=>d.value=e},Z(o=S.value.map((e=>m(x,{class:l.chioseCheckBox},{default:()=>[m(j,{value:e.value,label:e.label},null)]}))))?o:{default:()=>[o]})]})]),m("div",{class:[l.bottomLeft,l.bottom]},[m("div",{class:l.bottomWrap},[k("共"),p.value.length,k("名学生")])])]),m("div",{class:l.chioseBox},[m("div",{class:[l.chioseBtn,l.chioseBtnRight],onClick:()=>(()=>{const e=p.value.filter((e=>-1!=d.value.indexOf(e.value)));if(e.length>0){const a=e.map((e=>({...e,studentId:e.value,toClassId:r.id})));T.value=T.value.filter((e=>!a.some((a=>a.value===e.value)))),T.value=T.value.concat(a)}p.value=p.value.filter((a=>!e.some((e=>e.value===a.value)))),e.forEach((e=>{G.value.push(e)})),d.value=[]})()},null),m("div",{class:l.chioseBtn,onClick:()=>(()=>{const a=G.value.filter((e=>-1!=f.value.indexOf(e.value)));if(a.length>0){const l=a.map((a=>({...a,studentId:a.value,toClassId:e.activeRow.id})));T.value=T.value.filter((e=>!l.some((a=>a.value===e.value)))),T.value=T.value.concat(l)}G.value=G.value.filter((e=>!a.some((a=>a.value===e.value)))),a.forEach((e=>{p.value.push(e)})),f.value=[],console.log(T.value," submitList.value===>")})()},null)]),m("div",{class:l.studentRight},[m("div",{class:l.listTop},[r.id?m(R,{key:"111",value:r.id,"onUpdate:value":e=>r.id=e,options:n.value,onSelect:e=>{(async e=>{n.value.forEach((a=>{a.key==e&&(r.name=a.label,r.id=a.key)}));const a=await B(e);G.value=a.data.rows.map((e=>({label:e.nickname+"("+e.id+")",value:e.id}))),console.log(T.value,"submitList.value"),G.value=G.value.filter((e=>!T.value.some((a=>a.value===e.value)))),T.value.forEach((e=>{e.toClassId==r.id&&(console.log(e.toClassId,e),G.value.push({label:e.label,value:e.value}))}))})(e)},scrollable:!0},{default:()=>[m("div",null,[r.name,m(U,{class:l.smallArrow,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAATRJREFUSEtjZKAxYKSx+QyjFhAM4dEgGiRBZGxszPr+/Xuue/fufSToJAIKJCQkRF+8ePEapoxRWlpa+Oev31cYGBj4/zP8L337+vVUciwRFxfn/vvv36r//xm8GJkYZ7959SoNZA6jsLi4E8Pff3thhjIxMuW/fv1yEimWQA3f9v8/gx1U35O3b17Lgi1oaGhgmjJ12sH////bkGMJFsMZGBkY09+8eTULbAGIEBUV5fnPwLidVEuwG85U9ObNy354HMAYpFpCjOFwH5BqCbGGY1hATHCRYjhWC/BZwsTEMPfvv3/IqYWBkQE1zNFTH87CDlucMDIy3Pn/n0EFEYH4DcfpA3xxQorhBC2ABdc/BsbdDP//W5BqOFEWIOKE4cK/fwzyjEyMM9++fpVDbE4f+hUOAC9/xhn8Z6OyAAAAAElFTkSuQmCC",previewDisabled:!0},null)])]}):null]),m("div",{class:l.listCore},[m(x,{class:l.chioseCheckAllBox},{default:()=>[m(j,{onUpdateChecked:e=>{V.value.length===f.value.length?f.value=[]:f.value=V.value.map((e=>e.value))},checked:V.value.length===f.value.length,indeterminate:f.value.length>0&&V.value.length!==f.value.length,label:"全选"},null)]}),m(x,null,{default:()=>[m(t,b({placeholder:"请输入学生姓名"},{class:l.searchInput,searchWord:E.value,onChangeValue:e=>E.value=e}),null)]}),m(F,{style:"max-height: 204px;min-height: 204px;margin-top:14px;"},{default:()=>[m(I,{value:f.value,"onUpdate:value":e=>f.value=e},Z(i=V.value.map((e=>m(x,{class:l.chioseCheckBox},{default:()=>[m(j,{value:e.value,label:e.label},null)]}))))?i:{default:()=>[i]})]})]),m("div",{class:[l.bottomRight,l.bottom]},[m("div",{class:l.bottomWrap},[k("共"),G.value.length,k("名学生")])])])])]),m(w,{class:l.btnGroup,justify:"center"},{default:()=>[m(C,{round:!0,onClick:()=>a("close")},{default:()=>[k("取消")]}),m(C,{round:!0,loading:u.uploading,type:"primary",onClick:()=>{(async()=>{if(n.value.length<2)s.error("当前只有一个班级,无法调整");else if(T.value<1)a("close");else try{await c(T.value),a("close"),a("getList")}catch(e){console.log(e)}})()}},{default:()=>[k("保存")]})]})])}}}),H=p({name:"train-update",emits:["close"],props:{activeRow:{type:Object,default:()=>({id:"",currentGradeNum:""})}},setup(e,{emit:a}){const t=v({bookVersionId:null,classGroupId:null,category:null,chapter:null,subjectId:null,musicTagList:[],loading:!1,list:[],chapterList:[],unit:null,unitList:[],subjectList:[]}),s=E(),u=O(),n=g(),o=h(),i=P((()=>c()),500),c=async()=>{if(t.category=null,t.unit=null,t.category=null,t.chapter=null,t.loading=!0,t.bookVersionId)try{const{data:e}=await D({page:1,rows:99,type:"COURSEWARE",enableFlag:1,bookVersionId:t.bookVersionId});t.list=e.rows.map((e=>({label:e.name,value:e.id})))}catch{}else t.list=[];t.loading=!1};return L((async()=>{await u.getSubjects(),t.subjectList=u.getSubjectList.map((e=>({label:e.name,value:e.id}))),(async()=>{t.unit=null,t.chapter=null;try{const{data:e}=await M({page:1,rows:99,type:"COURSEWARE"});(e.rows||[]).forEach((e=>{t.musicTagList.push({id:e.id,name:e.name})}))}catch{}})()})),()=>m("div",{class:l.trainUpdate},[m(y,{labelAlign:"left",labelPlacement:"left",ref:o,model:t},{default:()=>[m(f,{path:"bookVersionId",rule:[{required:!0,message:"选择教材版本"}]},{default:()=>[m(T,{placeholder:"选择教材版本",clearable:!0,options:[...t.musicTagList],labelField:"name",valueField:"id",value:t.bookVersionId,"onUpdate:value":[e=>t.bookVersionId=e,()=>i()]},null)]}),m(f,{path:"category",rule:[{required:!0,message:"请选择册别"}]},{default:()=>[m(T,b({options:[...t.list],placeholder:"选择册别",clearable:!0},{disabled:!t.bookVersionId,value:t.category,"onUpdate:value":[e=>t.category=e,()=>(async()=>{t.unit=null,t.chapter=null;try{if(t.category){const e=await r(t.category);t.unitList=e.data.lessonList.map((e=>({...e,label:e.name,value:e.id})))}else t.unitList=[]}catch(e){console.log(e)}})()]}),null)]}),m(f,{path:"unit",rule:[{required:!0,message:"请选择单元"}]},{default:()=>[m(T,b({disabled:!t.category},{options:[...t.unitList],placeholder:"选择单元",clearable:!0},{value:t.unit,"onUpdate:value":[e=>t.unit=e,()=>(()=>{if(t.chapter=null,t.unit){const e=t.unitList.find((e=>e.id===t.unit));t.chapterList=e.knowledgeList.map((e=>({...e,label:e.name,value:e.id}))),console.log("getchapterList",e)}else t.chapterList=[];console.log("getchapterList")})()]}),null)]}),m(f,{path:"chapter",rule:[{required:!0,message:"请选择章节"}]},{default:()=>[m(T,b({disabled:!t.unit},{options:[...t.chapterList],placeholder:"选择章节",clearable:!0},{value:t.chapter,"onUpdate:value":e=>t.chapter=e}),null)]}),m(f,{path:"subjectId",rule:[{required:!0,message:"请选择乐器"}]},{default:()=>[m(T,b({options:[...t.subjectList],placeholder:"选择乐器",clearable:!0},{value:t.subjectId,"onUpdate:value":e=>t.subjectId=e}),null)]}),m(w,{class:l.updateBtnGroup},{default:()=>[m(C,{strong:!0,type:"default",round:!0,onClick:()=>a("close")},{default:()=>[k("取消")]}),m(C,{strong:!0,type:"primary",round:!0,onClick:()=>{o.value.validate((async l=>{if(l)return;const{data:u}=await W({coursewareDetailKnowledgeId:t.chapter,subjectId:t.subjectId,page:1,rows:99});if(console.log(e.activeRow.id,"props.activeRow.id"),await q({lessonCoursewareKnowledgeDetailId:t.chapter,classGroupId:e.activeRow.id}),u.rows&&u.rows.length>0){const{href:l}=s.resolve({path:"/attend-class",query:{type:"class",classGroupId:e.activeRow.id,subjectId:t.subjectId,detailId:t.chapter}});a("close"),window.open(l,+new Date+"")}else n.error("当前章节暂无课件,请重新选择")}))}},{default:()=>[k("确认")]})]})]})])}});e("default",p({name:"class-classList",setup(e,{emit:n}){const i=v({searchForm:{keyword:null,currentClass:null,currentGradeNum:null},orchestraType:null,courseTypeCode:null,loading:!1,pagination:{page:1,rows:10,pageTotal:6},gradeNumList:[],tableList:[],studentVisible:!1,activeRow:null,showaddClass:!1,goCourseVisiable:!1}),c=h(),r=B(),p=g(),A=E(),x=()=>{i.pagination.page=1,I(),console.log("search",i)};i.gradeNumList=Y();const j=()=>{i.searchForm={keyword:null,currentClass:null,currentGradeNum:null},I()},I=async()=>{i.loading=!0;try{const e=await o({...i.searchForm,...i.pagination});i.tableList=e.data.rows,i.pagination.pageTotal=e.data.total,i.loading=!1}catch(e){i.loading=!1,console.log(e)}console.log("getList")},R=()=>[{title:"班级名称",key:"name"},{title:"学生人数",key:"preStudentNum"},{title:"上次学习",key:"lastStudy",render:e=>m("p",null,[e.lastStudy?e.lastStudy:"--"])},{title:"操作",key:"id",render:e=>m("div",null,[m(w,null,{default:()=>[m(C,{type:"primary",text:!0,onClick:()=>{A.push({path:"/classDetail",query:{name:e.name,id:e.id}})}},{default:()=>[k("详情")]}),m(C,{type:"primary",text:!0,onClick:()=>{G(e)}},{default:()=>[k("学生调整")]}),m(C,{disabled:!(e.preStudentNum>0),type:"primary",text:!0,onClick:()=>T(e)},{default:()=>[k("开始上课")]}),e.preStudentNum>0?null:m("p",{style:{color:"#EA4132",cursor:"pointer"},onClick:()=>(async e=>{r.warning({title:"警告",content:`是否删除班级“${e.name}”?`,positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{try{await d({ids:e.id}),I(),p.success("删除成功")}catch(a){console.log(a)}}})})(e)},[k("删除")])]})])}],G=e=>{i.activeRow=e,i.studentVisible=!0},T=e=>{i.activeRow=e,i.goCourseVisiable=!0};return L((()=>{I()})),()=>m("div",{class:l.listWrap},[m("div",{class:l.searchList},[m(y,{"label-placement":"left",inline:!0,ref:c},{default:()=>[m(f,null,{default:()=>[m(t,b({placeholder:"请输入班级名称"},{class:l.searchInput,searchWord:i.searchForm.keyword,onChangeValue:e=>i.searchForm.keyword=e}),null)]}),m(f,null,{default:()=>[m(s,b({options:i.gradeNumList,placeholder:"选择年级",clearable:!0,inline:!0},{value:i.searchForm.currentGradeNum,"onUpdate:value":e=>i.searchForm.currentGradeNum=e}),null)]}),m(f,null,{default:()=>[m(s,b({options:K,placeholder:"选择班级",clearable:!0,inline:!0},{value:i.searchForm.currentClass,"onUpdate:value":e=>i.searchForm.currentClass=e}),null)]}),m(f,null,{default:()=>[m(w,{justify:"end"},{default:()=>[m(C,{type:"primary",class:"searchBtn",onClick:x},{default:()=>[k("搜索")]}),m(C,{type:"primary",ghost:!0,class:"resetBtn",onClick:j},{default:()=>[k("重置")]})]})]})]})]),m(C,{class:l.addBtn,type:"primary",onClick:()=>i.showaddClass=!0},{default:()=>[k("创建班级")],icon:()=>m(S,null,[m(U,{class:l.addBtnIcon,previewDisabled:!0,src:Q},null)])}),m("div",{class:l.tableWrap},[m(V,{class:l.classTable,loading:i.loading,columns:R(),data:i.tableList},null),m(u,{page:i.pagination.page,"onUpdate:page":e=>i.pagination.page=e,pageSize:i.pagination.rows,"onUpdate:pageSize":e=>i.pagination.rows=e,pageTotal:i.pagination.pageTotal,"onUpdate:pageTotal":e=>i.pagination.pageTotal=e,onList:I,sync:!0,saveKey:"orchestraRegistration-key"},null)]),m(N,{show:i.studentVisible,"onUpdate:show":e=>i.studentVisible=e,style:{width:"707px"},preset:"card",class:["modalTitle background"],title:"学员调整"},{default:()=>[m(z,{activeRow:i.activeRow,onClose:()=>i.studentVisible=!1,onGetList:()=>I()},null)]}),m(N,{show:i.showaddClass,"onUpdate:show":e=>i.showaddClass=e,style:{width:"500px"},preset:"card",class:["modalTitle background"],title:"创建班级"},{default:()=>[m(a,{gradeNumList:i.gradeNumList,classArray:K,onGetList:()=>I(),onClose:()=>i.showaddClass=!1},null)]}),m(N,{show:i.goCourseVisiable,"onUpdate:show":e=>i.goCourseVisiable=e,preset:"card",class:["modalTitle background",l.chioseModel],title:"选择课件"},{default:()=>[m(H,{activeRow:i.activeRow,onClose:()=>i.goCourseVisiable=!1},null)]})])}}))}}}));