import{A as j}from"./index-35721334.js";import{d as b,bB as C,y as d,f as a,v as g,F as i,e as m,b as h,r as v,n as N,N as R,g as S,x as F,w as G,j as w,k as f}from"./index-e7035897.js";import{s as p}from"./index.module-42c945ce.js";import{C as L}from"./index-9292c974.js";import{r as U}from"./api-f6cfeba9.js";import{u as W}from"./catchData-7f3a0501.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||"",preStudentNum:t.value.preStudentNum,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=m({uploading:!1}),t=h(),r=v([]),c=v(),s=m({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(w,{round:!0,onClick:()=>u("close")},{default:()=>[f("取消")]}),a(w,{round:!0,loading:o.uploading,onClick:()=>I(),type:"primary"},{default:()=>[f("确定")]})]})])}});export{O as P,V as U};