import{A as j}from"./index-e70021f8-1694078809672.js";import{d as b,bB as C,y as d,f as a,v as g,F as i,e as v,b as h,r as w,n as N,N as R,g as S,x as F,w as G,j as m,k as f}from"./index-ce8959eb-1694078809672.js";import{s as p}from"./index.module-c55c31aa-1694078809672.js";import{C as L}from"./index-61124a6f-1694078809672.js";import{r as U}from"./api-89d51472-1694078809672.js";import{u as W}from"./catchData-3be69512-1694078809672.js";const x="_previewWindow_1jnin_1",A={previewWindow:x},O=b({name:"preview-window",props:{show:{type:Boolean,default:!1},type:{type:String,default:""},params:{type:Object,default:()=>({})}},emit:["update:show"],setup(e,{emit:u}){const{show:l,type:o,params:t}=C(e);return d(()=>e.show,()=>{l.value=e.show}),d(()=>e.type,()=>{o.value=e.type}),d(()=>e.params,()=>{t.value=e.params}),()=>a(i,null,[a(g,{show:l.value,"onUpdate:show":[r=>l.value=r,()=>{u("update:show",l.value)}],class:A.previewWindow,showIcon:!1,displayDirective:"show"},{default:()=>[a(i,null,[l.value?o.value=="attend"?a(j,{type:t.value.type||"",subjectId:t.value.subjectId||"",detailId:t.value.detailId||"",classGroupId:t.value.classGroupId||"",lessonCourseId:t.value.lessonCourseId||"",classId:t.value.classId||"",onClose:()=>u("update:show",!1)},null):o.value=="notation"?a("iframe",{src:t.value.src},null):"":""])]})])}}),V=b({props:{activeRow:{type:Object,default:()=>({id:""})},subjectList:{type:Array,default:()=>[]}},name:"resetStudent",emits:["close","getList","confirm"],setup(e,{emit:u}){const l=W(),o=v({uploading:!1}),t=h(),r=w([]),c=w(),s=v({currentGradeNum:null,currentClass:null,subjectId:null,id:null});N(async()=>{await l.getSubjects(),r.value=[{id:null,name:"选择声部"},...l.getSubjectList],s.currentGradeNum=e.activeRow.currentGradeNum,s.currentClass=e.activeRow.currentClass,s.subjectId=e.activeRow.subjectId,s.id=e.activeRow.id});const I=()=>{c.value.validate(async n=>{if(!n){o.uploading=!0;try{await U({...s}),t.success("修改成功"),u("close"),u("confirm",{lastUseCoursewareId:e.activeRow.lessonCoursewareId,unit:e.activeRow.lessonCoursewareKnowledgeDetailId,subjectId:s.subjectId,name:e.activeRow.name,classGroupId:e.activeRow.id}),u("getList")}catch(y){console.log(y)}o.uploading=!1}})};return()=>a("div",{class:[p.addClass]},[a(R,{"label-placement":"left",model:s,ref:c},{default:()=>[a(S,{path:"subjectId",rule:[{required:!0,message:"请选择声部"}]},{default:()=>[a(L,F({style:{width:"400px"},options:r.value,placeholder:"选择声部",labelField:"name",valueField:"id",clearable:!0},{value:s.subjectId,"onUpdate:value":n=>s.subjectId=n}),null)]})]}),a(G,{class:p.btnGroup,justify:"center"},{default:()=>[a(m,{round:!0,onClick:()=>u("close")},{default:()=>[f("取消")]}),a(m,{round:!0,loading:o.uploading,onClick:()=>I(),type:"primary"},{default:()=>[f("确定")]})]})])}});export{O as P,V as U};