import{m as _}from"./mittBus-cd2c11e6-1782729249161v=1.0.0.js";import{u as w}from"./useIframe-b1cfd5ff-1782729249161v=1.0.0.js";import{y as D,h as g,c as B,r as T,m as I,U as k,ar as x,z as t,A as s,B as c,K as A,u as a,M as p}from"./vendor-1e24e3ad-1782729249161v=1.0.0.js";import{_ as M}from"./index-b309bf9f-1782729249161v=1.0.0.js";import"./eleVendor-5008d1ec-1782729249161v=1.0.0.js";const L={class:"preview-module"},N={class:"preview-iframe","element-loading-text":"\u52A0\u8F7D\u4E2D..."},b=["src"],C={key:1,class:"preview-iframe-error"},F=D({name:"PreviewModule"}),P=D({...F,props:{iframeMode:{default:"EVENT_DETAIL"},pageType:{default:"add"}},setup(R){const{iframeRef:E,iframeReady:d,addReadySendData:y,readySendDataList:o,onIframeLoad:m,onIframeError:f,sendData:l,iframeLoadError:i}=w("EVENT_ADD");g(d,(r,e)=>{r&&r!==e&&o.value&&o.value.length>0&&(o.value.forEach(n=>{l(n)}),o.value=[])});const h=B(()=>window.location.origin+"/hkeventh5/#"),v=T(`${h.value}/pages/matchPart/detail/preview`);return I(()=>{_.on("WatchEventBaseInfoFormData",r=>{let e={data:r.data,subModuleType:r.dataType,moduleType:"EVENT_ADD"};d.value?l(e):y(e)})}),k(()=>{_.off("WatchEventBaseInfoFormData"),v.value=""}),(r,e)=>{const n=x("loading");return t(),s("div",L,[e[2]||(e[2]=c("div",{class:"preview-module-header"},[c("div",{class:"preview-module-header-title"},"\u6548\u679C\u9884\u89C8")],-1)),A((t(),s("div",N,[a(i)?p("v-if",!0):(t(),s("iframe",{key:0,src:a(v),frameborder:"0",ref_key:"iframeRef",ref:E,onLoad:e[0]||(e[0]=(...u)=>a(m)&&a(m)(...u)),onError:e[1]||(e[1]=(...u)=>a(f)&&a(f)(...u))},null,40,b)),a(i)?(t(),s("div",C,"\u52A0\u8F7D\u5931\u8D25")):p("v-if",!0)])),[[n,!a(d)&&!a(i)]])])}}});const K=M(P,[["__scopeId","data-v-4d71406b"]]);export{K as default};
