|
- "use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[257],{54925:function(he,G,n){n.r(G),n.d(G,{default:function(){return t}});var k=n(15009),p=n.n(k),W=n(99289),i=n.n(W),L=n(5574),$=n.n(L),v=n(67294),q=n(15513),f=n(12029),z=n(51904),V=n(72269),_=n(86738),C=n(45360),X=n(71577),ee=n(5914),D=n(12096),re=n(71230),b=n(15746),ne=n(75205),F=n(34041),te=n(51042),A=n(74703),P=n(3579),e={},r=n(85893),o=function(){var c=(0,v.useState)(1),g=$()(c,2),H=g[0],x=g[1],y=(0,v.useState)(!1),I=$()(y,2),B=I[0],Z=I[1],T=(0,v.useState)({category:0,openType:0,parentId:"",name:"",icon:"",url:"",sort:0,isDisabled:!0,id:"",children:[]}),J=$()(T,2),ae=J[0],w=J[1],K=(0,v.useState)([]),M=$()(K,2),le=M[0],m=M[1],se=(0,v.useState)(""),Q=$()(se,2),oe=Q[0],N=Q[1],ue=f.Z.useForm(),ie=$()(ue,1),R=ie[0],U=(0,v.useRef)(),Y=[{title:"\u83DC\u5355\u540D\u79F0",dataIndex:"name"},{title:"\u83DC\u5355\u8DEF\u5F84",dataIndex:"url",search:!1},{title:"\u83DC\u5355\u56FE\u6807",dataIndex:"icon",search:!1,render:function(s,a){return(0,r.jsx)(r.Fragment,{children:a.icon&&v.createElement(A&&A[a.icon])})}},{title:"\u83DC\u5355\u7C7B\u578B",search:!1,dataIndex:"category",render:function(s,a){return(0,r.jsx)(r.Fragment,{children:function(){return a.category===1?(0,r.jsx)(z.Z,{color:"green",children:"\u83DC\u5355"}):a.category===2?(0,r.jsx)(z.Z,{color:"geekblue",children:"\u89C6\u56FE"}):(0,r.jsx)(z.Z,{color:"volcano",children:"\u529F\u80FD"})}()})}},{title:"\u662F\u5426\u7981\u7528",search:!1,dataIndex:"isDisabled",render:function(s,a){return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(V.Z,{disabled:!0,checked:a.isDisabled,checkedChildren:"\u662F",unCheckedChildren:"\u5426"})})}},{title:"\u64CD\u4F5C",valueType:"option",key:"option",render:function(s,a){return[(0,r.jsx)("a",{onClick:function(){w(a),R.setFieldsValue(a),Z(!0),N(a.parentId)},children:"\u7F16\u8F91"},"edit"),(0,r.jsx)(_.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u83DC\u5355\u5417\uFF1F",onConfirm:function(){return me(a)},okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,r.jsx)("a",{children:"\u5220\u9664"})},"sure")]}}],E=function(){var d=i()(p()().mark(function s(){var a,u;return p()().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,P.Ru.GetTreeGridModule();case 2:a=h.sent,a.statusCode===200?(m(fe(a.data)),(u=U.current)===null||u===void 0||u.reload()):C.ZP.error("\u83B7\u53D6\u83DC\u5355\u6811\u5931\u8D25");case 4:case"end":return h.stop()}},s)}));return function(){return d.apply(this,arguments)}}(),fe=function d(s){return s.forEach(function(a){a.title=a.name,a.value=a.id,a.children&&a.children.length>0?d(a.children):delete a.children}),s},ge=function(){var s={category:1,openType:0,parentId:"",name:"",icon:"",url:"",sort:0,isDisabled:!1,id:"",children:[]};w(s),R.setFieldsValue(s),Z(!0)},Ce=function(){var d=i()(p()().mark(function s(a){var u,S;return p()().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if(a.id!==""){j.next=7;break}return j.next=3,P.Ru.SaveCreateModule(a);case 3:u=j.sent,u.statusCode===200?(E(),Z(!1),C.ZP.success("\u65B0\u589E\u6210\u529F")):C.ZP.error(u.msg||"\u65B0\u589E\u5931\u8D25"),j.next=11;break;case 7:return j.next=9,P.Ru.SaveModifyModule(a);case 9:S=j.sent,S.statusCode===200?(E(),Z(!1),C.ZP.success("\u66F4\u65B0\u6210\u529F")):C.ZP.error(S.msg||"\u66F4\u65B0\u5931\u8D25");case 11:case"end":return j.stop()}},s)}));return function(a){return d.apply(this,arguments)}}(),me=function(){var d=i()(p()().mark(function s(a){var u;return p()().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,P.Ru.DeleteModule(a.id);case 2:u=h.sent,u.statusCode===200?(C.ZP.success("\u5220\u9664\u6210\u529F"),E()):C.ZP.error(u.msg||"\u5220\u9664\u5931\u8D25");case 4:case"end":return h.stop()}},s)}));return function(a){return d.apply(this,arguments)}}(),ve=function(s){N(s)};return(0,v.useEffect)(function(){E()},[]),(0,r.jsxs)("div",{className:e.container,children:[(0,r.jsx)(q.Z,{actionRef:U,columns:Y,cardBordered:!0,request:function(){var d=i()(p()().mark(function s(a){var u,S,h;return p()().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return u=JSON.parse(JSON.stringify(a)),delete u.current,delete u.pageSize,O.next=5,P.Ru.GetTreeGridModule(u);case 5:if(S=O.sent,h=S.data.filter(function(pe){var ce=!1;return Object.keys(u).length>0?Object.keys(u).forEach(function(de){pe[de].includes(u[de])&&(ce=!0)}):ce=!0,ce}),S.statusCode!==200){O.next=11;break}return O.abrupt("return",{data:h,success:!0});case 11:return C.ZP.error(S.errors||"\u83B7\u53D6\u83DC\u5355\u5217\u8868\u5931\u8D25"),O.abrupt("return",{data:[],success:!1});case 13:case"end":return O.stop()}},s)}));return function(s){return d.apply(this,arguments)}}(),rowKey:"id",search:{labelWidth:"auto"},options:{setting:{listsHeight:400}},pagination:{current:H,pageSize:10,showSizeChanger:!1,onChange:function(s){return x(s)}},dateFormatter:"string",headerTitle:"\u83DC\u5355\u7BA1\u7406",toolBarRender:function(){return[(0,r.jsx)(X.ZP,{icon:(0,r.jsx)(te.Z,{}),type:"primary",onClick:ge,children:"\u65B0\u5EFA"},"button")]}}),(0,r.jsx)(ee.Z,{maskClosable:!1,footer:null,width:1e3,title:ae.id?"\u7F16\u8F91\u83DC\u5355":"\u65B0\u5EFA\u83DC\u5355",open:B,onCancel:function(){return Z(!1)},children:(0,r.jsxs)(f.Z,{form:R,onFinish:Ce,children:[(0,r.jsx)(f.Z.Item,{name:"id",hidden:!0,children:(0,r.jsx)(D.Z,{})}),(0,r.jsxs)(re.Z,{gutter:20,children:[(0,r.jsx)(b.Z,{span:12,children:(0,r.jsx)(f.Z.Item,{name:"name",label:"\u83DC\u5355\u540D\u79F0",rules:[{required:!0,max:255}],children:(0,r.jsx)(D.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0"})})}),(0,r.jsx)(b.Z,{span:12,children:(0,r.jsx)(f.Z.Item,{name:"icon",label:"\u83DC\u5355\u56FE\u6807",children:(0,r.jsx)(D.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u56FE\u6807"})})}),(0,r.jsx)(b.Z,{span:12,children:(0,r.jsx)(f.Z.Item,{name:"url",label:"\u83DC\u5355\u8DEF\u5F84",rules:[{required:!0,max:255}],children:(0,r.jsx)(D.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u8DEF\u5F84"})})}),(0,r.jsx)(b.Z,{span:12,children:(0,r.jsx)(f.Z.Item,{name:"parentId",label:"\u4E0A\u7EA7\u83DC\u5355",children:(0,r.jsx)(ne.Z,{allowClear:!0,style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:le,value:oe,placeholder:"\u8BF7\u9009\u62E9\u4E0A\u7EA7\u83DC\u5355",onChange:ve})})}),(0,r.jsx)(b.Z,{span:12,children:(0,r.jsx)(f.Z.Item,{name:"category",label:"\u83DC\u5355\u7C7B\u578B",rules:[{required:!0}],children:(0,r.jsxs)(F.Z,{children:[(0,r.jsx)(F.Z.Option,{value:1,children:"\u83DC\u5355"}),(0,r.jsx)(F.Z.Option,{value:2,children:"\u89C6\u56FE"}),(0,r.jsx)(F.Z.Option,{value:3,children:"\u529F\u80FD"})]})})}),(0,r.jsx)(b.Z,{span:12,children:(0,r.jsx)(f.Z.Item,{name:"openType",label:"\u6253\u5F00\u65B9\u5F0F",rules:[{required:!0}],children:(0,r.jsxs)(F.Z,{children:[(0,r.jsx)(F.Z.Option,{value:0,children:"\u6846\u67B6\u5185\u5D4C"}),(0,r.jsx)(F.Z.Option,{value:1,children:"\u65B0\u5F00\u7F51\u9875"})]})})}),(0,r.jsx)(b.Z,{span:12,children:(0,r.jsx)(f.Z.Item,{name:"sort",label:"\u83DC\u5355\u6392\u5E8F",rules:[{required:!0}],children:(0,r.jsx)(D.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u6392\u5E8F"})})}),(0,r.jsx)(b.Z,{span:12,children:(0,r.jsx)(f.Z.Item,{name:"isDisabled",label:"\u662F\u5426\u7981\u7528",valuePropName:"checked",rules:[{required:!0}],children:(0,r.jsx)(V.Z,{checkedChildren:"\u662F",unCheckedChildren:"\u5426"})})})]}),(0,r.jsx)(f.Z.Item,{children:(0,r.jsx)(X.ZP,{type:"primary",htmlType:"submit",children:"\u786E\u5B9A"})})]})})]})},t=o},51904:function(he,G,n){n.d(G,{Z:function(){return P}});var k=n(62208),p=n(94184),W=n.n(p),i=n(67294),L=n(98787),$=n(45353),v=n(53124);function q(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}var f=n(14747),z=n(98719),V=n(67968),_=n(45503);const C=(e,r,o)=>{const t=q(o);return{[`${e.componentCls}-${r}`]:{color:e[`color${o}`],background:e[`color${t}Bg`],borderColor:e[`color${t}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}},X=e=>(0,z.Z)(e,(r,o)=>{let{textColor:t,lightBorderColor:l,lightColor:c,darkColor:g}=o;return{[`${e.componentCls}-${r}`]:{color:t,background:c,borderColor:l,"&-inverse":{color:e.colorTextLightSolid,background:g,borderColor:g},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}}),ee=e=>{const{paddingXXS:r,lineWidth:o,tagPaddingHorizontal:t,componentCls:l}=e,c=t-o,g=r-o;return{[l]:Object.assign(Object.assign({},(0,f.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:c,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",[`&${l}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${l}-close-icon`]:{marginInlineStart:g,color:e.colorTextDescription,fontSize:e.tagIconSize,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${l}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},["&-checkable"]:{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${l}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},["&-hidden"]:{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:c}}),[`${l}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}};var D=(0,V.Z)("Tag",e=>{const{lineWidth:r,fontSizeIcon:o}=e,t=e.fontSizeSM,l=`${e.lineHeightSM*t}px`,c=(0,_.TS)(e,{tagFontSize:t,tagLineHeight:l,tagIconSize:o-2*r,tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary});return[ee(c),X(c),C(c,"success","Success"),C(c,"processing","Info"),C(c,"error","Error"),C(c,"warning","Warning")]},e=>({defaultBg:e.colorFillQuaternary,defaultColor:e.colorText})),re=function(e,r){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,t=Object.getOwnPropertySymbols(e);l<t.length;l++)r.indexOf(t[l])<0&&Object.prototype.propertyIsEnumerable.call(e,t[l])&&(o[t[l]]=e[t[l]]);return o},ne=e=>{const{prefixCls:r,className:o,checked:t,onChange:l,onClick:c}=e,g=re(e,["prefixCls","className","checked","onChange","onClick"]),{getPrefixCls:H}=i.useContext(v.E_),x=T=>{l==null||l(!t),c==null||c(T)},y=H("tag",r),[I,B]=D(y),Z=W()(y,{[`${y}-checkable`]:!0,[`${y}-checkable-checked`]:t},o,B);return I(i.createElement("span",Object.assign({},g,{className:Z,onClick:x})))},F=function(e,r){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,t=Object.getOwnPropertySymbols(e);l<t.length;l++)r.indexOf(t[l])<0&&Object.prototype.propertyIsEnumerable.call(e,t[l])&&(o[t[l]]=e[t[l]]);return o};const te=(e,r)=>{const{prefixCls:o,className:t,rootClassName:l,style:c,children:g,icon:H,color:x,onClose:y,closeIcon:I,closable:B=!1,bordered:Z=!0}=e,T=F(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:J,direction:ae}=i.useContext(v.E_),[w,K]=i.useState(!0);i.useEffect(()=>{"visible"in T&&K(T.visible)},[T.visible]);const M=(0,L.o2)(x)||(0,L.yT)(x),le=Object.assign({backgroundColor:x&&!M?x:void 0},c),m=J("tag",o),[se,Q]=D(m),oe=W()(m,{[`${m}-${x}`]:M,[`${m}-has-color`]:x&&!M,[`${m}-hidden`]:!w,[`${m}-rtl`]:ae==="rtl",[`${m}-borderless`]:!Z},t,l,Q),N=E=>{E.stopPropagation(),y==null||y(E),!E.defaultPrevented&&K(!1)},ue=i.useMemo(()=>B?I?i.createElement("span",{className:`${m}-close-icon`,onClick:N},I):i.createElement(k.Z,{className:`${m}-close-icon`,onClick:N}):null,[B,I,m,N]),ie=typeof T.onClick=="function"||g&&g.type==="a",R=H||null,U=R?i.createElement(i.Fragment,null,R,i.createElement("span",null,g)):g,Y=i.createElement("span",Object.assign({},T,{ref:r,className:oe,style:le}),U,ue);return se(ie?i.createElement($.Z,null,Y):Y)},A=i.forwardRef(te);A.CheckableTag=ne;var P=A}}]);
|