updateSubject-5f26abc8-1694675857467.js 2.8 KB

1
  1. import{A as j}from"./index-9f533828-1694675857467.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-54f41458-1694675857467.js";import{s as p}from"./index.module-c3699557-1694675857467.js";import{C as L}from"./index-17717767-1694675857467.js";import{r as U}from"./api-787d8c4c-1694675857467.js";import{u as W}from"./catchData-40463961-1694675857467.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};