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