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