Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
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/json;charset=UTF-8"},data:a},_||{})));case 1:case"end":return d.stop()}},n)})),u.apply(this,arguments)}function r(n,a){return v.apply(this,arguments)}function v(){return v=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/".concat(a),E()({method:"DELETE"},_||{})));case 1:case"end":return d.stop()}},n)})),v.apply(this,arguments)}function j(n,a){return(0,b.su)("/api/system/user/export",{params:n},"user_".concat(new Date().getTime(),".xlsx"))}function U(n,a){var _={userId:n,status:a};return(0,i.request)("/api/system/user/changeStatus",{method:"put",data:_})}function t(){return request("/api/system/user/profile",{method:"get"})}function x(n){return(0,i.request)("/api/system/user/profile",{method:"put",data:n})}function A(n,a){var _={userId:n,password:a};return(0,i.request)("/api/system/user/resetPwd",{method:"put",data:_})}function H(n,a){var _={oldPassword:n,newPassword:a};return(0,i.request)("/api/system/user/profile/updatePwd",{method:"put",params:_})}function T(n){return(0,i.request)("/api/system/user/profile/avatar",{method:"post",data:n})}function l(n){return request("/system/user/authRole/"+n,{method:"get"})}function S(n){return(0,i.request)("/system/user/authRole",{method:"put",params:n})}function w(n){return new Promise(function(a){(0,i.request)("/api/system/user/deptTree",{method:"get",params:n}).then(function(_){if(_&&_.code===200){var R=(0,c.lt)(_.data);a(R)}else a([])})})}},30964:function(Z,h,e){e.d(h,{p6:function(){return L},su:function(){return o}});var O=e(15009),p=e.n(O),y=e(97857),E=e.n(y),I=e(99289),g=e.n(I),c=e(76772),i={xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",zip:"application/zip"};function b(m,P){var u=document.createElement("a"),r=new Blob([m.data],{type:P}),v=new RegExp("filename=([^;]+\\.[^\\.;]+);*"),j=decodeURI(m.headers["content-disposition"]),U=v.exec(j),t=U?U[1]:"file";t=t.replace(/"/g,""),u.style.display="none",u.href=URL.createObjectURL(r),u.setAttribute("download",t),document.body.appendChild(u),u.click(),URL.revokeObjectURL(u.href),document.body.removeChild(u)}function L(m){(0,c.request)(m,{method:"GET",responseType:"blob",getResponse:!0}).then(function(P){b(P,i.zip)})}function o(m,P,u){return D.apply(this,arguments)}function D(){return D=g()(p()().mark(function m(P,u,r){return p()().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return j.abrupt("return",(0,c.request)(P,E()(E()({},u),{},{method:"POST",responseType:"blob"})).then(function(U){var t=document.createElement("a"),x=U;t.style.display="none",t.href=URL.createObjectURL(x),t.setAttribute("download",r),document.body.appendChild(t),t.click(),URL.revokeObjectURL(t.href),document.body.removeChild(t)}));case 1:case"end":return j.stop()}},m)})),D.apply(this,arguments)}function C(m){window.location.href="/api/common/download?fileName=".concat(encodeURI(m),"&delete=",!0)}},31981:function(Z,h,e){e.d(h,{C2:function(){return p},lt:function(){return E}});var O=e(87735);function p(I,g,c,i,b,L){var o={id:g||"id",name:c||"name",parentId:i||"parentId",parentName:b||"parentName",childrenList:L||"children"},D=[],C=[],m=[];I.forEach(function(u){var r=u,v=r[o.parentId];D[v]||(D[v]=[]),r.key=r[o.id],r.title=r[o.name],r.value=r[o.id],r[o.childrenList]=null,C[r[o.id]]=r,D[v].push(r)}),I.forEach(function(u){var r=u,v=r[o.parentId];C[v]||(r[o.parentName]="",m.push(r))});function P(u){var r=u;D[r[o.id]]&&(r[o.childrenList]||(r[o.childrenList]=[]),r[o.childrenList]=D[r[o.id]]),r[o.childrenList]&&r[o.childrenList].forEach(function(v){var j=v;j[o.parentName]=r[o.name],P(j)})}return m.forEach(function(u){P(u)}),m}var y=function(){return parse(window.location.href.split("?")[1])};function E(I){var g=I.map(function(c){var i={id:c.id,title:c.label,key:"".concat(c.id),value:c.id};return c.children&&(i.children=E(c.children)),i});return g}},68906:function(Z,h,e){e.r(h)},15746:function(Z,h,e){var O=e(21584);h.Z=O.Z},71230:function(Z,h,e){var O=e(17621);h.Z=O.Z}}]);
|