filesbox/web/dist/76915.cf0c3d2b.async.js
2024-07-26 14:10:54 +08:00

2 lines
14 KiB
JavaScript

(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[76915],{96278:function(X){X.exports={root:"root___7VXfh",colorWeak:"colorWeak___2fQ5G","ant-layout":"ant-layout___2lk2i",globalSpin:"globalSpin___3wjkL","ant-table":"ant-table___3MoMQ","ant-table-thead":"ant-table-thead___2F4eD","ant-table-tbody":"ant-table-tbody___1iFAX",formBox:"formBox___1MR6m",hrefModal:"hrefModal___GOUPi",shop:"shop___3KrmS"}},64752:function(){},76915:function(X,V,e){"use strict";e.r(V),e.d(V,{default:function(){return P}});var A=e(43358),N=e(34041),J=e(34792),L=e(48086),se=e(71194),c=e(50146),q=e(63185),ee=e(9676),U=e(57663),Q=e(71577),ne=e(47673),$=e(4107),I=e(67294),te=e(49101),F=e(73218),S=e(28216),m=e(96278),o=e.n(m),O=e(41273),T=e(56173),k=e(30672),t=e(85893),W,g,r=$.Z.TextArea,P=(W=(0,S.$j)(n=>{var a=n.commondesign,_=n.globaldesign;return{commondesign:a,globaldesign:_}}),W(g=class extends I.PureComponent{constructor(){super(...arguments);this.state={visible:!1,type:"static",list:[],marginLeft:0,editModel:!1,editsrc:"",editHref:"",editdesc:"",edittarget:""},this.updataDomCallBack=a=>{for(var _=this.props.commondesign,f=_.Suspend,d=f.element,b=f.callback,y=f.callClose,E="",h=a.list,p=0,M=h.length<5?h.length:5;p<M;p++){var x=h[p];x.href?E+='<a href="'+x.href+'" target="'+(x.target?x.target:"_self")+'"><img src="'+x.path+'"/></a>':E+='<img src="'+x.path+'" />'}var D=d.find(".box");D.remove(),d.append('<div class="box">'.concat(E,"</div>")),d.css("height","auto"),d.attr("data-suspend",JSON.stringify(a))},this.show=a=>{a?(a=JSON.parse(a),this.setState({list:a.list,type:a.type,marginLeft:0})):this.setState({list:[],type:"static",marginLeft:0})},this.renderEditModal=()=>{var a=this,_=a.props.dispatch,f=this.state,d=f.editModel,b=f.editsrc,y=f.editHref,E=f.editdesc,h=f.edittarget,p=f.list,M=()=>{var v=p;v[this.index]={src:b,href:y||"",desc:E||"",target:h||""},this.setState({list:v,editModel:!1,editsrc:"",editHref:"",editdesc:"",edittarget:""})},x=()=>{this.setState({editModel:!1})},D=this.index==0,u=this.index==p.length-1,i=()=>{if(this.index>0){this.index--;var v=p[this.index];this.setState({editsrc:v.path,editHref:v.href||"",editdesc:v.desc||"",edittarget:v.target||""})}},l=()=>{if(this.index<p.length-1){this.index++;var v=p[this.index];this.setState({editsrc:v.path,editHref:v.href||"",editdesc:v.desc||"",edittarget:v.target||""})}},C=v=>{this.setState({editHref:v})},s=v=>{this.setState({editdesc:v.target.value})},B=()=>{_({type:"commondesign/setState",payload:{Href:{visible:!0,type:{course:!0,information:!0,link:!0,dialog:!0,page:!0,member:!0,shop:!0,forum:!0,question:!0},typex:!1,callback:v=>{var G=(0,T.wS)(v,a),z=G.url;a.setState({editHref:z||""})}}}})},H=v=>{this.setState({edittarget:v.target.value})};return(0,t.jsxs)(c.Z,{title:"\u7F16\u8F91\u56FE\u7247",visible:d,onOk:M,width:520,onCancel:x,maskClosable:!1,className:o().hrefModal,children:[(0,t.jsx)("div",{className:"editImgbox",children:(0,t.jsxs)("div",{className:"viewer-content",children:[(0,t.jsx)("div",{className:"leftbtn2 "+(D?"disabled":""),onClick:i}),(0,t.jsx)("img",{src:b}),(0,t.jsx)("div",{className:"rightbtn2 "+(u?"disabled":""),onClick:l})]})}),(0,t.jsxs)("div",{className:"item-label",children:[(0,t.jsx)("div",{className:"labelName",children:"\u56FE\u7247\u94FE\u63A5\uFF1A"}),(0,t.jsxs)("div",{className:"itemContent",children:[(0,t.jsx)($.Z,{style:{width:205,marginRight:10},value:y,onChange:C}),(0,t.jsx)(Q.Z,{onClick:B,children:"\u8BBE\u7F6E\u94FE\u63A5"})]})]}),(0,t.jsxs)("div",{className:"item-label",children:[(0,t.jsx)("div",{className:"labelName",children:"\u56FE\u7247\u63CF\u8FF0\uFF1A"}),(0,t.jsx)("div",{className:"itemContent",children:(0,t.jsx)(r,{autosize:{minRows:3,maxRows:3},style:{width:303},value:E,onChange:s})})]}),(0,t.jsxs)("div",{className:"item-label",children:[(0,t.jsx)("div",{className:"labelName",children:"\u6253\u5F00\u65B9\u5F0F\uFF1A"}),(0,t.jsx)("div",{className:"itemContent",children:(0,t.jsx)(ee.Z,{onChange:H,checked:h=="_blank",value:"_blank",children:"\u65B0\u7A97\u53E3"})})]})]})},this.renderSeletPictrue=()=>{var a=this,_=this.props.dispatch,f=this.state,d=f.list,b=f.marginLeft,y=(0,k.lw)((0,k.Kd)()),E=i=>{var l=this.refs.banliBox,C=l.currentStyle?l.currentStyle:window.getComputedStyle(l,null);if(parseInt(C.marginLeft)!=0){var s=parseInt(C.marginLeft)+733;s>0&&(s=0),this.setState({marginLeft:s}),l.style.marginLeft=s+"px"}},h=i=>{var l=this.refs.banliBox,C=l.currentStyle?l.currentStyle:window.getComputedStyle(l,null),s=733-l.offsetWidth;if(parseInt(l.style.marginLeft)!=s){var B=parseInt(C.marginLeft)-733;B<s&&(B=s),this.setState({marginLeft:B}),l.style.marginLeft=B+"px"}},p=b==0,M=b==733-d.length*148,x=()=>{var i=this.state.list;window.fileBoxApi.fileSelect({title:y.formatMessage({id:"explorer.selectImage"}),type:"file",single:!1,allowExt:"jpg,jpeg,png",callback:function(C){var s=C.data||{},B=s.selectIds.length?s.selectItems||[]:[];a.setState({list:[...i,...B]})}})},D=i=>{var l=[...d];l.splice(i,1),this.setState({list:l})},u=(i,l)=>{var C=this.state,s=C.editModel,B=C.editsrc,H=C.editHref,v=C.editdesc,G=C.edittarget;this.index=l,this.setState({editModel:!0,editsrc:i.path,editHref:i.href||"",editdesc:i.desc||"",edittarget:i.target||""})};return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"label",children:["\u6DFB\u52A0\uFF1A",d.length>0?(0,t.jsxs)("div",{className:"timsg",style:{right:"-832",bottom:"-14"},children:["\u56FE\u7247\u5DF2\u4E0A\u4F20 ",d.length," \u5F20\uFF0C( \u60AC\u6D6E\u5E7F\u544A\u663E\u793A\u4E0D\u8D85\u8FC75\u5F20\u56FE\u7247 )\u3002"]}):""]}),(0,t.jsxs)("div",{className:"banContent",children:[d.length>5?(0,t.jsx)("div",{className:"leftBtn "+(p?"disabled":""),onClick:E}):"",(0,t.jsxs)("div",{className:"bannerBox",children:[(0,t.jsx)("div",{className:"add banli",onClick:x,style:d.length==0?{width:875}:{},children:(0,t.jsx)(te.Z,{})}),(0,t.jsx)("div",{className:"banul",children:(0,t.jsx)("div",{className:"banliBox",style:{width:d.length*148},ref:"banliBox",children:d.map((i,l)=>(0,t.jsxs)("div",{className:"banli",children:[(0,t.jsx)("img",{src:i.path}),(0,t.jsx)("div",{className:"close",onClick:C=>D(l),children:(0,t.jsx)(F.Z,{})}),(0,t.jsx)("div",{className:"edit",onClick:C=>u(i,l)})]},l))})})]}),d.length>5?(0,t.jsx)("div",{className:"rightBtn "+(M?"disabled":""),onClick:h}):""]}),this.renderEditModal()]})},this.cancelEvent=()=>{var a=this,_=this.props.dispatch;_({type:"commondesign/setState",payload:{Suspend:{visible:!1,callback:()=>{},callClose:()=>{}}}})}}componentDidMount(){var a=this.props.commondesign,_=a.Suspend,f=_.visible,d=_.element,b=_.callback,y=_.callClose;this.setState({visible:f});var E=d.attr("data-suspend");this.show(E)}render(){var a=this,_=this.props,f=_.dispatch,d=_.commondesign,b=d.Suspend.callback,y=this.state,E=y.visible,h=y.type,p=y.list,M=u=>{a.cancelEvent()},x=u=>{if(p.length>0){var i={list:p,type:h};a.updataDomCallBack(i),b&&b(i),a.cancelEvent()}else L.ZP.error("\u8BF7\u6DFB\u52A0\u5E7F\u544A")},D=u=>{this.setState({type:u})};return(0,t.jsx)(c.Z,{title:"\u60AC\u6D6E\u5E7F\u544A",visible:E,onOk:x,width:1e3,onCancel:M,maskClosable:!1,className:o().hrefModal,children:(0,t.jsxs)("div",{className:"divRow",children:[(0,t.jsx)("div",{className:"label",children:"\u60AC\u6D6E\u65B9\u5F0F\uFF1A"}),(0,t.jsx)("div",{className:"content",children:(0,t.jsxs)(N.Z,{value:h,onChange:D,style:{width:200},children:[(0,t.jsx)(Option,{value:"static",children:"\u9759\u6001\u60AC\u6D6E"}),(0,t.jsx)(Option,{value:"dynamic",children:"\u52A8\u6001\u60AC\u6D6E"})]})}),this.renderSeletPictrue()]})})}})||g)},9676:function(X,V,e){"use strict";e.d(V,{Z:function(){return W}});var A=e(96156),N=e(22122),J=e(94184),L=e.n(J),se=e(50132),c=e(67294),q=e(53124),ee=e(65223),U=e(85061),Q=e(28481),ne=e(98423),$=function(g,r){var P={};for(var n in g)Object.prototype.hasOwnProperty.call(g,n)&&r.indexOf(n)<0&&(P[n]=g[n]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(g);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(g,n[a])&&(P[n[a]]=g[n[a]]);return P},I=c.createContext(null),te=function(r,P){var n=r.defaultValue,a=r.children,_=r.options,f=_===void 0?[]:_,d=r.prefixCls,b=r.className,y=r.style,E=r.onChange,h=$(r,["defaultValue","children","options","prefixCls","className","style","onChange"]),p=c.useContext(q.E_),M=p.getPrefixCls,x=p.direction,D=c.useState(h.value||n||[]),u=(0,Q.Z)(D,2),i=u[0],l=u[1],C=c.useState([]),s=(0,Q.Z)(C,2),B=s[0],H=s[1];c.useEffect(function(){"value"in h&&l(h.value||[])},[h.value]);var v=function(){return f.map(function(K){return typeof K=="string"||typeof K=="number"?{label:K,value:K}:K})},G=function(K){H(function(w){return w.filter(function(Y){return Y!==K})})},z=function(K){H(function(w){return[].concat((0,U.Z)(w),[K])})},R=function(K){var w=i.indexOf(K.value),Y=(0,U.Z)(i);w===-1?Y.push(K.value):Y.splice(w,1),"value"in h||l(Y);var de=v();E==null||E(Y.filter(function(ie){return B.includes(ie)}).sort(function(ie,ue){var ve=de.findIndex(function(oe){return oe.value===ie}),he=de.findIndex(function(oe){return oe.value===ue});return ve-he}))},Z=M("checkbox",d),ae="".concat(Z,"-group"),le=(0,ne.Z)(h,["value","disabled"]);f&&f.length>0&&(a=v().map(function(j){return c.createElement(k,{prefixCls:Z,key:j.value.toString(),disabled:"disabled"in j?j.disabled:h.disabled,value:j.value,checked:i.includes(j.value),onChange:j.onChange,className:"".concat(ae,"-item"),style:j.style},j.label)}));var re={toggleOption:R,value:i,disabled:h.disabled,name:h.name,registerValue:z,cancelValue:G},ce=L()(ae,(0,A.Z)({},"".concat(ae,"-rtl"),x==="rtl"),b);return c.createElement("div",(0,N.Z)({className:ce,style:y},le,{ref:P}),c.createElement(I.Provider,{value:re},a))},F=c.forwardRef(te),S=c.memo(F),m=e(98866),o=function(g,r){var P={};for(var n in g)Object.prototype.hasOwnProperty.call(g,n)&&r.indexOf(n)<0&&(P[n]=g[n]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(g);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(g,n[a])&&(P[n[a]]=g[n[a]]);return P},O=function(r,P){var n,a,_=r.prefixCls,f=r.className,d=r.children,b=r.indeterminate,y=b===void 0?!1:b,E=r.style,h=r.onMouseEnter,p=r.onMouseLeave,M=r.skipGroup,x=M===void 0?!1:M,D=r.disabled,u=o(r,["prefixCls","className","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),i=c.useContext(q.E_),l=i.getPrefixCls,C=i.direction,s=c.useContext(I),B=(0,c.useContext)(ee.aM),H=B.isFormItemInput,v=(0,c.useContext)(m.Z),G=(a=(s==null?void 0:s.disabled)||D)!==null&&a!==void 0?a:v,z=c.useRef(u.value);c.useEffect(function(){s==null||s.registerValue(u.value)},[]),c.useEffect(function(){if(!x)return u.value!==z.current&&(s==null||s.cancelValue(z.current),s==null||s.registerValue(u.value),z.current=u.value),function(){return s==null?void 0:s.cancelValue(u.value)}},[u.value]);var R=l("checkbox",_),Z=(0,N.Z)({},u);s&&!x&&(Z.onChange=function(){u.onChange&&u.onChange.apply(u,arguments),s.toggleOption&&s.toggleOption({label:d,value:u.value})},Z.name=s.name,Z.checked=s.value.includes(u.value));var ae=L()((n={},(0,A.Z)(n,"".concat(R,"-wrapper"),!0),(0,A.Z)(n,"".concat(R,"-rtl"),C==="rtl"),(0,A.Z)(n,"".concat(R,"-wrapper-checked"),Z.checked),(0,A.Z)(n,"".concat(R,"-wrapper-disabled"),G),(0,A.Z)(n,"".concat(R,"-wrapper-in-form-item"),H),n),f),le=L()((0,A.Z)({},"".concat(R,"-indeterminate"),y)),re=y?"mixed":void 0;return c.createElement("label",{className:ae,style:E,onMouseEnter:h,onMouseLeave:p},c.createElement(se.Z,(0,N.Z)({"aria-checked":re},Z,{prefixCls:R,className:le,disabled:G,ref:P})),d!==void 0&&c.createElement("span",null,d))},T=c.forwardRef(O),k=T,t=k;t.Group=S,t.__ANT_CHECKBOX=!0;var W=t},63185:function(X,V,e){"use strict";var A=e(38663),N=e.n(A),J=e(64752),L=e.n(J)},50132:function(X,V,e){"use strict";var A=e(22122),N=e(96156),J=e(81253),L=e(28991),se=e(6610),c=e(5991),q=e(10379),ee=e(54070),U=e(67294),Q=e(94184),ne=e.n(Q),$=function(I){(0,q.Z)(F,I);var te=(0,ee.Z)(F);function F(S){var m;(0,se.Z)(this,F),m=te.call(this,S),m.handleChange=function(O){var T=m.props,k=T.disabled,t=T.onChange;k||("checked"in m.props||m.setState({checked:O.target.checked}),t&&t({target:(0,L.Z)((0,L.Z)({},m.props),{},{checked:O.target.checked}),stopPropagation:function(){O.stopPropagation()},preventDefault:function(){O.preventDefault()},nativeEvent:O.nativeEvent}))},m.saveInput=function(O){m.input=O};var o="checked"in S?S.checked:S.defaultChecked;return m.state={checked:o},m}return(0,c.Z)(F,[{key:"focus",value:function(){this.input.focus()}},{key:"blur",value:function(){this.input.blur()}},{key:"render",value:function(){var m,o=this.props,O=o.prefixCls,T=o.className,k=o.style,t=o.name,W=o.id,g=o.type,r=o.disabled,P=o.readOnly,n=o.tabIndex,a=o.onClick,_=o.onFocus,f=o.onBlur,d=o.onKeyDown,b=o.onKeyPress,y=o.onKeyUp,E=o.autoFocus,h=o.value,p=o.required,M=(0,J.Z)(o,["prefixCls","className","style","name","id","type","disabled","readOnly","tabIndex","onClick","onFocus","onBlur","onKeyDown","onKeyPress","onKeyUp","autoFocus","value","required"]),x=Object.keys(M).reduce(function(i,l){return(l.substr(0,5)==="aria-"||l.substr(0,5)==="data-"||l==="role")&&(i[l]=M[l]),i},{}),D=this.state.checked,u=ne()(O,T,(m={},(0,N.Z)(m,"".concat(O,"-checked"),D),(0,N.Z)(m,"".concat(O,"-disabled"),r),m));return U.createElement("span",{className:u,style:k},U.createElement("input",(0,A.Z)({name:t,id:W,type:g,required:p,readOnly:P,disabled:r,tabIndex:n,className:"".concat(O,"-input"),checked:!!D,onClick:a,onFocus:_,onBlur:f,onKeyUp:y,onKeyDown:d,onKeyPress:b,onChange:this.handleChange,autoFocus:E,ref:this.saveInput,value:h},x)),U.createElement("span",{className:"".concat(O,"-inner")}))}}],[{key:"getDerivedStateFromProps",value:function(m,o){return"checked"in m?(0,L.Z)((0,L.Z)({},o),{},{checked:m.checked}):null}}]),F}(U.Component);$.defaultProps={prefixCls:"rc-checkbox",className:"",style:{},type:"checkbox",defaultChecked:!1,onFocus:function(){},onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){}},V.Z=$}}]);