import{d as h,g as y,R as w,c,a1 as d,U as k,o as n,a as l,e as I,Y as x,Z as v,u as m,w as p,x as O,y as b,v as R,a2 as B,B as L,_ as P}from"./index.d4dfe080.js";const V={class:"layout-padding layout-padding-unset layout-iframe"},S={class:"layout-padding-auto layout-padding-view"},T=["src","data-url"],C=h({name:"layoutIfameView"}),D=h({...C,props:{refreshKey:{type:String,default:()=>""},name:{type:String,default:()=>"slide-right"},list:{type:Array,default:()=>[]}},setup(f){const i=f,o=y(),r=w();console.log("iframe-route",r.fullPath);const g=c(()=>i.list.filter(e=>e.meta.isIframeOpen)),_=c(()=>r.path),u=(e,a)=>{L(()=>{if(console.log("iframeRef",o.value),!o.value)return!1;o.value.forEach(t=>{t.dataset.url===e&&(t.onload=()=>{a.meta.isIframeOpen&&a.meta.loading&&(a.meta.loading=!1)})})})};return d(()=>r.fullPath,e=>{const a=i.list.find(t=>t.path===e);if(console.log("88",a),console.log(a),!a)return!1;a.meta.isIframeOpen||(a.meta.isIframeOpen=!0),u(e,a)},{immediate:!0}),d(()=>i.refreshKey,()=>{const e=i.list.find(a=>a.path===r.path);if(!e)return!1;e.meta.isIframeOpen&&(e.meta.isIframeOpen=!1),setTimeout(()=>{e.meta.isIframeOpen=!0,e.meta.loading=!0,u(r.fullPath,e)})},{deep:!0}),(e,a)=>{const t=k("loading");return n(),l("div",V,[I("div",S,[(n(!0),l(x,null,v(m(g),s=>p((n(),l("div",{class:"w100",key:s.path,"element-loading-background":"#ccc"},[O(B,{name:f.name,mode:"out-in"},{default:b(()=>[p((n(),l("iframe",{src:s.meta.isLink,key:s.path,frameborder:"0",height:"100%",width:"100%",style:{position:"absolute"},"data-url":s.path,ref_for:!0,ref_key:"iframeRef",ref:o},null,8,T)),[[R,m(_)===s.path]])]),_:2},1032,["name"])])),[[t,s.meta.loading]])),128))])])}}}),K=P(D,[["__file","/data/jenkins/workspace/badp-bcxin-web-5.x-dispatchBusiness/src/layout/routerView/iframes.vue"]]);export{K as default};