1 |
- import{d as _,u as y,r as n,c as b,e as h,p as R,R as g,f as t,l as d,C as z,k as u,w as S,j as p}from"./index-27f38392-1715840129614.js";import{s as m}from"./state-bac02a99-1715840129614.js";const C="_wrap_rryzt_1",k="_previewWindow_rryzt_12",x="_previewIframe_rryzt_16",q="_removeVisiable_rryzt_21",M="_studentRemove_rryzt_27",D="_btnGroupModal_rryzt_39",o={wrap:C,previewWindow:k,previewIframe:x,removeVisiable:q,studentRemove:M,btnGroupModal:D},U=_({name:"notation-a",setup(){y();const r=n(!1),s=n(!1),l=n({}),a=n(!1),v=b().getToken||"",i=n(),w=sessionStorage.getItem("notation-open-create")=="1"?"&addShow=1":"";sessionStorage.removeItem("notation-open-create");const f=h({src:"".concat(/(192|localhost)/.test(location.origin)?"https://test.lexiaoya.cn":location.origin,"/notation/?t=").concat(Date.now(),"#/create?v=").concat(Date.now(),"&Authorization=").concat(v).concat(w)}),F=()=>{const e=document.documentElement;e.requestFullscreen&&e.requestFullscreen()||e.mozRequestFullScreen&&e.mozRequestFullScreen()||e.webkitRequestFullscreen&&e.webkitRequestFullscreen()||e.msRequestFullscreen&&e.msRequestFullscreen()},c=e=>{console.log(e.data,"data"),e.data.api==="notation_open"?m.application?(r.value=!0,s.value=!0,l.value={url:e.data.url},F()):window.open(e.data.url):e.data.api==="notation_exit"&&(console.log("进来"),a.value=!0)};return R(()=>{window.addEventListener("message",c)}),g(()=>{window.removeEventListener("message",c)}),()=>t("div",{class:o.wrap},[t("iframe",{ref:i,src:f.src,key:Date.now()},null),t(d,{show:s.value,"onUpdate:show":e=>s.value=e,class:o.previewWindow,showIcon:!1,displayDirective:"show"},{default:()=>[t(z,{show:r.value,style:"--n-opacity-spinning: 1;"},{default:()=>[t("iframe",{class:o.previewIframe,onLoad:()=>{r.value=!1},frameborder:"0",src:l.value.url},null)]})]}),t(d,{show:a.value,"onUpdate:show":e=>a.value=e,preset:"card",class:["modalTitle",o.removeVisiable],title:"退出制谱"},{default:()=>[t("div",{class:o.studentRemove},[t("p",null,[u("是否退出制谱功能?")]),t(S,{class:o.btnGroupModal,justify:"center"},{default:()=>[t(p,{round:!0,type:"primary",onClick:()=>{s.value=!1,l.value.url="",a.value=!1,i.value.contentWindow.postMessage({api:"reload"},"*"),m.application&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen())}},{default:()=>[u("确定")]}),t(p,{round:!0,onClick:()=>a.value=!1},{default:()=>[u("取消")]})]})])]})])}});export{U as default};
|