2 lines
9.7 KiB
JavaScript
2 lines
9.7 KiB
JavaScript
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[85433],{16695:function(){},85433:function(Ie,U,n){"use strict";n.r(U),n.d(U,{default:function(){return Ee}});var W=n(20228),O=n(11382),q=n(13254),p=n(14277),S=n(11849),o=n(32157),ee=n(82363),pe=n(67294),z=n(28216),te=n(66615),ye=n.n(te),K=n(85893),w,V,k=ee.Z.TreeNode,ne=ee.Z.DirectoryTree,he=I=>I&&I.length>0?"\uFF08".concat(I.length,"\uFF09"):"",Ee=(w=(0,z.$j)(I=>{var i=I.page,l=I.commondesign,_=I.loading;return{page:i,commondesign:l,loading:_.effects["page/listAllSetting"]}}),w(V=class extends pe.Component{constructor(){super(...arguments);this.state={infoSelect:[],informationClassify:[],infoExpandedKeys:[]},this.getListHomepageInfo=(i,l)=>{var _=this,C=this.props,M=C.page,G=C.dispatch,h=this.state.informationClassify;if(!i.ajaxData){var v=i.typeName;i.typeName=v+" ( \u52A0\u8F7D\u4E2D )",this.setState({informationClassify:[...h]}),i.ajaxData=!0,G({type:"page/listHomepageInfo",payload:{InfoTypeId:i.infoTypeID,currentPage:1,pageSize:200},callback:E=>{if(E.success){var Z=Array.isArray(E.data.list)?E.data.list:[];i.typeName=v,i.children||(i.children=[]),i.children=[...i.children,...Z],this.setState({informationClassify:[...M.informationClassify]},()=>{l&&l()})}}})}},this.show=()=>{var i=this,l=this.props,_=l.commondesign,C=l.page,M=_.Href.dataHref,G=this.state.informationClassify,h="";if(M){var v=JSON.parse(M);switch(v.hrefType){case"infoClassify":h=v.data.infoTypeID+"",i.setState({infoValue:v.data.infoValue||"1",infoSelect:[h],infoExpandedKeys:v.data.infoExpandedKeys});break;case"information":h=v.data.infoID+"",i.setState({infoSelect:[h],infoExpandedKeys:v.data.infoExpandedKeys},()=>{var E=v.data.infoTypeID,Z=$=>{$.forEach(R=>{parseInt(R.infoTypeID)==parseInt(E)?i.getListHomepageInfo(R):R.children&&Z(R.children)})};Z(C.informationClassify)});break}}}}componentDidMount(){var i=this,l=this.props,_=l.dispatch,C=l.page,M=l.typeId;_({type:"page/listAllSetting",payload:{showCount:1},callback:()=>{this.getListHomepageInfo({},()=>{i.show()})}})}render(){var i=this,l=this.props,_=l.value,C=l.onChange,M=C===void 0?()=>{}:C,G=l.page,h=l.infoValue,v=l.loading,E=this.state,Z=E.infoExpandedKeys,$=E.informationClassify,R=E.infoSelect,ae=x=>x.map(c=>c.children?(0,K.jsx)(k,{title:c.typeName+he(c.children),item:{data:c,hrefType:"infoClassify"},children:ae(c.children)},c.infoTypeID+""):c.infoID?(0,K.jsx)(k,{title:c.title,item:{data:c,hrefType:"information"},isLeaf:!0},c.infoID+""):(0,K.jsx)(k,{title:c.typeName,item:{data:c,hrefType:"infoClassify"}},c.infoTypeID+"")),re=(x,c)=>{var g=c.node.props.item;this.setState({infoSelect:c.selected?x:[]}),g.hrefType=="infoClassify"&&i.getListHomepageInfo(g.data),g.data=(0,S.Z)((0,S.Z)({},g.data),{},{keys:x,infoExpandedKeys:Z}),g.hrefType=="infoClassify"&&(g.data.infoValue=h),M({valueItem:c.selected?g:"",value:x})},m=x=>{this.setState({infoExpandedKeys:x})};return(0,K.jsx)("div",{className:ye().shop,children:(0,K.jsx)(O.Z,{spinning:v,children:(0,K.jsxs)("div",{className:"conBox",children:[(0,K.jsx)(ne,{expandedKeys:Z,selectedKeys:R,onSelect:re,onExpand:m,children:ae($)}),$.length<1?(0,K.jsx)(p.Z,{image:p.Z.PRESENTED_IMAGE_SIMPLE,style:{marginTop:180,opacity:v?0:1}}):""]})})})}})||V)},82363:function(Ie,U,n){"use strict";n.d(U,{Z:function(){return Ae}});var W=n(93549),O=n(96156),q=n(90484),p=n(22122),S=n(28991),o=n(67294),ee={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},pe=ee,z=n(27029),te=function(r,a){return o.createElement(z.Z,(0,S.Z)((0,S.Z)({},r),{},{ref:a,icon:pe}))};te.displayName="HolderOutlined";var ye=o.forwardRef(te),K=n(94184),w=n.n(K),V=n(53124),k=n(33603),ne=4;function he(e){var r,a=e.dropPosition,s=e.dropLevelOffset,d=e.prefixCls,f=e.indent,t=e.direction,D=t===void 0?"ltr":t,u=D==="ltr"?"left":"right",j=D==="ltr"?"right":"left",P=(r={},(0,O.Z)(r,u,-s*f+ne),(0,O.Z)(r,j,0),r);switch(a){case-1:P.top=-3;break;case 1:P.bottom=-3;break;default:P.bottom=-3,P[u]=f+ne;break}return o.createElement("div",{style:P,className:"".concat(d,"-drop-indicator")})}var Ee=n(6324),I=o.forwardRef(function(e,r){var a,s=o.useContext(V.E_),d=s.getPrefixCls,f=s.direction,t=s.virtual,D=e.prefixCls,u=e.className,j=e.showIcon,P=j===void 0?!1:j,J=e.showLine,xe=e.switcherIcon,Q=e.blockNode,se=Q===void 0?!1:Q,oe=e.children,X=e.checkable,B=X===void 0?!1:X,ie=e.selectable,Y=ie===void 0?!0:ie,b=e.draggable,le=e.motion,ge=le===void 0?(0,p.Z)((0,p.Z)({},k.ZP),{motionAppear:!1}):le,N=d("tree",D),Oe=(0,p.Z)((0,p.Z)({},e),{checkable:B,selectable:Y,showIcon:P,motion:ge,blockNode:se,showLine:Boolean(J),dropIndicatorRender:he}),de=o.useMemo(function(){if(!b)return!1;var A={};switch((0,q.Z)(b)){case"function":A.nodeDraggable=b;break;case"object":A=(0,p.Z)({},b);break;default:break}return A.icon!==!1&&(A.icon=A.icon||o.createElement(ye,null)),A},[b]);return o.createElement(W.Z,(0,p.Z)({itemHeight:20,ref:r,virtual:t},Oe,{prefixCls:N,className:w()((a={},(0,O.Z)(a,"".concat(N,"-icon-hide"),!P),(0,O.Z)(a,"".concat(N,"-block-node"),se),(0,O.Z)(a,"".concat(N,"-unselectable"),!Y),(0,O.Z)(a,"".concat(N,"-rtl"),f==="rtl"),a),u),direction:f,checkable:B&&o.createElement("span",{className:"".concat(N,"-checkbox-inner")}),selectable:Y,switcherIcon:function(ce){return(0,Ee.Z)(N,xe,J,ce)},draggable:de}),oe)}),i=I,l=n(85061),_=n(28481),C=n(88637),M={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},G=M,h=function(r,a){return o.createElement(z.Z,(0,S.Z)((0,S.Z)({},r),{},{ref:a,icon:G}))};h.displayName="FolderOpenOutlined";var v=o.forwardRef(h),E={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},Z=E,$=function(r,a){return o.createElement(z.Z,(0,S.Z)((0,S.Z)({},r),{},{ref:a,icon:Z}))};$.displayName="FolderOutlined";var R=o.forwardRef($),ae=n(10225),re=n(1089),m;(function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"})(m||(m={}));function x(e,r){function a(s){var d=s.key,f=s.children;r(d,s)!==!1&&x(f||[],r)}e.forEach(a)}function c(e){var r=e.treeData,a=e.expandedKeys,s=e.startKey,d=e.endKey,f=[],t=m.None;if(s&&s===d)return[s];if(!s||!d)return[];function D(u){return u===s||u===d}return x(r,function(u){if(t===m.End)return!1;if(D(u)){if(f.push(u),t===m.None)t=m.Start;else if(t===m.Start)return t=m.End,!1}else t===m.Start&&f.push(u);return a.includes(u)}),f}function g(e,r){var a=(0,l.Z)(r),s=[];return x(e,function(d,f){var t=a.indexOf(d);return t!==-1&&(s.push(f),a.splice(t,1)),!!a.length}),s}var _e=function(e,r){var a={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(a[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,s=Object.getOwnPropertySymbols(e);d<s.length;d++)r.indexOf(s[d])<0&&Object.prototype.propertyIsEnumerable.call(e,s[d])&&(a[s[d]]=e[s[d]]);return a};function Se(e){var r=e.isLeaf,a=e.expanded;return r?o.createElement(C.Z,null):a?o.createElement(v,null):o.createElement(R,null)}function Ce(e){var r=e.treeData,a=e.children;return r||(0,re.zn)(a)}var Me=function(r,a){var s=r.defaultExpandAll,d=r.defaultExpandParent,f=r.defaultExpandedKeys,t=_e(r,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]),D=o.useRef(),u=o.useRef(),j=function(){var F=(0,re.I8)(Ce(t)),H=F.keyEntities,y;return s?y=Object.keys(H):d?y=(0,ae.r7)(t.expandedKeys||f||[],H):y=t.expandedKeys||f,y},P=o.useState(t.selectedKeys||t.defaultSelectedKeys||[]),J=(0,_.Z)(P,2),xe=J[0],Q=J[1],se=o.useState(function(){return j()}),oe=(0,_.Z)(se,2),X=oe[0],B=oe[1];o.useEffect(function(){"selectedKeys"in t&&Q(t.selectedKeys)},[t.selectedKeys]),o.useEffect(function(){"expandedKeys"in t&&B(t.expandedKeys)},[t.expandedKeys]);var ie=function(F,H){var y;return"expandedKeys"in t||B(F),(y=t.onExpand)===null||y===void 0?void 0:y.call(t,F,H)},Y=function(F,H){var y,Pe=t.multiple,He=H.node,L=H.nativeEvent,Te=He.key,fe=Te===void 0?"":Te,ue=Ce(t),ve=(0,p.Z)((0,p.Z)({},H),{selected:!0}),$e=(L==null?void 0:L.ctrlKey)||(L==null?void 0:L.metaKey),je=L==null?void 0:L.shiftKey,T;Pe&&$e?(T=F,D.current=fe,u.current=T,ve.selectedNodes=g(ue,T)):Pe&&je?(T=Array.from(new Set([].concat((0,l.Z)(u.current||[]),(0,l.Z)(c({treeData:ue,expandedKeys:X,startKey:fe,endKey:D.current}))))),ve.selectedNodes=g(ue,T)):(T=[fe],D.current=fe,u.current=T,ve.selectedNodes=g(ue,T)),(y=t.onSelect)===null||y===void 0||y.call(t,T,ve),"selectedKeys"in t||Q(T)},b=o.useContext(V.E_),le=b.getPrefixCls,ge=b.direction,N=t.prefixCls,Oe=t.className,de=t.showIcon,A=de===void 0?!0:de,ce=t.expandAction,Le=ce===void 0?"click":ce,Re=_e(t,["prefixCls","className","showIcon","expandAction"]),Ke=le("tree",N),be=w()("".concat(Ke,"-directory"),(0,O.Z)({},"".concat(Ke,"-directory-rtl"),ge==="rtl"),Oe);return o.createElement(i,(0,p.Z)({icon:Se,ref:a,blockNode:!0},Re,{showIcon:A,expandAction:Le,prefixCls:Ke,className:be,expandedKeys:X,selectedKeys:xe,onSelect:Y,onExpand:ie}))},Ze=o.forwardRef(Me),Ne=Ze,me=i;me.DirectoryTree=Ne,me.TreeNode=W.O;var Ae=me},32157:function(Ie,U,n){"use strict";var W=n(38663),O=n.n(W),q=n(16695),p=n.n(q)}}]);
|