filesbox/web/dist/97959.bfcdc2f2.async.js

2 lines
26 KiB
JavaScript
Raw Normal View History

2024-07-26 06:10:54 +00:00
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[97959],{11228:function(t){t.exports={wallpaperBox:"wallpaperBox___zF6HO",wallpaperImg:"wallpaperImg___38uzU",wallpaperUrl:"wallpaperUrl___2Wm9B"}},73651:function(t,m,A){"use strict";var T=A(20136),v=A(55241),W=A(67294),M=A(53390),E=A(85893),r=o=>{var d=o.color,f=o.setColor;return(0,E.jsx)(v.Z,{trigger:"click",placement:"right",content:(0,E.jsx)(M.xS,{color:d,onChangeComplete:C=>{var c=C.hex;return f(c)}}),children:(0,E.jsx)("i",{className:"colorIco",style:{background:d||"#fff"}})})};m.Z=r},97959:function(t,m,A){"use strict";var T=A(22385),v=A(45777),W=A(91220),M=A(34792),E=A(48086),r=A(2824),o=A(67294),d=A(30672),f=A(96486),C=A.n(f),c=A(5966),K=A(91033),n=A(85483),R=A(79508),g=A(34436),G=A(73651),s=A(27931),B=A(97694),I=A.n(B),Z=A(11228),p=A.n(Z),l=A(85893),y="personal",b=()=>{var N,P=(0,d.YB)(),q=(0,o.useRef)(null),J=(0,d.I0)(),V=(0,d.tT)("@@initialState"),Y=V.initialState,k=Y===void 0?{}:Y,_=V.refresh,$=(N=k.currentUser)!==null&&N!==void 0?N:{},U=$.desktopBackImg,AA=(0,o.useState)(-1),Q=(0,r.Z)(AA,2),sA=Q[0],z=Q[1],aA=(0,o.useState)(-1),L=(0,r.Z)(aA,2),lA=L[0],X=L[1],eA=(0,o.useState)(0),S=(0,r.Z)(eA,2),nA=S[0],tA=S[1],oA=(0,o.useState)(""),w=(0,r.Z)(oA,2),rA=w[0],h=w[1],u=a=>{J({type:"".concat(y,"/setUserInfo"),payload:{key:"desktopBackgroundImg",value:a},callback:()=>{H(a),E.ZP.success(P.formatMessage({id:"explorer.success"})),_()}})},F=()=>{var a=Math.floor(Math.random()*g.u7.length),e="".concat(g.u7[a]);if(a==lA){F();return}X(a),u(e)},H=a=>{var e=g.u7.indexOf(a);z(e),X(e),h(""),e==-1&&a.slice(0,1)=="#"&&h(a)},dA=new K.Z((a,e)=>{var i=(0,W.Z)(a),O;try{for(i.s();!(O=i.n()).done;){var j=O.value,x=j.contentRect.width,D=(0,s.uw)(x,140);tA(D)}}catch(iA){i.e(iA)}finally{i.f()}});return(0,o.useEffect)(()=>{U?H(U):(z(0),X(0))},[]),(0,o.useEffect)(()=>{var a=document.querySelector("#wallpaperBox");!a||dA.observe(a)},[]),(0,l.jsxs)("div",{className:p().wallpaperBox,id:"wallpaperBox",children:[(0,l.jsxs)("div",{className:p().wallpaperUrl,children:[(0,l.jsx)("h3",{className:"wallH3",children:P.formatMessage({id:"personal-solidColor",defaultMessage:"\u7EAF\u8272"})}),(0,l.jsx)("div",{className:"colorWallpaper",children:(0,l.jsx)("div",{className:"colorBox",children:(0,l.jsx)(G.Z,{color:rA,setColor:a=>{h(a),u(a)}})})}),(0,l.jsx)("h3",{className:"wallH3",children:P.formatMessage({id:"common.diy",defaultMessage:"\u81EA\u5B9A\u4E49"})}),(0,l.jsx)(c.Z,{addonBefore:"URL",addonAfter:(0,l.jsx)(v.Z,{title:P.formatMessage({id:"user.wall.random",defaultMessage:"\u968F\u673A\u58C1\u7EB8"}),children:(0,l.jsx)("img",{src:I(),height:26,style:{cursor:"pointer"},onClick:F})}),fieldProps:{ref:q,className:"urlInput",onChange:(0,f.debounce)(a=>{var e=a.target.value;e&&u(e)},1e3),addonAfter:(0,l.jsx)("span",{className:"fillSelect",onClick:()=>{window.fileBoxApi.fileSelect({title:P.formatMessage({id:"explorer.selectImage",defaultMessage:"\u8BF7\u9009\u62E9\u56FE\u7247"}),type:"file",allowExt:"png,jpg,gif,jpeg,ico,svg",callback:function(e){var i,O=e.data,j=O===void 0?{}:O,x=j.selectItems,D=x===void 0?[]:x;D!=null&&D.length&&(i=D[0])!==null&&i!==void 0&&i.path&&u("".concat("").concat(D[0].path))}})},children:(0,l.jsx)(n.Z,{})})}})]}),(0,l.jsx)("h3",{className:"wallH3",children:P.formatMessage({id:"personal-backimg",defaultMessage:"\u80CC\u666F\u56FE"})}),(0,l.jsx)("div",{className:p().wallpaperImg,children:g.u7.map((a,e)=>(0,l.jsx)("div",{className:"listBox",style:{margin:"0 ".concat(nA,"px 15px")},children:(0,l.jsxs)("div",{className:"list ".concat(sA==e?"active":""),onClick:()=>{u(a)},children:[(0,l.jsx)("span",{className:"lt",children:(0,l.jsx)("div",{className:"selectIcon",children:(0,l.jsx)(R.Z,{})})}),(0,l.jsx)("div",{className:"ico",children:(0,l.jsx)("img",{src:g.v2[e]})}),(0,l.jsx)("div",{className:"info",children:e+1})]},e)}))})]})};m.Z=b},27931:function(t,m,A){"use strict";A.d(m,{Vv:function(){return R},ml:function(){return g},uw:function(){return G}});var T=A(93834),v=A(50031),W=A(23935),M=A(68231),E=A(39214),r=A(85602),o=A(75704),d=A.n(o),f=A(59294),C=A.n(f),c=A(