index-1bea453a-1724872791500.js 1.4 KB

1
  1. import{A as v}from"./index-04df5bfe-1724872791500.js";import{d as w,aO as m,A as d,q as p,T as c,f as t,l as f,m as h,F as r,G as i}from"./index-d5898469-1724872791500.js";const y="_previewWindow_1jnin_1",I={previewWindow:y},W=w({name:"preview-window",props:{show:{type:Boolean,default:!1},type:{type:String,default:""},params:{type:Object,default:()=>({})}},emit:["update:show"],setup(a,{emit:n}){const{show:l,type:o,params:e}=m(a);d(()=>a.show,()=>{l.value=a.show}),d(()=>a.type,()=>{o.value=a.type}),d(()=>a.params,()=>{e.value=a.params});const u=s=>{s.data.api==="iframe_exit"&&n("update:show",!1)};return p(()=>{window.addEventListener("message",u)}),c(()=>{window.removeEventListener("message",u)}),()=>t(r,null,[t(f,{maskClosable:h,show:l.value,"onUpdate:show":[s=>l.value=s,()=>{n("update:show",l.value)}],class:I.previewWindow,showIcon:!1,displayDirective:"show"},{default:()=>[t(r,null,[l.value?o.value=="attend"?t(v,{type:e.value.type||"",instrumentId:e.value.instrumentId||"",courseId:e.value.courseId||"",detailId:e.value.detailId||"",classGroupId:e.value.classGroupId||"",lessonCourseId:e.value.lessonCourseId||"",classId:e.value.classId||"",preStudentNum:e.value.preStudentNum,onClose:()=>n("update:show",!1)},null):o.value=="notation"?t("iframe",{src:e.value.src,onLoad:s=>{i(s.target)}},null):o.value=="music"?t("iframe",{src:e.value.src,onLoad:s=>{i(s.target)},style:{height:"100vh"}},null):"":""])]})])}});export{W as P};