"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[816],{32708:function(Ee,J,r){r.r(J),r.d(J,{default:function(){return Pe}});var re=r(15009),T=r.n(re),ae=r(99289),H=r.n(ae),te=r(5574),N=r.n(te),R=r(48357),oe=r(35312),x=r(8232),d=r(67294),le=r(62208),se=r(93967),K=r.n(se),Y=r(98787),ie=r(69760),ce=r(45353),k=r(53124),q=r(54548),de=r(10274),ue=r(14747),fe=r(45503),V=r(91945);const ve=e=>{const{paddingXXS:t,lineWidth:l,tagPaddingHorizontal:n,componentCls:a,calc:h}=e,f=h(n).sub(l).equal(),b=h(t).sub(l).equal();return{[a]:Object.assign(Object.assign({},(0,ue.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:f,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${(0,q.bf)(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${a}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${a}-close-icon`]:{marginInlineStart:b,fontSize:e.tagIconSize,color:e.colorTextDescription,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${a}-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(${a}-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:f}}),[`${a}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}},W=e=>{const{lineWidth:t,fontSizeIcon:l,calc:n}=e,a=e.fontSizeSM;return(0,fe.TS)(e,{tagFontSize:a,tagLineHeight:(0,q.bf)(n(e.lineHeightSM).mul(a).equal()),tagIconSize:n(l).sub(n(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},L=e=>({defaultBg:new de.C(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var _=(0,V.I$)("Tag",e=>{const t=W(e);return ve(t)},L),ge=function(e,t){var l={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(l[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a{const{prefixCls:l,style:n,className:a,checked:h,onChange:f,onClick:b}=e,v=ge(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:$,tag:p}=d.useContext(k.E_),y=j=>{f==null||f(!h),b==null||b(j)},S=$("tag",l),[C,P,A]=_(S),g=K()(S,`${S}-checkable`,{[`${S}-checkable-checked`]:h},p==null?void 0:p.className,a,P,A);return C(d.createElement("span",Object.assign({},v,{ref:t,style:Object.assign(Object.assign({},n),p==null?void 0:p.style),className:g,onClick:y})))}),he=r(98719);const pe=e=>(0,he.Z)(e,(t,l)=>{let{textColor:n,lightBorderColor:a,lightColor:h,darkColor:f}=l;return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:n,background:h,borderColor:a,"&-inverse":{color:e.colorTextLightSolid,background:f,borderColor:f},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}});var Ce=(0,V.bk)(["Tag","preset"],e=>{const t=W(e);return pe(t)},L);function be(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const B=(e,t,l)=>{const n=be(l);return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:e[`color${l}`],background:e[`color${n}Bg`],borderColor:e[`color${n}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}};var ye=(0,V.bk)(["Tag","status"],e=>{const t=W(e);return[B(t,"success","Success"),B(t,"processing","Info"),B(t,"error","Error"),B(t,"warning","Warning")]},L),Se=function(e,t){var l={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(l[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a{const{prefixCls:l,className:n,rootClassName:a,style:h,children:f,icon:b,color:v,onClose:$,closeIcon:p,closable:y,bordered:S=!0}=e,C=Se(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:P,direction:A,tag:g}=d.useContext(k.E_),[j,I]=d.useState(!0);d.useEffect(()=>{"visible"in C&&I(C.visible)},[C.visible]);const z=(0,Y.o2)(v),D=(0,Y.yT)(v),F=z||D,X=Object.assign(Object.assign({backgroundColor:v&&!F?v:void 0},g==null?void 0:g.style),h),m=P("tag",l),[M,G,w]=_(m),Q=K()(m,g==null?void 0:g.className,{[`${m}-${v}`]:F,[`${m}-has-color`]:v&&!F,[`${m}-hidden`]:!j,[`${m}-rtl`]:A==="rtl",[`${m}-borderless`]:!S},n,a,G,w),u=E=>{E.stopPropagation(),$==null||$(E),!E.defaultPrevented&&I(!1)},[,i]=(0,ie.Z)({closable:y,closeIcon:p!=null?p:g==null?void 0:g.closeIcon,customCloseIconRender:E=>E===null?d.createElement(le.Z,{className:`${m}-close-icon`,onClick:u}):d.createElement("span",{className:`${m}-close-icon`,onClick:u},E),defaultCloseIcon:null,defaultClosable:!1}),o=typeof C.onClick=="function"||f&&f.type==="a",O=b||null,s=O?d.createElement(d.Fragment,null,O,f&&d.createElement("span",null,f)):f,ne=d.createElement("span",Object.assign({},C,{ref:t,className:Q,style:X}),s,i,z&&d.createElement(Ce,{key:"preset",prefixCls:m}),D&&d.createElement(ye,{key:"status",prefixCls:m}));return M(o?d.createElement(ce.Z,{component:"Tag"},ne):ne)},ee=d.forwardRef(xe);ee.CheckableTag=me;var $e=ee,je=r(14726),Ie=r(72051),Oe=r(17788),U=r(96365),Z=r(34041),c=r(85893),Te=function(){var t=(0,d.useState)([]),l=N()(t,2),n=l[0],a=l[1],h=(0,d.useState)(!1),f=N()(h,2),b=f[0],v=f[1],$=x.Z.useForm(),p=N()($,1),y=p[0],S=(0,d.useState)([]),C=N()(S,2),P=C[0],A=C[1],g=(0,oe.useModel)("@@initialState"),j=g.initialState,I=j==null?void 0:j.currentUser,z=function(i){var o=P.find(function(O){return O.id===i});return o?o.name:""},D=function(i){y.setFieldsValue(i),v(!0)},F=[{title:"\u59D3\u540D",dataIndex:"name"},{title:"\u5E94\u7528IDs",dataIndex:"appIds",render:function(i){return(0,c.jsx)("div",{children:i==null?void 0:i.map(function(o){return(0,c.jsx)($e,{color:"blue",children:z(o)},o)})})}},{title:"\u89D2\u8272",dataIndex:"role",render:function(i){var o="";switch(i){case 1:o="\u8D85\u7EA7\u7BA1\u7406\u5458";break;case 2:o="\u7BA1\u7406\u5458";break;case 3:o="\u666E\u901A\u8D26\u53F7";break;default:o=""}return o}},{title:"\u64CD\u4F5C",render:function(i){return[(0,c.jsx)("a",{onClick:function(){return D(i)},children:"\u7F16\u8F91"},"edit")]}}],X=function(){y.submit()},m=function(){v(!1)},M=function(){var u=H()(T()().mark(function i(){var o;return T()().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,(0,R.N0)();case 2:o=s.sent,o.data&&a(o.data);case 4:case"end":return s.stop()}},i)}));return function(){return u.apply(this,arguments)}}(),G=function(){var u=H()(T()().mark(function i(){var o;return T()().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,(0,R.ln)();case 2:o=s.sent,o.data&&A(o.data);case 4:case"end":return s.stop()}},i)}));return function(){return u.apply(this,arguments)}}();(0,d.useEffect)(function(){M(),G()},[]);var w=function(){y.resetFields(),v(!0)},Q=function(){var u=H()(T()().mark(function i(o){return T()().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,s.next=3,(0,R.P7)(o);case 3:s.next=8;break;case 5:return s.prev=5,s.t0=s.catch(0),s.abrupt("return");case 8:v(!1),M();case 10:case"end":return s.stop()}},i,null,[[0,5]])}));return function(o){return u.apply(this,arguments)}}();return(0,c.jsxs)("div",{children:[(0,c.jsx)(je.ZP,{onClick:w,children:"\u65B0\u5EFA\u8D26\u53F7"}),(0,c.jsx)(Ie.Z,{columns:F,dataSource:n}),(0,c.jsx)(Oe.Z,{title:"\u7F16\u8F91",visible:b,onOk:X,onCancel:m,children:(0,c.jsxs)(x.Z,{form:y,onFinish:Q,children:[(0,c.jsx)(x.Z.Item,{name:"id",style:{display:"none"},children:(0,c.jsx)(U.Z,{type:"hidden"})}),(0,c.jsx)(x.Z.Item,{label:"\u7528\u6237\u540D",name:"name",children:(0,c.jsx)(U.Z,{})}),(0,c.jsx)(x.Z.Item,{label:"\u5BC6\u7801",name:"password",children:(0,c.jsx)(U.Z.Password,{})}),(0,c.jsx)(x.Z.Item,{label:"\u5E94\u7528",name:"appIds",children:(0,c.jsx)(Z.Z,{mode:"multiple",children:P.map(function(u){return(0,c.jsx)(Z.Z.Option,{value:u.id,children:u.name},u.id)})})}),(0,c.jsx)(x.Z.Item,{label:"\u89D2\u8272",name:"role",children:(0,c.jsxs)(Z.Z,{children:[(0,c.jsx)(Z.Z.Option,{disabled:(I==null?void 0:I.role)&&I.role>1,value:2,children:"\u7BA1\u7406\u5458"}),(0,c.jsx)(Z.Z.Option,{value:3,children:"\u666E\u901A\u8D26\u53F7"})]})})]})})]})},Pe=Te}}]);