index-9c9bee71.js 2.3 KB

12
  1. import{r as u,c as v,a as w,u as o,i as g,o as r,b as p,d as c,e as n,f as y}from"./index-312d0758.js";import{E as x}from"./el-dialog-7eeab671.js";/* empty css */import{E as C}from"./el-image-viewer-828727ea.js";import{g as k}from"./helper-aaa0b9d4.js";import"./index-3d809b27.js";import"./error-78e43d3e.js";import"./scroll-27bc6409.js";import"./vnode-e253b113.js";import"./index-7588b595.js";import"./plugin-vue_export-helper-1cff8a04.js";import"./focus-trap-30782453.js";import"./typescript-c7dac87b.js";import"./refs-682a87ce.js";import"./event-9519ab40.js";import"./index-1da7ed1a.js";import"./isUndefined-aa0326a0.js";import"./index-a787320c.js";import"./debounce-80ed8290.js";import"./index-bec297e4.js";const V={key:0,style:{width:"100%",height:"82vh"}},L=["src"],E={key:1,style:{width:"100%",height:"82vh"}},j=["src"],B={key:2},N={id:"play",style:{width:"100%",height:"100px"},controls:""},U=["src"],F={key:3},b=["src"],T={key:4},te={__name:"index",setup(z,{expose:f}){f({openViewFile:h});let l=u(!1),e=u(""),t=u("");function h(d){if(!d)return;const a=d.split("."),s=a[a.length-1],m=["doc","docx","xls","xlsx","ppt","pptx"],i=k(d);m.includes(s.toLowerCase())?(e.value="https://view.officeapps.live.com/op/view.aspx?src="+i,t.value="office"):s.toLowerCase()==="pdf"?(e.value=i,t.value="pdf"):s.toLowerCase()==="mp3"?(e.value=i,t.value="mp3"):s.toLowerCase()==="mp4"?(e.value=i,t.value="mp4"):(s.toLowerCase()==="jpg"||s.toLowerCase()==="png"||s.toLowerCase()==="jpeg")&&(e.value=i,t.value="jpg"),l.value=!0}function _(){t.value="",e.value="",l.value=!1}return(d,a)=>{const s=C,m=x;return r(),v(m,{modelValue:o(l),"onUpdate:modelValue":a[0]||(a[0]=i=>g(l)?l.value=i:l=i),width:"90%",top:"3vh",onClosed:_},{default:w(()=>[o(t)==="office"?(r(),p("div",V,[c("iframe",{style:{width:"100%",height:"100%","overflow-y":"auto"},src:o(e)},null,8,L)])):n("",!0),o(t)==="pdf"?(r(),p("div",E,[c("iframe",{style:{width:"100%",height:"100%","overflow-y":"auto"},src:o(e)},null,8,j)])):n("",!0),o(t)==="mp3"?(r(),p("div",B,[c("audio",N,[c("source",{src:o(e)},null,8,U)])])):n("",!0),o(t)==="mp4"?(r(),p("div",F,[c("video",{style:{width:"100%",height:"100%"},src:o(e),controls:""},null,8,b)])):n("",!0),o(t)==="jpg"?(r(),p("div",T,[y(s,{style:{width:"100%",height:"100%"},src:o(e),fit:"contain"},null,8,["src"])])):n("",!0)]),_:1},8,["modelValue"])}}};export{te as default};