1 |
- import{A as v}from"./index-94da3ff2-1720699367816.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-b48b51d2-1720699367816.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};
|