You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
8.6 KiB

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