import{d as F,a as t,o as K,b as r,h as x,f as i,w as n,g as s,s as l,n as M,e as v,j as c,u as f,A as $,t as j,z,E as R}from"./vue.BxlDVA1H.js";import{O as A,P as U,g as w}from"./index.lP_uh0LI.js";import{createCrudOptions as q}from"./crud.hkuyS_E-.js";import{_ as G}from"./_plugin-vue_export-helper.DlAUqK2U.js";const J={key:0},Q=["onClick"],T=["onClick"],W={key:4},X=["src"],Y=["src"],Z={class:"closePreviewBtn"},ee=F({__name:"index",setup(oe){t(null),t(!1);const B=o=>o<1024?o+"b":o<1024*1024?(o/1024).toFixed(2)+"Kb":(o/(1024*1024)).toFixed(2)+"Mb",k=t(),C=t(),{crudExpose:p}=A({crudRef:k,crudBinding:C}),{crudOptions:E}=q({crudExpose:p,context:{}});U({crudExpose:p,crudOptions:E}),t([]);const u=t(!1),a=t(""),d=t(""),h=t(),P=t(),g=(o,y)=>{u.value=!0,h.value.muted=!0,P.value.muted=!0,a.value=o,window.addEventListener("keydown",m)},b=()=>{u.value=!1,a.value="",d.value="",window.removeEventListener("keydown",m)},m=o=>{o.key==="Escape"&&(u.value=!1,a.value="",d.value="",window.removeEventListener("keydown",m))};return K(()=>{p.doRefresh()}),(o,y)=>{const D=r("el-image"),S=r("VideoCamera"),_=r("el-icon"),V=r("Headset"),L=r("Document"),H=r("fs-crud"),I=r("CircleClose"),N=r("fs-page");return i(),x(N,null,{default:n(()=>[s(H,M({ref_key:"crudRef",ref:k},C.value),{"actionbar-left":n(e=>y[0]||(y[0]=[])),cell_size:n(e=>[l("span",null,$(e.row.size?B(e.row.size):"0b"),1)]),cell_preview:n(e=>[e.row.file_type===0?(i(),v("div",J,[s(D,{style:{width:"100%","aspect-ratio":"1 /1"},src:f(w)(e.row.url),"preview-src-list":[f(w)(e.row.url)],"preview-teleported":!0},null,8,["src","preview-src-list"])])):c("",!0),e.row.file_type===1?(i(),v("div",{key:1,class:"_preview",onClick:O=>g(f(w)(e.row.url),"video")},[s(_,{size:60},{default:n(()=>[s(S)]),_:1})],8,Q)):c("",!0),e.row.file_type===2?(i(),v("div",{key:2,class:"_preview",onClick:O=>g(f(w)(e.row.url),"video")},[s(_,{size:60},{default:n(()=>[s(V)]),_:1})],8,T)):c("",!0),e.row.file_type===3?(i(),x(_,{key:3,size:60},{default:n(()=>[s(L)]),_:1})):c("",!0),e.row.file_type>3?(i(),v("div",W,"未知类型")):c("",!0)]),_:1},16),l("div",{class:j(["preview",{show:u.value}])},[z(l("video",{src:a.value,class:"previewItem",controls:!0,autoplay:!0,muted:!0,loop:!1,ref_key:"videoPreviewRef",ref:h},null,8,X),[[R,a.value]]),z(l("audio",{src:d.value,class:"previewItem",controls:!0,autoplay:!1,muted:!0,loop:!1,ref_key:"audioPreviewRef",ref:P},null,8,Y),[[R,d.value]]),l("div",Z,[s(_,{size:48,color:"white",style:{cursor:"pointer"},onClick:b},{default:n(()=>[s(I)]),_:1})])],2)]),_:1})}}}),ie=G(ee,[["__scopeId","data-v-0f7fe729"]]);export{ie as default};
