"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[816],{40110:function(he,z,n){var R=n(1413),S=n(67294),J=n(509),A=n(91146),L=function(Y,C){return S.createElement(A.Z,(0,R.Z)((0,R.Z)({},Y),{},{ref:C,icon:J.Z}))};L.displayName="SearchOutlined",z.Z=S.forwardRef(L)},32708:function(he,z,n){n.r(z),n.d(z,{default:function(){return We}});var R=n(15009),S=n.n(R),J=n(99289),A=n.n(J),L=n(5574),E=n.n(L),Y=n(35312),C=n(8232),H=n(96365),pe=n(42075),k=n(14726),d=n(67294),Ce=n(62208),ye=n(93967),se=n.n(ye),ie=n(98787),be=n(69760),Se=n(45353),ce=n(53124),de=n(54548),xe=n(10274),je=n(14747),Oe=n(45503),q=n(91945);const Ie=e=>{const{paddingXXS:s,lineWidth:c,tagPaddingHorizontal:r,componentCls:a,calc:p}=e,f=p(r).sub(c).equal(),x=p(s).sub(c).equal();return{[a]:Object.assign(Object.assign({},(0,je.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,de.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:x,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}}},_=e=>{const{lineWidth:s,fontSizeIcon:c,calc:r}=e,a=e.fontSizeSM;return(0,Oe.TS)(e,{tagFontSize:a,tagLineHeight:(0,de.bf)(r(e.lineHeightSM).mul(a).equal()),tagIconSize:r(c).sub(r(s).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},ee=e=>({defaultBg:new xe.C(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var ue=(0,q.I$)("Tag",e=>{const s=_(e);return Ie(s)},ee),Ee=function(e,s){var c={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&s.indexOf(r)<0&&(c[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a{const{prefixCls:c,style:r,className:a,checked:p,onChange:f,onClick:x}=e,m=Ee(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:$,tag:g}=d.useContext(ce.E_),Z=N=>{f==null||f(!p),x==null||x(N)},j=$("tag",c),[O,B,D]=ue(j),v=se()(j,`${j}-checkable`,{[`${j}-checkable-checked`]:p},g==null?void 0:g.className,a,B,D);return O(d.createElement("span",Object.assign({},m,{ref:s,style:Object.assign(Object.assign({},r),g==null?void 0:g.style),className:v,onClick:Z})))}),Ze=n(98719);const Pe=e=>(0,Ze.Z)(e,(s,c)=>{let{textColor:r,lightBorderColor:a,lightColor:p,darkColor:f}=c;return{[`${e.componentCls}${e.componentCls}-${s}`]:{color:r,background:p,borderColor:a,"&-inverse":{color:e.colorTextLightSolid,background:f,borderColor:f},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}});var Te=(0,q.bk)(["Tag","preset"],e=>{const s=_(e);return Pe(s)},ee);function Be(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const W=(e,s,c)=>{const r=Be(c);return{[`${e.componentCls}${e.componentCls}-${s}`]:{color:e[`color${c}`],background:e[`color${r}Bg`],borderColor:e[`color${r}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}};var Fe=(0,q.bk)(["Tag","status"],e=>{const s=_(e);return[W(s,"success","Success"),W(s,"processing","Info"),W(s,"error","Error"),W(s,"warning","Warning")]},ee),Ae=function(e,s){var c={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&s.indexOf(r)<0&&(c[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a{const{prefixCls:c,className:r,rootClassName:a,style:p,children:f,icon:x,color:m,onClose:$,closeIcon:g,closable:Z,bordered:j=!0}=e,O=Ae(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:B,direction:D,tag:v}=d.useContext(ce.E_),[N,K]=d.useState(!0);d.useEffect(()=>{"visible"in O&&K(O.visible)},[O.visible]);const P=(0,ie.o2)(m),U=(0,ie.yT)(m),F=P||U,V=Object.assign(Object.assign({backgroundColor:m&&!F?m:void 0},v==null?void 0:v.style),p),h=B("tag",c),[re,M,y]=ue(h),te=se()(h,v==null?void 0:v.className,{[`${h}-${m}`]:F,[`${h}-has-color`]:m&&!F,[`${h}-hidden`]:!N,[`${h}-rtl`]:D==="rtl",[`${h}-borderless`]:!j},r,a,M,y),X=I=>{I.stopPropagation(),$==null||$(I),!I.defaultPrevented&&K(!1)},[,ae]=(0,be.Z)({closable:Z,closeIcon:g!=null?g:v==null?void 0:v.closeIcon,customCloseIconRender:I=>I===null?d.createElement(Ce.Z,{className:`${h}-close-icon`,onClick:X}):d.createElement("span",{className:`${h}-close-icon`,onClick:X},I),defaultCloseIcon:null,defaultClosable:!1}),le=typeof O.onClick=="function"||f&&f.type==="a",G=x||null,Q=G?d.createElement(d.Fragment,null,G,f&&d.createElement("span",null,f)):f,w=d.createElement("span",Object.assign({},O,{ref:s,className:te,style:V}),Q,ae,P&&d.createElement(Te,{key:"preset",prefixCls:h}),U&&d.createElement(Fe,{key:"status",prefixCls:h}));return re(le?d.createElement(Se.Z,{component:"Tag"},w):w)},fe=d.forwardRef(De);fe.CheckableTag=$e;var Ne=fe,Me=n(72051),ze=n(17788),T=n(34041),Re=n(71230),ve=n(15746),me=n(8925),ne=n(48357),Le=n(40110),t=n(85893),He=function(){var s=(0,d.useState)([]),c=E()(s,2),r=c[0],a=c[1],p=(0,d.useState)(!1),f=E()(p,2),x=f[0],m=f[1],$=(0,d.useState)(!1),g=E()($,2),Z=g[0],j=g[1],O=(0,d.useState)(0),B=E()(O,2),D=B[0],v=B[1],N=C.Z.useForm(),K=E()(N,1),P=K[0],U=(0,d.useState)([]),F=E()(U,2),V=F[0],h=F[1],re=(0,Y.useModel)("@@initialState"),M=re.initialState,y=M==null?void 0:M.currentUser,te=function(l){var o=V.find(function(b){return b.id===l});return o?o.name:""},X=function(l){P.setFieldsValue(l),m(!0),j(!0),v(l.role?l.role:0)},ae=[{title:"\u8D26\u53F7",dataIndex:"name",filterDropdown:function(l){var o=l.setSelectedKeys,b=l.selectedKeys,i=l.confirm,Ue=l.clearFilters;return(0,t.jsxs)("div",{style:{padding:8},children:[(0,t.jsx)(H.Z,{placeholder:"\u641C\u7D22\u8D26\u53F7",value:b[0],onChange:function(ge){return o(ge.target.value?[ge.target.value]:[])},onPressEnter:function(){return i()},style:{marginBottom:8,display:"block"}}),(0,t.jsxs)(pe.Z,{children:[(0,t.jsx)(k.ZP,{onClick:function(){return i()},type:"primary",children:"\u641C\u7D22"}),(0,t.jsx)(k.ZP,{onClick:function(){return Ue()},type:"link",children:"\u6E05\u9664"})]})]})},onFilter:function(l,o){var b;return o==null||(b=o.name)===null||b===void 0?void 0:b.includes(l)},filterIcon:function(l){return(0,t.jsx)(Le.Z,{style:{color:l?"#1890ff":void 0},onPointerEnterCapture:void 0,onPointerLeaveCapture:void 0})}},{title:"\u6E38\u620F",dataIndex:"appIds",render:function(l){return(0,t.jsx)("div",{children:l==null?void 0:l.map(function(o){return(0,t.jsx)(Ne,{color:"blue",children:te(o)},o)})})}},{title:"\u89D2\u8272",dataIndex:"role",render:function(l){var o="";switch(l){case 1:o="\u8D85\u7EA7\u7BA1\u7406\u5458";break;case 2:o="\u7BA1\u7406\u5458";break;case 3:o="\u666E\u901A\u8D26\u53F7";break;case 4:o="\u53E3\u5B50";break;default:o=""}return o}},{title:"\u64CD\u4F5C",render:function(l){return[(0,t.jsx)("a",{onClick:function(){return X(l)},children:"\u7F16\u8F91"},"edit")]}}],le=function(){P.submit()},G=function(){m(!1)},Q=function(){var u=A()(S()().mark(function l(){var o;return S()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,(0,ne.N0)();case 2:o=i.sent,o.data&&a(o.data);case 4:case"end":return i.stop()}},l)}));return function(){return u.apply(this,arguments)}}(),w=function(){var u=A()(S()().mark(function l(){var o;return S()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,(0,ne.ln)();case 2:o=i.sent,o.data&&h(o.data);case 4:case"end":return i.stop()}},l)}));return function(){return u.apply(this,arguments)}}();(0,d.useEffect)(function(){Q(),w()},[]);var I=function(){P.resetFields(),m(!0),j(!1),v(0)},Ke=function(){var u=A()(S()().mark(function l(o){return S()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,(0,ne.P7)(o);case 3:i.next=8;break;case 5:return i.prev=5,i.t0=i.catch(0),i.abrupt("return");case 8:m(!1),Q();case 10:case"end":return i.stop()}},l,null,[[0,5]])}));return function(o){return u.apply(this,arguments)}}();return(0,t.jsxs)("div",{children:[(0,t.jsx)(k.ZP,{onClick:I,children:"\u65B0\u5EFA\u8D26\u53F7"}),(0,t.jsx)(Me.Z,{columns:ae,dataSource:r}),(0,t.jsx)(ze.Z,{title:"\u7F16\u8F91",visible:x,onOk:le,onCancel:G,children:(0,t.jsxs)(C.Z,{form:P,onFinish:Ke,children:[(0,t.jsx)(C.Z.Item,{name:"id",style:{display:"none"},children:(0,t.jsx)(H.Z,{type:"hidden"})}),(0,t.jsx)(C.Z.Item,{label:"\u8D26\u53F7",name:"name",children:(0,t.jsx)(H.Z,{disabled:Z,maxLength:32})}),(0,t.jsx)(C.Z.Item,{label:"\u5BC6\u7801",name:"password",children:(0,t.jsx)(H.Z.Password,{disabled:Z})}),(0,t.jsx)(C.Z.Item,{label:"\u6E38\u620F",name:"appIds",children:(0,t.jsx)(T.Z,{mode:"multiple",children:V.map(function(u){return(0,t.jsx)(T.Z.Option,{value:u.id,children:u.name},u.id)})})}),(0,t.jsx)(C.Z.Item,{label:"\u89D2\u8272",name:"role",children:(0,t.jsxs)(T.Z,{disabled:Z,onSelect:v,children:[(0,t.jsx)(T.Z.Option,{disabled:(y==null?void 0:y.role)&&y.role>1,value:2,children:"\u7BA1\u7406\u5458"}),(0,t.jsx)(T.Z.Option,{disabled:(y==null?void 0:y.role)&&y.role>2,value:3,children:"\u666E\u901A\u8D26\u53F7"}),(0,t.jsx)(T.Z.Option,{value:4,children:"\u53E3\u5B50"})]})}),D>3&&(0,t.jsxs)(Re.Z,{children:[(0,t.jsx)(ve.Z,{span:12,children:(0,t.jsx)(C.Z.Item,{label:"\u6536\u5165\u6BD4\u4F8B",name:"incomeRate",children:(0,t.jsx)(me.Z,{placeholder:"1-100\u6574\u6570",style:{width:"80%"}})})}),(0,t.jsx)(ve.Z,{span:12,children:(0,t.jsx)(C.Z.Item,{label:"\u8BBE\u5907\u6570",name:"deviceCnt",children:(0,t.jsx)(me.Z,{style:{width:"80%"}})})})]})]})})]})},We=He}}]);