1 |
- import{d as _,u as b,r as n,c as h,e as y,n as g,O as z,f as t,v as p,A as R,k as u,w as S,j as m}from"./index-54f41458-1694675857467.js";import{s as v}from"./state-77b20ca5-1694675857467.js";const x="_wrap_rryzt_1",C="_previewWindow_rryzt_12",k="_previewIframe_rryzt_16",q="_removeVisiable_rryzt_21",M="_studentRemove_rryzt_27",I="_btnGroupModal_rryzt_39",o={wrap:x,previewWindow:C,previewIframe:k,removeVisiable:q,studentRemove:M,btnGroupModal:I},D=_({name:"notation-a",setup(){b();const r=n(!1),s=n(!1),l=n({}),a=n(!1),i=h().getToken||"",c=n();console.log(i);const w=sessionStorage.getItem("notation-open-create")=="1"?"&addShow=1":"";sessionStorage.removeItem("notation-open-create");const f=y({src:"".concat(/(192|localhost)/.test(location.origin)?"https://test.lexiaoya.cn":location.origin,"/notation/#/create?v=").concat(Date.now(),"&Authorization=").concat(i).concat(w)}),F=()=>{const e=document.documentElement;e.requestFullscreen&&e.requestFullscreen()||e.mozRequestFullScreen&&e.mozRequestFullScreen()||e.webkitRequestFullscreen&&e.webkitRequestFullscreen()||e.msRequestFullscreen&&e.msRequestFullscreen()},d=e=>{console.log(e.data,"data"),e.data.api==="notation_open"?v.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 g(()=>{window.addEventListener("message",d)}),z(()=>{window.removeEventListener("message",d)}),()=>t("div",{class:o.wrap},[t("iframe",{ref:c,src:f.src},null),t(p,{show:s.value,"onUpdate:show":e=>s.value=e,class:o.previewWindow,showIcon:!1,displayDirective:"show"},{default:()=>[t(R,{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(p,{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(m,{round:!0,type:"primary",onClick:()=>{s.value=!1,l.value.url="",a.value=!1,c.value.contentWindow.postMessage({api:"reload"},"*"),v.application&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen())}},{default:()=>[u("确定")]}),t(m,{round:!0,onClick:()=>a.value=!1},{default:()=>[u("取消")]})]})])]})])}});export{D as default};
|