2 lines
7.9 KiB
JavaScript
2 lines
7.9 KiB
JavaScript
|
|
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7694,8906],{37694:function(Z,h,e){e.r(h),e.d(h,{default:function(){return A}});var O=e(5574),p=e.n(O),y=e(67294),E=e(2453),I=e(17788),g=e(71230),c=e(15746),i=e(23799),b=e(83622),L=e(78957),o=e(76772),D=e(9025),C=e(42016),m=e(68906),P={avatarPreview:"avatarPreview___aVJPD"},u=e(88484),r=e(87740),v=e(10149),j=e(24969),U=e(52745),t=e(85893),x=function(T){var l=(0,y.useRef)(null),S=(0,y.useState)(),w=p()(S,2),n=w[0],a=w[1],_=(0,y.useState)(),R=p()(_,2),d=R[0],z=R[1];(0,y.useEffect)(function(){a(T.data)},[T]);var K=(0,o.useIntl)(),F=function(){var s=l==null?void 0:l.current,f=s==null?void 0:s.cropper;f.getCroppedCanvas().toBlob(function(V){var W=new FormData;W.append("avatarfile",V),(0,D.gg)(W).then(function(B){B.code===200?(E.ZP.success(B.msg),T.onFinished(!0)):E.ZP.warning(B.msg)})},"image/png")},N=function(){T.onFinished(!1)},G=function(){var s=l==null?void 0:l.current,f=s==null?void 0:s.cropper;z(f.getCroppedCanvas().toDataURL())},k=function(){var s=l==null?void 0:l.current,f=s==null?void 0:s.cropper;f.rotate(90)},$=function(){var s=l==null?void 0:l.current,f=s==null?void 0:s.cropper;f.rotate(-90)},X=function(){var s=l==null?void 0:l.current,f=s==null?void 0:s.cropper;f.zoom(.1)},Q=function(){var s=l==null?void 0:l.current,f=s==null?void 0:s.cropper;f.zoom(-.1)},J=function(s){var f=new FileReader;f.readAsDataURL(s),f.onload=function(){a(f.result)}};return(0,t.jsxs)(I.Z,{width:800,title:K.formatMessage({id:"system.user.modify_avatar",defaultMessage:"\u4FEE\u6539\u5934\u50CF"}),open:T.open,destroyOnClose:!0,onOk:F,onCancel:N,children:[(0,t.jsxs)(g.Z,{gutter:[16,16],children:[(0,t.jsx)(c.Z,{span:12,order:1,children:(0,t.jsx)(C.f,{ref:l,src:n,style:{height:350,width:"100%",marginBottom:"16px"},initialAspectRatio:1,guides:!1,crop:G,zoomable:!0,zoomOnWheel:!0,rotatable:!0})}),(0,t.jsx)(c.Z,{span:12,order:2,children:(0,t.jsx)("div",{className:P.avatarPreview,children:(0,t.jsx)("img",{src:d,style:{height:"100%",width:"100%"}})})})]}),(0,t.jsxs)(g.Z,{gutter:[16,16],children:[(0,t.jsx)(c.Z,{span:6,children:(0,t.jsx)(i.Z,{beforeUpload:J,maxCount:1,children:(0,t.jsxs)(b.ZP,{children:[(0,t.jsx)(u.Z,{}),"\u4E0A\u4F20"]})})}),(0,t.jsx)(c.Z,{children:(0,t.jsxs)(L.Z,{children:[(0,t.jsx)(b.ZP,{icon:(0,t.jsx)(r.Z,{}),onClick:k}),(0,t.jsx)(b.ZP,{icon:(0,t.jsx)(v.Z,{}),onClick:$}),(0,t.jsx)(b.ZP,{icon:(0,t.jsx)(j.Z,{}),onClick:X}),(0,t.jsx)(b.ZP,{icon:(0,t.jsx)(U.Z,{}),onClick:Q})]})})]})]})},A=x},9025:function(Z,h,e){e.d(h,{Lj:function(){return x},Nq:function(){return P},PR:function(){return D},_L:function(){return j},az:function(){return U},cn:function(){return C},gg:function(){return T},kX:function(){return r},lE:function(){return L},tW:function(){return S},wp:function(){return H},x7:function(){return w},xB:function(){return A}});var O=e(15009),p=e.n(O),y=e(97857),E=e.n(y),I=e(99289),g=e.n(I),c=e(31981),i=e(76772),b=e(30964);function L(n,a){return o.apply(this,arguments)}function o(){return o=g()(p()().mark(function n(a,_){return p()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",(0,i.request)("/api/system/user/list",E()({method:"GET",headers:{"Content-Type":"application/json;charset=UTF-8"},params:a},_||{})));case 1:case"end":return d.stop()}},n)})),o.apply(this,arguments)}function D(n,a){return(0,i.request)("/api/system/user/".concat(n),E()({method:"GET"},a||{}))}function C(n,a){return m.apply(this,arguments)}function m(){return m=g()(p()().mark(function n(a,_){return p()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",(0,i.request)("/api/system/user",E()({method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8"},data:a},_||{})));case 1:case"end":return d.stop()}},n)})),m.apply(this,arguments)}function P(n,a){return u.apply(this,arguments)}function u(){return u=g()(p()().mark(function n(a,_){return p()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",(0,i.request)("/api/system/user",E()({method:"PUT",headers:{"Content-Type":"application/jso
|