mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2026-01-20 16:53:37 +08:00
2 lines
1.5 KiB
JavaScript
2 lines
1.5 KiB
JavaScript
import{d as B,a as r,b as v,z as b,A as u,k as d,f as p,g as m,w as f,h as t,e as z,i as _,t as i,u as h,aP as D,$ as I,W as N}from"./index-DRjphMgD.js";import{R as V}from"./index-Da4SdtRd.js";const A={"element-loading-background":"transparent"},$={class:"w-[18vw]"},j={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 k=C,e=r(),l=r(),x=r(),o=r(!1),s=r("");function R({base64:c,blob:n,info:a}){e.value=a,s.value=c,k("cropper",{base64:c,blob:n,info:a})}function y(){l.value.hide()}return g({hidePopover:y}),(c,n)=>{const a=v("el-image"),P=v("el-popover"),S=b("loading");return u((p(),d("div",A,[m(P,{ref_key:"popoverRef",ref:l,visible:o.value,placement:"right",width:"18vw"},{reference:f(()=>[t("div",$,[m(h(V),{ref_key:"refCropper",ref:x,src:w.imgSrc,circled:"",onCropper:R,onReadied:n[0]||(n[0]=F=>o.value=!0)},null,8,["src"]),u(t("p",j," 温馨提示:右键上方裁剪区可开启功能菜单 ",512),[[I,o.value]])])]),default:f(()=>[t("div",E,[s.value?(p(),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?(p(),d("div",W,[t("p",null," 图像大小:"+i(parseInt(e.value.width))+" × "+i(parseInt(e.value.height))+"像素 ",1),t("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};
|