| 1234 |
- /*!
- Build based on gin-vue-admin
- Time : 1757946830000 */
- System.register(["./index-legacy.C7yqTvSr.js","./vue-cropper.es-legacy.lyer3HYq.js"],function(e,a){"use strict";var t,n,o,r,l,u,i,c,d,s,f,p,v,g,h,m,x,b,w,y,k,C,_,R,j;return{setters:[function(e){t=e._,n=e.a,o=e.q,r=e.u,l=e.t,u=e.c,i=e.o,c=e.b,d=e.f,s=e.w,f=e.v,p=e.x,v=e.g,g=e.i,h=e.d,m=e.F,x=e.y,b=e.z,w=e.A,y=e.B,k=e.h,C=e.C,_=e.E,R=e.j},function(e){j=e.M}],execute:function(){var a=document.createElement("style");a.textContent=".toolbar{position:fixed;bottom:0;z-index:1000;margin:0;width:100vw;display:flex;justify-content:space-between;border-radius:0;--un-bg-opacity:1;background-color:rgb(15 23 42 / var(--un-bg-opacity));padding:.625rem;--un-shadow:0 -2px 10px var(--un-shadow-color, rgba(0, 0, 0, .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.toolbar .el-button-group{display:flex;gap:.5rem}.toolbar .el-button-group .el-button[data-v-1dc36044]{width:2.5rem;padding:.5rem}[data-v-1dc36044] .vue-cropper{background-color:transparent}.h5-uploader .el-upload{position:relative;cursor:pointer;overflow:hidden;border-radius:.25rem;border:1px dashed var(--el-border-color);border-radius:6px;transition:var(--el-transition-duration-fast)}.h5-uploader .el-upload:hover{border-color:var(--el-color-primary)}.el-icon.h5-uploader-icon{width:8rem;height:8rem;text-align:center;font-size:1.5rem;line-height:2rem;--un-text-opacity:1;color:rgb(107 114 128 / var(--un-text-opacity))}\n/*$vite$:1*/",document.head.appendChild(a);var z={class:"flex justify-center w-full pt-2"},B={class:"flex flex-col w-full h-auto p-0 pt-4"},$={class:"flex-1 min-h-[60vh]"},S={class:"w-screen h-[calc(100vh-175px)] rounded"},U={key:1,class:"flex justify-center items-center w-full h-[calc(100vh-175px)]"},E={class:"toolbar"};e("default",t(Object.assign({name:"scanUpload"},{__name:"scanUpload",setup:function(e){var a=n(0),t=n(""),F=n(!1),I=n(300),A=function(){I.value=window.innerWidth};o(function(){A(),window.addEventListener("resize",A)});var D=r();D.isReady().then(function(){var e=D.currentRoute.value.query;a.value=e.id,t.value=e.token}).catch(function(e){});var L=n(null),M=n(""),V=n(null),W=l().proxy,q=n({}),H=n(!1),N=function(e){W.$refs.cropperRef.changeScale(e)},O=n([1,1]),T=n(300),G=n(300),J=n(!1),K=function(e){if(e.raw.type.includes("image")){if(e.raw.size/1024/1024>8)return _.error("文件大小不能超过8MB!"),!1;var a=R.service({lock:!0,text:"请稍后",background:"rgba(0, 0, 0, 0.7)"}),t=new FileReader;t.onload=function(e){M.value=e.target.result,a.close()},t.readAsDataURL(e.raw)}else _.error("请选择图片文件")},P=function(e){-90===e?W.$refs.cropperRef.rotateLeft():W.$refs.cropperRef.rotateRight()},Q=function(){if(H.value=!0,!1===F.value)return L.value.submit(),!0;W.$refs.cropperRef.getCropBlob(function(e){try{var a=new File([e],"".concat(Date.now(),".jpg"),{type:"image/jpeg"});L.value.clearFiles(),L.value.handleStart(a),L.value.submit()}catch(t){H.value=!1,_.error("上传失败: "+t.message)}})},X=function(e){e.data&&(M.value=null,H.value=!1,q.value={},_.success("上传成功"))};return function(e,n){var o=v("el-icon"),r=v("el-upload"),l=v("el-image"),_=v("el-button"),R=v("el-tooltip"),A=v("el-button-group"),D=v("el-switch");return i(),u(m,null,[c("div",z,[d(r,{ref_key:"uploadRef",ref:L,class:"h5-uploader",action:"".concat(f(p)(),"/fileUploadAndDownload/upload"),accept:"image/*","show-file-list":!1,"auto-upload":!1,headers:{"x-token":t.value},data:{classId:a.value},"on-success":X,"on-change":K},{default:s(function(){return[d(o,{class:"h5-uploader-icon"},{default:s(function(){return[d(f(x))]}),_:1})]}),_:1},8,["action","headers","data"])]),c("div",B,[c("div",$,[c("div",S,[F.value?(i(),g(f(j),{key:0,ref_key:"cropperRef",ref:V,img:M.value,mode:"contain",outputType:"jpeg",autoCrop:!0,autoCropWidth:T.value,autoCropHeight:G.value,fixedBox:!1,fixed:J.value,fixedNumber:O.value,centerBox:!0,canMoveBox:!0,full:!1,maxImgSize:I.value,original:!0},null,8,["img","autoCropWidth","autoCropHeight","fixed","fixedNumber","maxImgSize"])):(i(),u("div",U,[M.value?(i(),g(l,{key:0,src:M.value,class:"max-w-full max-h-full",mode:"cover"},null,8,["src"])):h("",!0)]))])])]),c("div",E,[F.value?(i(),g(A,{key:0},{default:s(function(){return[d(R,{content:"向左旋转"},{default:s(function(){return[d(_,{onClick:n[0]||(n[0]=function(e){return P(-90)}),icon:f(b)},null,8,["icon"])]}),_:1}),d(R,{content:"向右旋转"},{default:s(function(){return[d(_,{onClick:n[1]||(n[1]=function(e){return P(90)}),icon:f(w)},null,8,["icon"])]}),_:1}),d(_,{icon:f(x),onClick:n[2]||(n[2]=function(e){return N(1)})},null,8,["icon"]),d(_,{icon:f(y),onClick:n[3]||(n[3]=function(e){return N(-1)})},null,8,["icon"])]}),_:1})):h("",!0),d(D,{size:"large",modelValue:F.value,"onUpdate:modelValue":n[4]||(n[4]=function(e){return F.value=e}),"inline-prompt":"","active-text":"裁剪","inactive-text":"裁剪"},null,8,["modelValue"]),d(_,{type:"primary",onClick:Q,loading:H.value},{default:s(function(){return[k(C(H.value?"上传中...":"上 传"),1)]}),_:1},8,["loading"])])],64)}}}),[["__scopeId","data-v-1dc36044"]]))}}});
|