mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2026-02-13 17:30:27 +08:00
2 lines
1.5 KiB
JavaScript
2 lines
1.5 KiB
JavaScript
import{d as B,a as v,z as b,A as u,b as l,j as d,f as m,w as f,g as r,e as z,i as _,t as i,u as h,aP as D,$ as I,l as t,W as N}from"./index-Cdx-WL5u.js";import{R as V}from"./index-CUss5sBK.js";const j={"element-loading-background":"transparent"},A={class:"w-[18vw]"},$={class:"mt-1 text-center"},E={class:"flex flex-wrap justify-center items-center text-center"},W={key:1,class:"mt-1"},q=B({name:"ReCropperPreview",__name:"index",props:{imgSrc:String},emits:["cropper"],setup(w,{expose:g,emit:C}){const x=C,e=t(),p=t(),k=t(),o=t(!1),s=t("");function R({base64:c,blob:n,info:a}){e.value=a,s.value=c,x("cropper",{base64:c,blob:n,info:a})}function y(){p.value.hide()}return g({hidePopover:y}),(c,n)=>{const a=v("el-image"),P=v("el-popover"),S=b("loading");return u((l(),d("div",j,[m(P,{ref_key:"popoverRef",ref:p,visible:o.value,placement:"right",width:"18vw"},{reference:f(()=>[r("div",A,[m(h(V),{ref_key:"refCropper",ref:k,src:w.imgSrc,circled:"",onCropper:R,onReadied:n[0]||(n[0]=F=>o.value=!0)},null,8,["src"]),u(r("p",$," 温馨提示:右键上方裁剪区可开启功能菜单 ",512),[[I,o.value]])])]),default:f(()=>[r("div",E,[s.value?(l(),z(a,{key:0,src:s.value,"preview-src-list":Array.of(s.value),fit:"cover"},null,8,["src","preview-src-list"])):_("",!0),e.value?(l(),d("div",W,[r("p",null," 图像大小:"+i(parseInt(e.value.width))+" × "+i(parseInt(e.value.height))+"像素 ",1),r("p",null," 文件大小:"+i(h(D)(e.value.size))+"("+i(e.value.size)+" 字节) ",1)])):_("",!0)])]),_:1},8,["visible"])])),[[S,!o.value]])}}}),J=N(q);export{J as R};
|