You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1 lines
6.7 KiB

import{_ as le,c6 as y,c7 as g,F as m,b as te,c8 as O,d as ne,c as ie}from"./index.1762932289438.js";import{V as se,a as oe,E as ae}from"./index.176293228943810.js";import{E as re}from"./progress.1762932289438.js";import{r as p,ai as ce,l as i,o as n,q as o,D as z,F as w,ab as R,G as B,u as e,M as T,J as r,L as D,K as u,H as x,V as X,P as fe}from"./vue.1762932289438.js";const ue={class:"flex gap-12 wrap file-container"},de=["onClick"],ve=["onClick"],me=["title","onClick"],pe={class:"filename"},ke=["onClick"],ye={key:0,class:"file-preview-wrapper flex overlay",style:{"z-index":"9999"}},ge={class:"file-list"},xe=["active","onClick"],he=["src"],_e=["src"],Ce={key:2,controls:"",style:{width:"50vw"}},be=["src"],$e=["src"],we={key:1,class:"error flex column text-center"},Ne={key:1,class:"error flex column text-center"},ze={key:6,style:{background:"#fff"}},Ee={class:"btn-content"},Pe={__name:"list",props:{files:{type:Array,default:()=>[]},removeEnable:{type:Boolean,default:!1}},emits:["update:files"],setup(d,{emit:A}){const v=d,I=A,E=p(!1),s=p({}),c=p(0),N=p(0),h=p(0),_=p(0);let P=!1,C=0,b=0;const F=p(!1);p([]);function k(t){E.value=!0,s.value=t,c.value=0,N.value=1,h.value=0,_.value=0,P=!1}function V(t){const l=[...v.files];l.splice(t,1),I("update:files",l)}function L(){window.open(`${m}/file/stream/${s.value.filePath}`)}function S(){const t=v.files.indexOf(s.value);k(t===0?v.files[v.files.length-1]:v.files[t-1])}function G(){const t=v.files.indexOf(s.value);t===v.files.length-1?k(v.files[0]):k(v.files[t+1])}function W(t){t.deltaY>0&&N.value>.5&&(N.value-=.1),t.deltaY<0&&(N.value+=.1)}function H(){P=!0,C=event.clientX,b=event.clientY}function q(t){P&&(c.value%360===0&&(h.value+=t.clientX-C,_.value+=t.clientY-b),c.value===90&&(_.value-=t.clientX-C,h.value+=t.clientY-b),c.value===180&&(h.value-=t.clientX-C,_.value-=t.clientY-b),c.value===270&&(_.value+=t.clientX-C,h.value-=t.clientY-b),C=t.clientX,b=t.clientY)}function J(t){P=!1}function K(){c.value===360?c.value=0:c.value+=90}function j(){c.value===0?c.value=270:c.value-=90}return(t,l)=>{const Q=re,f=te,U=ne,M=ie,Z=ae,ee=ce("print");return n(),i(w,null,[o("div",ue,[(n(!0),i(w,null,R(d.files,(a,$)=>(n(),i("div",{key:$,class:"item pointer"},[a.loading?(n(),B(Q,{key:0,type:"circle",percentage:a.percent,width:80,color:"var(--primary-color)"},null,8,["percentage"])):e(y)(a.fileName)===e(g).IMG?(n(),i(w,{key:1},[o("div",{class:"img-box",style:T({backgroundImage:`url(${e(m)}/file/stream/${a.filePath})`}),onClick:Y=>k(a)},null,12,de),d.removeEnable?(n(),i("a",{key:0,class:"remove-btn",onClick:Y=>V($)},[r(f,{name:"el-icon-CircleCloseFilled",size:20})],8,ve)):z("",!0)],64)):(n(),i("div",{key:2,class:"item flex end v-center column text-center",title:a.fileName,onClick:Y=>k(a)},[r(f,{name:e(O)(a.fileName),size:40},null,8,["name"]),o("span",pe,D(a.fileName),1),d.removeEnable?(n(),i("a",{key:0,class:"remove-btn",onClick:u(Y=>V($),["stop"])},[r(f,{name:"el-icon-CircleCloseFilled",size:16})],8,ke)):z("",!0)],8,me))]))),128))]),e(E)?(n(),i("div",ye,[r(U,{height:"100vh"},{default:x(()=>[o("div",ge,[(n(!0),i(w,null,R(d.files,(a,$)=>(n(),i("section",{key:$,class:"flex gap v-center pointer",active:d.files.indexOf(e(s))===$,onClick:Y=>k(a)},[r(f,{name:e(O)(a.fileName),size:24},null,8,["name"]),o("span",null,D(a.fileName),1)],8,xe))),128))])]),_:1}),o("div",{class:"file-content flex center v-center",id:"printTable",onClick:l[8]||(l[8]=a=>E.value=!1)},[e(y)(e(s).fileName)===e(g).IMG?(n(),i("div",{key:0,class:"img-container flex center",onWheel:W},[o("img",{src:`${e(m)}/file/stream/${e(s).filePath}`,ref:"imgRef",onClick:l[0]||(l[0]=u(()=>{},["stop"])),style:T({transform:`rotate(${e(c)}deg) scale(${e(N)}) translate(${e(h)}px, ${e(_)}px)`}),onMousedown:H,onMousemove:q,onMouseup:J,draggable:"false"},null,44,he),o("button",{class:"rotate-left-btn pointer",onClick:u(K,["stop","prevent"]),size:"small",title:"左旋转"},[r(f,{name:"local-icon-rotate-left",size:28})]),o("button",{class:"rotate-right-btn pointer",onClick:u(j,["stop","prevent"]),size:"small",title:"右旋转"},[r(f,{name:"local-icon-rotate-right",size:28})])],32)):e(y)(e(s).fileName)===e(g).PDF?(n(),i("iframe",{key:1,src:`${e(m)}/file/stream/${e(s).filePath}`,style:{height:"100vh",width:"900px"}},null,8,_e)):e(y)(e(s).fileName)===e(g).MP3?(n(),i("audio",Ce,[o("source",{src:`${e(m)}/file/stream/${e(s).filePath}`,type:"audio/mp3"},null,8,be)])):e(y)(e(s).fileName)===e(g).MP4?(n(),i("video",{key:3,controls:"",onClick:l[1]||(l[1]=u(()=>{},["stop"])),style:{"max-height":"100vh"}},[o("source",{src:`${e(m)}/file/stream/${e(s).filePath}`,type:"video/mp4"},null,8,$e)])):e(y)(e(s).fileName)===e(g).WORD?(n(),i(w,{key:4},[e(F)?(n(),i("div",we,l[10]||(l[10]=[o("span",{style:{padding:"20px"}},"文件预览解析错误,如有需要请下载到本地预览",-1)]))):(n(),B(e(se),{key:0,src:`${e(m)}/file/stream/${e(s).filePath}`,style:{height:"100vh",width:"900px"},onError:l[2]||(l[2]=a=>F.value=!0),onClick:l[3]||(l[3]=u(()=>{},["stop"]))},null,8,["src"]))],64)):e(y)(e(s).fileName)===e(g).EXCEL&&e(s).fileName.toLocaleLowerCase().endsWith(".xlsx")?(n(),i(w,{key:5},[e(F)?(n(),i("div",Ne,l[11]||(l[11]=[o("span",{style:{padding:"20px"}},"文件预览解析错误,如有需要请下载到本地预览",-1)]))):(n(),B(e(oe),{key:0,src:`${e(m)}/file/stream/${e(s).filePath}`,style:{height:"100vh",width:"60vw"},onError:l[4]||(l[4]=a=>F.value=!0),onClick:l[5]||(l[5]=u(()=>{},["stop"]))},null,8,["src"]))],64)):(n(),i("div",ze,[r(Z,{icon:"error",title:"不支持预览","sub-title":"该文件格式暂不支持预览,请下载预览",style:{background:"#fff",width:"600px",height:"400px"},onClick:l[6]||(l[6]=u(()=>{},["stop"]))},{extra:x(()=>[r(M,{type:"primary",text:"",size:"large",onClick:L},{default:x(()=>l[12]||(l[12]=[X("下载文件",-1)])),_:1,__:[12]})]),_:1})])),o("div",{class:"file-number",onClick:l[7]||(l[7]=u(()=>{},["stop"]))},[o("span",null,D(d.files.indexOf(e(s))+1)+" / "+D(d.files.length),1)]),d.files.length>1?(n(),i("button",{key:7,class:"left-btn pointer",onClick:u(S,["stop","prevent"])},[r(f,{name:"el-icon-ArrowLeftBold",size:28})])):z("",!0),d.files.length>1?(n(),i("button",{key:8,class:"right-btn pointer",onClick:u(G,["stop","prevent"])},[r(f,{name:"el-icon-ArrowRightBold",size:28})])):z("",!0)]),l[15]||(l[15]=o("div",{class:"close-btn"},null,-1)),o("button",{class:"close-btn pointer",onClick:l[9]||(l[9]=a=>E.value=!1)},[r(f,{name:"el-icon-Close",size:28})]),o("div",Ee,[r(M,{onClick:L,type:"primary",plain:""},{icon:x(()=>[r(f,{name:"el-icon-Download",size:20})]),default:x(()=>[l[13]||(l[13]=X(" 下载文件 ",-1))]),_:1,__:[13]}),fe((n(),B(M,{type:"primary",plain:""},{icon:x(()=>[r(f,{name:"el-icon-Download",size:20})]),default:x(()=>[l[14]||(l[14]=X(" 打印文件 ",-1))]),_:1,__:[14]})),[[ee,"#printTable"]])])])):z("",!0)],64)}}},Me=le(Pe,[["__scopeId","data-v-1cb25c98"]]);export{Me as _};