1 |
- import{A as v}from"./index-179890b4-1715840129614.js";import{d as w,b6 as p,y as u,p as m,R as c,f as t,l as f,F as r,D as i}from"./index-27f38392-1715840129614.js";const h="_previewWindow_1jnin_1",y={previewWindow:h},C=w({name:"preview-window",props:{show:{type:Boolean,default:!1},type:{type:String,default:""},params:{type:Object,default:()=>({})}},emit:["update:show"],setup(a,{emit:o}){const{show:l,type:n,params:e}=p(a);u(()=>a.show,()=>{l.value=a.show}),u(()=>a.type,()=>{n.value=a.type}),u(()=>a.params,()=>{e.value=a.params});const d=s=>{s.data.api==="iframe_exit"&&o("update:show",!1)};return m(()=>{window.addEventListener("message",d)}),c(()=>{window.removeEventListener("message",d)}),()=>t(r,null,[t(f,{show:l.value,"onUpdate:show":[s=>l.value=s,()=>{o("update:show",l.value)}],class:y.previewWindow,showIcon:!1,displayDirective:"show"},{default:()=>[t(r,null,[l.value?n.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:()=>o("update:show",!1)},null):n.value=="notation"?t("iframe",{src:e.value.src,onLoad:s=>{i(s.target)}},null):n.value=="music"?t("iframe",{src:e.value.src,onLoad:s=>{i(s.target)},style:{height:"100vh"}},null):"":""])]})])}});export{C as P};
|