1 |
- import{d as U,e as Y,b as z,r as y,y as ie,p as O,f as t,N as K,g as B,x,w as j,j as v,k as n,S as Q,aF as D,m as M,ax as Z,aG as de,v as le,B as ce,$ as b,A as _,R as pe,W as se,X as ue,F as q,T as ge,c as me,u as he,a as ve,aE as fe,l as T}from"./index-e9eb06c1-1714059328110.js";import{s as u}from"./index.module-2dcd19b9-1714059328110.js";import{S as J}from"./index-cbbbf616-1714059328110.js";import{C as I}from"./index-34f50227-1714059328110.js";import{P as ye}from"./index-a3f57777-1714059328110.js";import{a as be,g as re,c as ne,b as Ce,d as we,u as Fe,e as Se,f as Le}from"./api-144130e5-1714059328110.js";import{a as Ae}from"./api-cc34a933-1714059328110.js";import{N as H}from"./Scrollbar-6abf08b7-1714059328110.js";import{g as xe,c as X}from"./contants-0ef451a7-1714059328110.js";import{a as ke}from"./add-efe8238e-1714059328110.js";import{g as $,s as N,a as Re,b as ee}from"./api-9238c0df-1714059328110.js";import{T as Be}from"./index-3a6c73b8-1714059328110.js";import{P as Ee}from"./index-60290c05-1714059328110.js";import{N as oe}from"./Cascader-ddf1fc21-1714059328110.js";import{U as Ge}from"./updateSubject-723859ee-1714059328110.js";import{g as Ne,b as Ie}from"./api-0cb6691c-1714059328110.js";import{i as Ye,s as te}from"./use-async-e7e6319f-1714059328110.js";import{A as je}from"./addStudentModel-678f3b0f-1714059328110.js";import{u as De}from"./catchData-15ddf6d2-1714059328110.js";import"./index-1b6c88d1-1714059328110.js";import"./urlUtils-ae95598a-1714059328110.js";import"./index-8639da96-1714059328110.js";import"./Slider-277716a1-1714059328110.js";import"./index-d932246e-1714059328110.js";import"./icon_default-d1bcaf5f-1714059328110.js";import"./icon-plus-t-35f4cdeb-1714059328110.js";import"./api-091f72ac-1714059328110.js";import"./icon-pan-16e35a82-1714059328110.js";import"./ding-8e9054d5-1714059328110.js";import"./state-0b4d16be-1714059328110.js";import"./searchArray-cc351603-1714059328110.js";import"./index-77b6086f-1714059328110.js";import"./api-6f717590-1714059328110.js";import"./icon-collect-active-4272e308-1714059328110.js";import"./index-596a056a-1714059328110.js";import"./index-4a5ca751-1714059328110.js";import"./index-f4d34bd1-1714059328110.js";import"./index-e64de2d0-1714059328110.js";import"./teacherIcon-b8e3946d-1714059328110.js";import"./index.module-fd323afa-1714059328110.js";import"./html2canvas.esm-6e585478-1714059328110.js";const Te=U({props:{activeRow:{type:Object,default:()=>({id:""})},gradeYearList:{type:Array,default:()=>[]},gradeNumList:{type:Array,default:()=>[]},classArray:{type:Array,default:()=>[]}},name:"resetStudent",emits:["close","getList"],setup(p,{emit:w}){const e=Y({uploading:!1}),F=z(),c=y(),r=Y({gradeYear:null,currentGradeNum:null,currentClass:null,subjectId:null}),d=y([]),C=y([]),L=()=>{c.value.validate(async s=>{if(!s){e.uploading=!0;try{await be({...r}),F.success("新增成功"),w("close"),w("getList"),e.uploading=!1}catch(o){console.log(o)}e.uploading=!1}})},m=async()=>{try{const{data:s}=await Ae({}),o=[{label:s+1,value:s+1},{label:s,value:s}];d.value=o}catch(s){}},h=async()=>{try{const{data:s}=await re({gradeYear:r.gradeYear,currentGradeNum:r.currentGradeNum,currentClass:r.currentClass}),o=s||[];C.value=o.map(A=>({label:A.name,value:A.id}))}catch(s){}};return ie(()=>[r.gradeYear,r.currentGradeNum,r.currentClass],()=>{r.subjectId=null,h()}),O(()=>{m()}),()=>t("div",{class:[u.addClass]},[t(K,{"label-placement":"left",model:r,ref:c},{default:()=>[t(B,{path:"gradeYear",rule:[{required:!0,message:"请选择学年"}]},{default:()=>[t(I,x({style:{width:"400px"},options:d.value,placeholder:"选择学年",clearable:!0},{value:r.gradeYear,"onUpdate:value":s=>r.gradeYear=s}),null)]}),t(B,{path:"currentGradeNum",rule:[{required:!0,message:"请选择年级"}]},{default:()=>[t(I,x({style:{width:"400px"},options:p.gradeNumList,placeholder:"选择年级",clearable:!0},{value:r.currentGradeNum,"onUpdate:value":s=>r.currentGradeNum=s}),null)]}),t(B,{path:"currentClass",rule:[{required:!0,message:"请选择班级"}]},{default:()=>[t(I,x({style:{width:"400px"},options:p.classArray,placeholder:"选择班级",clearable:!0},{value:r.currentClass,"onUpdate:value":s=>r.currentClass=s}),null)]}),t(B,{path:"subjectId",rule:[{required:!0,message:"请选择声部"}]},{default:()=>[t(I,x({style:{width:"400px"},options:C.value,placeholder:"选择声部",clearable:!0},{value:r.subjectId,"onUpdate:value":s=>r.subjectId=s}),null)]})]}),t(j,{class:u.btnGroup,justify:"center"},{default:()=>[t(v,{round:!0,onClick:()=>w("close")},{default:()=>[n("取消")]}),t(v,{round:!0,loading:e.uploading,onClick:()=>L(),type:"primary"},{default:()=>[n("保存")]})]})])}}),Ue="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";function ae(p){return typeof p=="function"||Object.prototype.toString.call(p)==="[object Object]"&&!ce(p)}const Ve=U({props:{activeRow:{type:Object,default:()=>({id:""})}},name:"RestStudentBox",emits:["close","getList"],setup(p,{emit:w}){const e=z(),F=Y({uploading:!1});y([]),y([]),y();const c=y([]);console.log(p.activeRow,"activeRow");const r=Y({gradeYear:null,name:"",id:""}),d=y([]),C=y([]),L=y(null),m=y([]),h=y([]),s=y(null),o=y([]),A=async()=>{try{const i=await ne({page:1,rows:9999,upgradeFlag:!0});c.value=i.data.rows.map(l=>({label:l.name,key:l.id,gradeYear:l.gradeYear,disabled:l.id==p.activeRow.id})),c.value[0].disabled?(r.name=c.value[1].label,r.id=c.value[1].key,r.gradeYear=c.value[1].gradeYear):(r.name=c.value[0].label,r.id=c.value[0].key,r.gradeYear=c.value[0].gradeYear);const g=await k(r.id);h.value=g.data.rows.map(l=>({label:l.nickname+"("+l.id+")",value:l.id}))}catch(i){console.log(i)}},k=async i=>await Ce({page:1,rows:999,classGroupId:i}),G=async i=>{c.value.forEach(l=>{l.key==i&&(r.name=l.label,r.gradeYear=l.gradeYear,r.id=l.key)});const g=await k(i);h.value=g.data.rows.map(l=>({label:l.nickname+"("+l.id+")",value:l.id})),console.log(o.value,"submitList.value"),h.value=h.value.filter(l=>!o.value.some(P=>P.value===l.value)),o.value.forEach(l=>{l.toClassId==r.id&&(console.log(l.toClassId,l),h.value.push({label:l.label,value:l.value}))})},S=Q(()=>(C.value||[]).filter(l=>l.label.indexOf(L.value||"")!=-1)),E=Q(()=>(h.value||[]).filter(l=>l.label.indexOf(s.value||"")!=-1)),V=()=>{S.value.length===d.value.length?d.value=[]:d.value=S.value.map(i=>i.value)},W=()=>{E.value.length===m.value.length?m.value=[]:m.value=E.value.map(i=>i.value)},a=()=>{const i=C.value.filter(g=>d.value.indexOf(g.value)!=-1);if(i.length>0){const g=i.map(l=>({...l,studentId:l.value,toClassId:r.id}));o.value=o.value.filter(l=>!g.some(P=>P.value===l.value)),o.value=o.value.concat(g)}C.value=C.value.filter(g=>!i.some(l=>l.value===g.value)),i.forEach(g=>{h.value.push(g)}),d.value=[]},f=()=>{const i=h.value.filter(g=>m.value.indexOf(g.value)!=-1);if(i.length>0){const g=i.map(l=>({...l,studentId:l.value,toClassId:p.activeRow.id}));o.value=o.value.filter(l=>!g.some(P=>P.value===l.value)),o.value=o.value.concat(g)}h.value=h.value.filter(g=>!i.some(l=>l.value===g.value)),i.forEach(g=>{C.value.push(g)}),m.value=[],console.log(o.value," submitList.value===>")},R=async()=>{if(c.value.length<2){e.error("当前只有一个班级,无法调整");return}if(o.value<1){w("close");return}try{const i=await we(o.value);w("close"),w("getList")}catch(i){console.log(i)}};return O(async()=>{A();const i=await k(p.activeRow.id);C.value=i.data.rows.map(g=>({label:g.nickname+"("+g.id+")",value:g.id}))}),()=>{let i,g;return t("div",{class:[u.container,u.resetStudentWrap]},[t("div",{class:u.studentTransfer},[t("div",{class:u.studentTransferList},[t("div",{class:u.studentLeft},[t("div",{class:u.listTop},[t("p",null,[p.activeRow.name]),t("span",null,[n("(当前班级)")])]),t("div",{class:u.listCore},[t(D,{class:u.chioseCheckAllBox},{default:()=>[t(M,{onUpdateChecked:l=>{V()},checked:S.value.length===d.value.length,indeterminate:d.value.length>0&&S.value.length!==d.value.length,label:"全选"},null)]}),t(D,null,{default:()=>[t(J,x({placeholder:"请输入学生姓名"},{class:u.searchInput,searchWord:L.value,onChangeValue:l=>L.value=l}),null)]}),t(H,{style:"max-height: 204px;min-height: 204px;margin-top:14px;"},{default:()=>[t(Z,{value:d.value,"onUpdate:value":l=>d.value=l},ae(i=S.value.map(l=>t(D,{class:u.chioseCheckBox},{default:()=>[t(M,{value:l.value,label:l.label},null)]})))?i:{default:()=>[i]})]})]),t("div",{class:[u.bottomLeft,u.bottom]},[t("div",{class:u.bottomWrap},[n("共"),C.value.length,n("名学生")])])]),t("div",{class:u.chioseBox},[t("div",{class:[u.chioseBtn,u.chioseBtnRight],onClick:()=>a()},null),t("div",{class:u.chioseBtn,onClick:()=>f()},null)]),t("div",{class:u.studentRight},[t("div",{class:u.listTop},[r.id?t(de,{key:"111",value:r.id,"onUpdate:value":l=>r.id=l,options:c.value,onSelect:l=>{G(l)},scrollable:!0},{default:()=>[t("div",{class:u.showGradeSection},[t("div",null,[r.name,r.gradeYear&&t("span",null,[n("("),r.gradeYear,n("学年)")])]),t(le,{class:u.smallArrow,src:Ue,previewDisabled:!0},null)])]}):null]),t("div",{class:u.listCore},[t(D,{class:u.chioseCheckAllBox},{default:()=>[t(M,{onUpdateChecked:l=>{W()},checked:E.value.length===m.value.length,indeterminate:m.value.length>0&&E.value.length!==m.value.length,label:"全选"},null)]}),t(D,null,{default:()=>[t(J,x({placeholder:"请输入学生姓名"},{class:u.searchInput,searchWord:s.value,onChangeValue:l=>s.value=l}),null)]}),t(H,{style:"max-height: 204px;min-height: 204px;margin-top:14px;"},{default:()=>[t(Z,{value:m.value,"onUpdate:value":l=>m.value=l},ae(g=E.value.map(l=>t(D,{class:u.chioseCheckBox},{default:()=>[t(M,{value:l.value,label:l.label},null)]})))?g:{default:()=>[g]})]})]),t("div",{class:[u.bottomRight,u.bottom]},[t("div",{class:u.bottomWrap},[n("共"),h.value.length,n("名学生")])])])])]),t(j,{class:u.btnGroup,justify:"center"},{default:()=>[t(v,{round:!0,onClick:()=>w("close")},{default:()=>[n("取消")]}),t(v,{round:!0,loading:F.uploading,type:"primary",onClick:()=>{R()}},{default:()=>[n("保存")]})]})])}}}),We=U({name:"coai-guide",emits:["close"],setup(p,{emit:w}){const e=Y({box:{height:"0px"},show:!1,steps:[{ele:"",eleRect:{},img:$("class1.png"),handStyle:{top:"0.91rem"},imgStyle:{top:b(-4),left:b(-294),width:b(648),height:b(227)},btnsStyle:{bottom:b(30),left:b(-130)},eleRectPadding:{left:7,top:7,width:14,height:14}},{ele:"",img:$("class2.png"),imgStyle:{top:b(-4),left:b(-276),width:b(515),height:b(227)},btnsStyle:{bottom:b(30),left:b(-110)},eleRectPadding:{left:7,top:7,width:14,height:14}},{ele:"",img:$("class3.png"),imgStyle:{top:b(-4),width:b(437),height:b(227),left:b(-276)},btnsStyle:{bottom:b(30),left:b(-113)},eleRectPadding:{left:7,top:7,width:14,height:14}}],step:0}),F=y(!1),c=y({});(async()=>{var s;try{const o=await Re({guideTag:"teacher-guideInfo"});o.data?c.value=JSON.parse((s=o.data)==null?void 0:s.guideValue)||null:c.value={},c.value&&c.value.classGuide?F.value=!1:F.value=!0}catch(o){console.log(o)}})();const d=()=>{var o,A,k,G;const s=document.getElementById("class-".concat(e.step));if(s){const S=s.getBoundingClientRect(),E=((o=e.steps[e.step].eleRectPadding)==null?void 0:o.left)||0,V=((A=e.steps[e.step].eleRectPadding)==null?void 0:A.top)||0,W=((k=e.steps[e.step].eleRectPadding)==null?void 0:k.width)||0,a=((G=e.steps[e.step].eleRectPadding)==null?void 0:G.height)||0;e.box={left:S.x-E+"px",top:S.y-V+"px",width:S.width+W+"px",height:S.height+a+"px"}}else m()},C=async s=>{try{if(s!=="classList")return;c.value?c.value.classGuide=!1:c.value={classGuide:!1};try{await ee({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(c.value)})}catch(o){console.log(o)}e.step=0,d(),F.value=!0}catch(o){}};O(()=>{d(),window.addEventListener("resize",L),_.on("teacher-guideInfo",s=>C(s))});const L=()=>{d()};pe(()=>{window.removeEventListener("resize",L),_.off("teacher-guideInfo",C)});const m=()=>{if(e.step>=4){h();return}e.step=e.step+1,d()},h=async()=>{c.value?c.value.classGuide=!0:c.value={classGuide:!0};try{const s=await ee({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(c.value)})}catch(s){console.log(s)}F.value=!1};return()=>t(q,null,[F.value?se(t("div",{"onUpdate:show":s=>F.value=s,class:["n-modal-mask","n-modal-mask-guide"]},[t("div",{class:N.content,onClick:()=>m()},[t("div",{class:N.backBtn,onClick:s=>{s.stopPropagation(),h()}},[n("跳过")]),t("div",{class:N.box,style:{...e.box,...e.steps[e.step].boxStyle},id:"modeType-".concat(e.step)},[e.steps.map((s,o)=>{var A,k,G,S;return t("div",{onClick:E=>E.stopPropagation(),class:N.item,style:s.type=="bottom"?{display:o===e.step?"":"none",left:"".concat((A=s.eleRect)==null?void 0:A.left,"px"),top:"-".concat((k=s.imgStyle)==null?void 0:k.height)}:{display:o===e.step?"":"none",left:"".concat((G=s.eleRect)==null?void 0:G.left,"px"),top:"".concat((S=e.box)==null?void 0:S.height)}},[t("img",{class:N.img,style:s.imgStyle,src:s.img},null),t("div",{class:N.btns,style:s.btnsStyle},[e.step+1==e.steps.length?t(q,null,[t("div",{class:[N.endBtn],onClick:()=>h()},[n("完成")]),t("div",{class:N.nextBtn,onClick:()=>{e.step=0,d()}},[n("再看一遍")])]):t("div",{class:N.btn,onClick:()=>m()},[n("下一步 ("),e.step+1,n("/"),e.steps.length,n(")")])])])})])])]),[[ue,F.value,"show"]]):null])}}),Pe="_showContentWidth_1uy1t_1",Oe={showContentWidth:Pe},Me=U({name:"the-tooltip",props:{maxWidth:{type:Number,default:300},showContentWidth:{type:Number,default:120},tipsContent:{type:String,default:""},content:{type:String,default:""},placement:{type:String,default:"top"},showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"}},setup(p){return()=>t(q,null,[t(ge,{style:{maxWidth:p.maxWidth+"px"},trigger:p.trigger,placement:p.placement,showArrow:p.showArrow,delay:500},{trigger:()=>t("p",{style:{maxWidth:p.showContentWidth+"px"},class:Oe.showContentWidth},[p.content]),default:()=>p.tipsContent||p.content})])}}),qe=U({props:{activeRow:{type:Object,default:()=>({id:""})},gradeNumList:{type:Array,default:()=>[]},classArray:{type:Array,default:()=>[]}},name:"resetStudent",emits:["close","getList"],setup(p,{emit:w}){const e=Y({uploading:!1}),F=z(),c=y(),r=y([]),d=Y({currentGradeNum:null,gradeYear:null,currentClass:null,instrumentId:null,id:null});O(()=>{d.currentGradeNum=p.activeRow.currentGradeNum,d.gradeYear=p.activeRow.gradeYear,d.currentClass=p.activeRow.currentClass,d.instrumentId=p.activeRow.instrumentId,d.id=p.activeRow.id,L()});const C=()=>{c.value.validate(async m=>{if(!m){e.uploading=!0;try{await Fe({...d}),F.success("修改成功"),w("close"),w("getList"),e.uploading=!1}catch(h){console.log(h)}e.uploading=!1}})},L=async()=>{try{const{data:m}=await re({gradeYear:d.gradeYear,currentGradeNum:d.currentGradeNum,currentClass:d.currentClass}),h=m||[];r.value=h}catch(m){}};return()=>t("div",{class:[u.addClass]},[t(K,{"label-placement":"left",model:d,ref:c},{default:()=>[t(B,{path:"instrumentId",rule:[{required:!0,message:"请选择乐器"}]},{default:()=>[t(oe,{placeholder:"请选择乐器",value:d.instrumentId,"onUpdate:value":m=>d.instrumentId=m,options:r.value,checkStrategy:"child",showPath:!0,childrenField:"instruments",expandTrigger:"hover",labelField:"name",valueField:"id",clearable:!0,filterable:!0,style:{width:"400px"}},null)]})]}),t(j,{class:u.btnGroup,justify:"center"},{default:()=>[t(v,{round:!0,onClick:()=>w("close")},{default:()=>[n("取消")]}),t(v,{round:!0,loading:e.uploading,onClick:()=>C(),type:"primary"},{default:()=>[n("保存")]})]})])}}),Nt=U({name:"class-classList",setup(){const p=De(),w=me(),e=Y({searchForm:{keyword:null,currentClass:"",currentGradeNum:"",instrumentId:"",gradeYear:"",gradeLevel:""},orchestraType:null,courseTypeCode:null,loading:!1,pagination:{page:1,rows:10,pageTotal:6},gradeNumList:[],tableList:[],studentVisible:!1,activeRow:null,showaddClass:!1,goCourseVisiable:!1,removeVisiable:!1,removeRow:{},previewModal:!1,previewParams:{},lastCourse:null,groupBtnLoading:!1,showResetClass:!1,showSubjectClass:!1,groupVisiable:!1,popSelectYearList:[],popSelectLevelList:[],addStudentVisible:!1}),F=y(),c=z(),r=he(),d=ve(),C=()=>{e.pagination.page=1,s(),te({current:e.searchForm,saveKey:d.path})},L=y(!1);e.gradeNumList=xe();const m=()=>{e.searchForm={keyword:null,currentClass:"",currentGradeNum:"",instrumentId:"",gradeYear:"",gradeLevel:""},e.popSelectYearList.length>1&&(e.searchForm.gradeYear=e.popSelectYearList[1].id),s(),te({current:e.searchForm,saveKey:d.path})},h=async()=>{try{await Se({ids:e.removeRow.id}),s(),c.success("删除成功"),e.removeVisiable=!1}catch(a){console.log(a)}},s=async()=>{e.loading=!0;try{const a=await ne({...e.searchForm,...e.pagination});e.tableList=a.data.rows,e.pagination.pageTotal=a.data.total,e.loading=!1,setTimeout(()=>{e.tableList.length>0&&(L.value=!0)},500)}catch(a){e.loading=!1,console.log(a)}},o=()=>[{title:"班级名称",key:"name"},{title:"学年",key:"gradeYear"},{title:"学级",key:"gradeLevel",render(a){return a.gradeLevel?"".concat(a.gradeLevel,"级"):""}},{title:"班级乐器",key:"instrumentName"},{title:"学生人数",key:"preStudentNum"},{title:"上次学习",key:"lastStudy",width:"20%",render(a){return a.lastStudy?t(Me,{maxWidth:300,showContentWidth:300,content:a.lastStudy},null):"--"}},{title:"操作",key:"id",render(a,f){return t("div",null,[t(j,null,{default:()=>[f==0?t("div",{id:"class-0"},[t(v,{type:"primary",text:!0,onClick:()=>{r.push({path:"/classDetail",query:{name:a.name,id:a.id,gradeYear:a.gradeYear,upgradeFlag:a.upgradeFlag?1:0}})}},{default:()=>[n("详情")]})]):t(v,{type:"primary",text:!0,onClick:()=>{r.push({path:"/classDetail",query:{name:a.name,id:a.id,gradeYear:a.gradeYear,upgradeFlag:a.upgradeFlag?1:0}})}},{default:()=>[n("详情")]}),t(v,{type:"primary",disabled:!a.upgradeFlag||a.instrumentId,text:!0,onClick:()=>G(a)},{default:()=>[n("修改乐器")]}),f==0?t(v,x({type:"primary",disabled:!a.upgradeFlag},{id:"class-1"},{text:!0,onClick:()=>{A(a)}}),{default:()=>[n("学生调整")]}):t(v,{type:"primary",disabled:!a.upgradeFlag,text:!0,onClick:()=>{A(a)}},{default:()=>[n("学生调整")]}),f==0?t(v,x({id:"class-2"},{disabled:!a.upgradeFlag,type:"primary",text:!0,onClick:()=>k(a)}),{default:()=>[n("开始上课")]}):t(v,{disabled:!a.upgradeFlag,type:"primary",text:!0,onClick:()=>k(a)},{default:()=>[n("开始上课")]}),a.preStudentNum>0?null:t(v,{type:"error",color:"#EA4132",textColor:"#EA4132",text:!0,onClick:()=>{e.removeVisiable=!0,e.removeRow=a}},{default:()=>[n("删除")]}),a.imGroupId?null:t(v,{type:"primary",disabled:!a.upgradeFlag,text:!0,onClick:()=>{S(a)}},{default:()=>[n("创建群聊")]}),t(v,{type:"primary",disabled:!a.upgradeFlag,text:!0,onClick:()=>{const{schoolInfos:R}=w.getUserInfo,i=R.length>0?R[0].id:null;i&&(e.addStudentVisible=!0,e.activeRow={id:i,classId:a.id,currentGradeNum:a.currentGradeNum,currentClass:a.currentClass,gradeYear:a.gradeYear})}},{default:()=>[n("邀请学生")]})]})])}}],A=a=>{e.activeRow=a,e.studentVisible=!0},k=async a=>{try{a.instrumentId?r.push({path:"/prepare-lessons",query:{lastUseCoursewareId:a.lessonCoursewareId,unit:a.lessonCoursewareKnowledgeDetailId,instrumentId:a.instrumentId,courseScheduleSubjectId:a.courseScheduleSubjectId,preStudentNum:a.preStudentNum,name:a.name,classGroupId:a.id}}):(e.showSubjectClass=!0,e.activeRow=a)}catch(f){console.log(f)}},G=a=>{e.activeRow=a,e.showResetClass=!0},S=async a=>{e.activeRow=a,e.groupVisiable=!0},E=async()=>{console.log(e.activeRow,"row"),e.groupBtnLoading=!0;try{await Le({classGroupId:e.activeRow.id}),c.success("创建成功"),e.groupVisiable=!1,await s()}catch(a){console.log(a)}e.groupBtnLoading=!1},V=async()=>{try{const{data:a}=await Ne(),f=a||[];f.forEach(R=>{R.name=R.name+"学年"}),e.popSelectYearList=f||[],f.length>1&&!e.searchForm.gradeYear&&(e.searchForm.gradeYear=f[1].id)}catch(a){}},W=async()=>{try{const{data:a}=await Ie(),f=a||[];f.forEach(R=>{R.name=R.name+"级"}),f.unshift({id:"",name:"全部学级"}),e.popSelectLevelList=f||[],f.length>0&&!e.searchForm.gradeLevel&&(e.searchForm.gradeLevel=f[0].id)}catch(a){}};return Ye({current:e.searchForm,callBack:a=>{e.searchForm=a}}),O(async()=>{e.loading=!0,await p.getSubjects(),await V(),await W(),await s(),e.loading=!1}),()=>t("div",{class:u.listWrap},[t("div",{class:u.searchList},[t(K,{"label-placement":"left",inline:!0,ref:F},{default:()=>[t(B,null,{default:()=>[t(J,x({placeholder:"请输入班级名称"},{class:u.searchInput,searchWord:e.searchForm.keyword,onChangeValue:a=>e.searchForm.keyword=a}),null)]}),t(B,null,{default:()=>[t(I,x({options:e.popSelectYearList,placeholder:"选择学年",clearable:!1,inline:!0,labelField:"name",valueField:"id"},{value:e.searchForm.gradeYear,"onUpdate:value":a=>e.searchForm.gradeYear=a}),null)]}),t(B,null,{default:()=>[t(I,x({options:e.popSelectLevelList,placeholder:"选择学级",clearable:!0,inline:!0,labelField:"name",valueField:"id"},{value:e.searchForm.gradeLevel,"onUpdate:value":a=>e.searchForm.gradeLevel=a}),null)]}),t(B,null,{default:()=>[t(I,x({options:e.gradeNumList,placeholder:"选择年级",clearable:!0,inline:!0},{value:e.searchForm.currentGradeNum,"onUpdate:value":a=>e.searchForm.currentGradeNum=a}),null)]}),t(B,null,{default:()=>[t(I,x({options:X,placeholder:"选择班级",clearable:!0,inline:!0},{value:e.searchForm.currentClass,"onUpdate:value":a=>e.searchForm.currentClass=a}),null)]}),t(B,null,{default:()=>[t(oe,{to:"body",placeholder:"选择乐器",options:[{value:"",label:"全部乐器"},...p.getSubjectList],childrenField:"instruments",checkStrategy:"child",expandTrigger:"hover",showPath:!1,value:e.searchForm.instrumentId,"onUpdate:value":[a=>e.searchForm.instrumentId=a,(a,f,R)=>{console.log(a,f,R)}]},null)]}),t(B,null,{default:()=>[t(j,{justify:"end"},{default:()=>[t(v,{type:"primary",class:"searchBtn",onClick:C},{default:()=>[n("搜索")]}),t(v,{type:"primary",ghost:!0,class:"resetBtn",onClick:m},{default:()=>[n("重置")]})]})]})]})]),t(v,{class:u.addBtn,type:"primary",onClick:()=>e.showaddClass=!0},{default:()=>[n("创建班级")],icon:()=>t(q,null,[t(le,{class:u.addBtnIcon,previewDisabled:!0,src:ke},null)])}),t("div",{class:u.tableWrap},[t(fe,{class:u.classTable,loading:e.loading,columns:o(),data:e.tableList},{empty:()=>t(Be,null,null)}),t(ye,{page:e.pagination.page,"onUpdate:page":a=>e.pagination.page=a,pageSize:e.pagination.rows,"onUpdate:pageSize":a=>e.pagination.rows=a,pageTotal:e.pagination.pageTotal,"onUpdate:pageTotal":a=>e.pagination.pageTotal=a,onList:s,sync:!0},null)]),t(T,{show:e.studentVisible,"onUpdate:show":a=>e.studentVisible=a,preset:"card",class:["modalTitle background",u.studentVisible],title:"学生调整"},{default:()=>[t(Ve,{activeRow:e.activeRow,onClose:()=>e.studentVisible=!1,onGetList:()=>s()},null)]}),t(T,{show:e.showaddClass,"onUpdate:show":a=>e.showaddClass=a,style:{width:"500px"},"display-directive":"if",preset:"card",class:["modalTitle background"],title:"创建班级"},{default:()=>[t(Te,{gradeYearList:e.popSelectYearList,gradeNumList:e.gradeNumList,classArray:X,onGetList:()=>s(),onClose:()=>e.showaddClass=!1},null)]}),t(T,{show:e.showResetClass,"onUpdate:show":a=>e.showResetClass=a,style:{width:"500px"},"display-directive":"if",preset:"card",class:["modalTitle background"],title:"修改声部"},{default:()=>[t(qe,{activeRow:e.activeRow,onGetList:()=>s(),onClose:()=>e.showResetClass=!1},null)]}),t(T,{show:e.showSubjectClass,"onUpdate:show":a=>e.showSubjectClass=a,style:{width:"500px"},preset:"card",class:["modalTitle background"],title:"修改声部"},{default:()=>[e.showSubjectClass?t(Ge,{activeRow:e.activeRow,onGetList:()=>s(),onConfirm:a=>{r.push({path:"/prepare-lessons",query:{...a}})},onClose:()=>e.showSubjectClass=!1},null):null]}),t(Ee,{show:e.previewModal,"onUpdate:show":a=>e.previewModal=a,type:"attend",params:e.previewParams},null),t(T,{show:e.removeVisiable,"onUpdate:show":a=>e.removeVisiable=a,preset:"card",class:["modalTitle",u.removeVisiable],title:"删除班级"},{default:()=>[t("div",{class:u.studentRemove},[t("p",null,[n("确定要删除班级么?"),t("span",null,[n("删除班级信息将会清空")]),n("。")]),t(j,{class:u.btnGroup,justify:"center"},{default:()=>[t(v,{round:!0,type:"primary",onClick:h},{default:()=>[n("确定")]}),t(v,{round:!0,onClick:()=>e.removeVisiable=!1},{default:()=>[n("取消")]})]})])]}),t(T,{show:e.groupVisiable,"onUpdate:show":a=>e.groupVisiable=a,preset:"card",class:["modalTitle",u.removeVisiable],title:"创建群聊"},{default:()=>[t("div",{class:u.studentRemove},[t("p",{style:{textAlign:"center"}},[n("是否创建班级群聊")]),t(j,{class:u.btnGroup,justify:"center"},{default:()=>[t(v,{round:!0,type:"primary",onClick:E,loading:e.groupBtnLoading,disabled:e.groupBtnLoading},{default:()=>[n("确定")]}),t(v,{round:!0,onClick:()=>e.groupVisiable=!1},{default:()=>[n("取消")]})]})])]}),L.value?t(We,null,null):null,e.addStudentVisible?se(t("div",{"onUpdate:show":a=>e.addStudentVisible=a,class:["n-modal-mask",u.popBox]},[t(je,{activeRow:e.activeRow,onClose:()=>{e.addStudentVisible=!1}},null)]),[[ue,e.addStudentVisible,"show"]]):null])}});export{Nt as default};
|