"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[816],{40110:function(Ie,H,a){var u=a(1413),x=a(67294),A=a(509),D=a(91146),K=function(p,Z){return x.createElement(D.Z,(0,u.Z)((0,u.Z)({},p),{},{ref:Z,icon:A.Z}))},C=x.forwardRef(K);H.Z=C},95795:function(Ie,H,a){a.r(H),a.d(H,{default:function(){return Fe}});var u=a(15009),x=a.n(u),A=a(99289),D=a.n(A),K=a(5574),C=a.n(K),te=a(35312),p=a(8232),Z=a(55102),G=a(42075),E=a(14726),re=a(66309),ae=a(71230),$=a(15746),he=a(13169),M=a(72051),k=a(17788),F=a(34041),le=a(37804),T=a(67294),oe=a(40110),se=a(16250),L=a(48357),ge=a(72269),n=a(85893),V=function(w){var e=function(){w.onSubmit()},i=[{title:"\u8D26\u53F7",dataIndex:"name",ellipsis:!0},{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:"\u9690\u85CF",render:function(l){return(0,n.jsx)(ge.Z,{defaultValue:l.hide!==0,onClick:function(h){l.id&&(0,L.tQ)({adminId:l.id,hide:h?1:0})}})}}];return(0,n.jsx)(k.Z,{title:"\u6279\u91CF\u7F16\u8F91",visible:!0,footer:[],onCancel:e,children:(0,n.jsx)(M.Z,{columns:i,dataSource:w.data})})},Ce=V,pe=function(){var w=(0,T.useState)([]),e=C()(w,2),i=e[0],d=e[1],l=(0,T.useState)(!1),o=C()(l,2),h=o[0],v=o[1],O=(0,T.useState)(!1),y=C()(O,2),N=y[0],b=y[1],R=(0,T.useState)(!1),I=C()(R,2),z=I[0],W=I[1],S=(0,T.useState)(0),U=C()(S,2),X=U[0],Q=U[1],ce=p.Z.useForm(),de=C()(ce,1),P=de[0],xe=(0,T.useState)([]),g=C()(xe,2),ue=g[0],ye=g[1],be=(0,te.useModel)("@@initialState"),J=be.initialState,m=J==null?void 0:J.currentUser,Y=function(r){return r?parseFloat((r/1e5).toFixed(2)):0},ve=function(r){var t=ue.find(function(f){return f.id===r});return t?t.name:""},q=function(r){P.setFieldsValue(r),v(!0),W(!0),Q(r.role?r.role:0)},Se=[{title:"\u8D26\u53F7",dataIndex:"name",ellipsis:!0,filterDropdown:function(r){var t=r.setSelectedKeys,f=r.selectedKeys,c=r.confirm,Ze=r.clearFilters;return(0,n.jsxs)("div",{style:{padding:8},children:[(0,n.jsx)(Z.Z,{placeholder:"\u641C\u7D22\u8D26\u53F7",value:f[0],onChange:function(ne){return t(ne.target.value?[ne.target.value]:[])},onPressEnter:function(){return c()},style:{marginBottom:8,display:"block"}}),(0,n.jsxs)(G.Z,{children:[(0,n.jsx)(E.ZP,{onClick:function(){return c()},type:"primary",children:"\u641C\u7D22"}),(0,n.jsx)(E.ZP,{onClick:Ze,type:"link",children:"\u6E05\u9664"})]})]})},onFilter:function(r,t){return(t==null?void 0:t.name)&&t.name.includes(String(r))||!1},filterIcon:function(r){return(0,n.jsx)(oe.Z,{style:{color:r?"#1890ff":void 0},onPointerOverCapture:void 0,onPointerMoveCapture:void 0})}},{title:"\u6E38\u620F",dataIndex:"appIds",render:function(r){return(0,n.jsx)("div",{children:r==null?void 0:r.map(function(t){return(0,n.jsx)(re.Z,{color:"blue",children:ve(t)},t)})})}},{title:"\u89D2\u8272",dataIndex:"role",render:function(r){var t="";switch(r){case 1:t="\u8D85\u7EA7\u7BA1\u7406\u5458";break;case 2:t="\u7BA1\u7406\u5458";break;case 3:t="\u666E\u901A\u8D26\u53F7";break;case 4:t="\u53E3\u5B50";break;default:t=""}return t}},{title:"\u64CD\u4F5C",render:function(r){return[(0,n.jsx)("a",{onClick:function(){return q(r)},children:"\u7F16\u8F91"},"edit")]}}],fe=[{title:"\u8D26\u53F7",dataIndex:"name",ellipsis:!0,filterDropdown:function(r){var t=r.setSelectedKeys,f=r.selectedKeys,c=r.confirm,Ze=r.clearFilters;return(0,n.jsxs)("div",{style:{padding:8},children:[(0,n.jsx)(Z.Z,{placeholder:"\u641C\u7D22\u8D26\u53F7",value:f[0],onChange:function(ne){return t(ne.target.value?[ne.target.value]:[])},onPressEnter:function(){return c()},style:{marginBottom:8,display:"block"}}),(0,n.jsxs)(G.Z,{children:[(0,n.jsx)(E.ZP,{onClick:function(){return c()},type:"primary",children:"\u641C\u7D22"}),(0,n.jsx)(E.ZP,{onClick:Ze,type:"link",children:"\u6E05\u9664"})]})]})},onFilter:function(r,t){return(t==null?void 0:t.name)&&t.name.includes(String(r))||!1},filterIcon:function(r){return(0,n.jsx)(oe.Z,{style:{color:r?"#1890ff":void 0}})}},{title:"\u6E38\u620F",dataIndex:"appIds",render:function(r){return(0,n.jsx)("div",{children:r==null?void 0:r.map(function(t){return(0,n.jsx)(re.Z,{color:"blue",children:ve(t)},t)})})}},{title:"\u89D2\u8272",dataIndex:"role",render:function(r){var t="";switch(r){case 1:t="\u8D85\u7EA7\u7BA1\u7406\u5458";break;case 2:t="\u7BA1\u7406\u5458";break;case 3:t="\u666E\u901A\u8D26\u53F7";break;case 4:t="\u53E3\u5B50";break;default:t=""}return t}},{title:"\u672C\u6708\u6536\u5165\uFF08\u5143\uFF09",dataIndex:"incomeThisMonth",render:function(r,t){var f;return Y((f=t.overview)===null||f===void 0?void 0:f.thisMonthIncome)}},{title:"\u4E0A\u6708\u6536\u5165\uFF08\u5143\uFF09",dataIndex:"incomeLastMonth",render:function(r,t){var f;return Y((f=t.overview)===null||f===void 0?void 0:f.lastMonthIncome)}},{title:"\u7D2F\u8BA1\u6536\u5165\uFF08\u5143\uFF09",dataIndex:"incomeTotal",render:function(r,t){var f;return Y((f=t.overview)===null||f===void 0?void 0:f.totalIncome)}},{title:"\u5F53\u524D\u5206\u6210\u6BD4\u4F8B",dataIndex:"incomeRate"},{title:"\u64CD\u4F5C",render:function(r){return[(0,n.jsx)("a",{onClick:function(){return q(r)},children:"\u7F16\u8F91"},"edit")]}}],B=function(){P.submit()},je=function(){v(!1)},j=function(){var s=D()(x()().mark(function r(){var t;return x()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,(0,L.N0)();case 2:t=c.sent,t.data&&d(t.data);case 4:case"end":return c.stop()}},r)}));return function(){return s.apply(this,arguments)}}(),me=function(){var s=D()(x()().mark(function r(){var t;return x()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,(0,L.ln)();case 2:t=c.sent,t.data&&ye(t.data);case 4:case"end":return c.stop()}},r)}));return function(){return s.apply(this,arguments)}}();(0,T.useEffect)(function(){j(),me()},[]);var _=function(){P.resetFields(),v(!0),W(!1),Q(0)},Oe=function(){var s=D()(x()().mark(function r(t){return x()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.prev=0,c.next=3,(0,L.P7)(t);case 3:c.next=8;break;case 5:return c.prev=5,c.t0=c.catch(0),c.abrupt("return");case 8:v(!1),j();case 10:case"end":return c.stop()}},r,null,[[0,5]])}));return function(t){return s.apply(this,arguments)}}();return(0,n.jsxs)("div",{children:[(0,n.jsxs)(ae.Z,{align:"stretch",gutter:20,children:[(0,n.jsx)($.Z,{children:(0,n.jsx)(E.ZP,{onClick:_,children:"\u65B0\u5EFA\u8D26\u53F7"})}),(0,n.jsx)($.Z,{children:(0,n.jsx)(E.ZP,{onClick:function(){b(!0)},children:"\u6279\u91CF\u7F16\u8F91"})})]}),(0,n.jsxs)(he.Z,{centered:!0,style:{backgroundColor:"white",padding:"20px"},children:[(m==null?void 0:m.role)&&m.role<3&&(0,n.jsx)(se.Z,{tab:"\u666E\u901A\u8D26\u53F7",children:(0,n.jsx)(M.Z,{columns:Se,dataSource:i.filter(function(s){return s.role===3&&s.hide===0})})},"1"),(0,n.jsx)(se.Z,{tab:"\u53E3\u5B50",children:(0,n.jsx)(M.Z,{columns:fe,dataSource:i.filter(function(s){return s.role===4&&s.hide===0})})},"2")]}),(0,n.jsx)(k.Z,{title:"\u7F16\u8F91",visible:h,onOk:B,onCancel:je,children:(0,n.jsxs)(p.Z,{form:P,onFinish:Oe,children:[(0,n.jsx)(p.Z.Item,{name:"id",style:{display:"none"},children:(0,n.jsx)(Z.Z,{type:"hidden"})}),(0,n.jsx)(p.Z.Item,{label:"\u8D26\u53F7",name:"name",children:(0,n.jsx)(Z.Z,{disabled:z,maxLength:32})}),(0,n.jsx)(p.Z.Item,{label:"\u5BC6\u7801",name:"password",children:(0,n.jsx)(Z.Z.Password,{disabled:z})}),(0,n.jsx)(p.Z.Item,{label:"\u6E38\u620F",name:"appIds",children:(0,n.jsx)(F.Z,{mode:"multiple",children:ue.map(function(s){return(0,n.jsx)(F.Z.Option,{value:s.id,children:s.name},s.id)})})}),(0,n.jsx)(p.Z.Item,{label:"\u89D2\u8272",name:"role",children:(0,n.jsxs)(F.Z,{disabled:z,onSelect:Q,children:[(0,n.jsx)(F.Z.Option,{disabled:(m==null?void 0:m.role)&&m.role>1,value:2,children:"\u7BA1\u7406\u5458"}),(0,n.jsx)(F.Z.Option,{disabled:(m==null?void 0:m.role)&&m.role>2,value:3,children:"\u666E\u901A\u8D26\u53F7"}),(0,n.jsx)(F.Z.Option,{value:4,children:"\u53E3\u5B50"})]})}),X>3&&(0,n.jsxs)(ae.Z,{children:[(0,n.jsx)($.Z,{span:12,children:(0,n.jsx)(p.Z.Item,{label:"\u6536\u5165\u6BD4\u4F8B",name:"incomeRate",children:(0,n.jsx)(le.Z,{placeholder:"1-100\u6574\u6570",style:{width:"80%"}})})}),(0,n.jsx)($.Z,{span:12,children:(0,n.jsx)(p.Z.Item,{label:"\u8BBE\u5907\u6570",name:"deviceCnt",children:(0,n.jsx)(le.Z,{style:{width:"80%"}})})})]})]})}),N&&(0,n.jsx)(Ce,{data:i,onSubmit:function(){b(!1),j()}})]})},Fe=pe},66309:function(Ie,H,a){a.d(H,{Z:function(){return w}});var u=a(67294),x=a(93967),A=a.n(x),D=a(98423),K=a(98787),C=a(69760),te=a(96159),p=a(45353),Z=a(53124),G=a(54548),E=a(10274),re=a(14747),ae=a(45503),$=a(91945);const he=e=>{const{paddingXXS:i,lineWidth:d,tagPaddingHorizontal:l,componentCls:o,calc:h}=e,v=h(l).sub(d).equal(),O=h(i).sub(d).equal();return{[o]:Object.assign(Object.assign({},(0,re.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:v,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${(0,G.bf)(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${o}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${o}-close-icon`]:{marginInlineStart:O,fontSize:e.tagIconSize,color:e.colorTextDescription,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${o}-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(${o}-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:v}}),[`${o}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}},M=e=>{const{lineWidth:i,fontSizeIcon:d,calc:l}=e,o=e.fontSizeSM;return(0,ae.TS)(e,{tagFontSize:o,tagLineHeight:(0,G.bf)(l(e.lineHeightSM).mul(o).equal()),tagIconSize:l(d).sub(l(i).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},k=e=>({defaultBg:new E.C(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var F=(0,$.I$)("Tag",e=>{const i=M(e);return he(i)},k),le=function(e,i){var d={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&i.indexOf(l)<0&&(d[l]=e[l]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,l=Object.getOwnPropertySymbols(e);o{const{prefixCls:d,style:l,className:o,checked:h,onChange:v,onClick:O}=e,y=le(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:N,tag:b}=u.useContext(Z.E_),R=X=>{v==null||v(!h),O==null||O(X)},I=N("tag",d),[z,W,S]=F(I),U=A()(I,`${I}-checkable`,{[`${I}-checkable-checked`]:h},b==null?void 0:b.className,o,W,S);return z(u.createElement("span",Object.assign({},y,{ref:i,style:Object.assign(Object.assign({},l),b==null?void 0:b.style),className:U,onClick:R})))}),se=a(98719);const L=e=>(0,se.Z)(e,(i,d)=>{let{textColor:l,lightBorderColor:o,lightColor:h,darkColor:v}=d;return{[`${e.componentCls}${e.componentCls}-${i}`]:{color:l,background:h,borderColor:o,"&-inverse":{color:e.colorTextLightSolid,background:v,borderColor:v},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}});var ge=(0,$.bk)(["Tag","preset"],e=>{const i=M(e);return L(i)},k);function n(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const V=(e,i,d)=>{const l=n(d);return{[`${e.componentCls}${e.componentCls}-${i}`]:{color:e[`color${d}`],background:e[`color${l}Bg`],borderColor:e[`color${l}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}};var Ce=(0,$.bk)(["Tag","status"],e=>{const i=M(e);return[V(i,"success","Success"),V(i,"processing","Info"),V(i,"error","Error"),V(i,"warning","Warning")]},k),pe=function(e,i){var d={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&i.indexOf(l)<0&&(d[l]=e[l]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,l=Object.getOwnPropertySymbols(e);o{const{prefixCls:d,className:l,rootClassName:o,style:h,children:v,icon:O,color:y,onClose:N,bordered:b=!0,visible:R}=e,I=pe(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:z,direction:W,tag:S}=u.useContext(Z.E_),[U,X]=u.useState(!0),Q=(0,D.Z)(I,["closeIcon","closable"]);u.useEffect(()=>{R!==void 0&&X(R)},[R]);const ce=(0,K.o2)(y),de=(0,K.yT)(y),P=ce||de,xe=Object.assign(Object.assign({backgroundColor:y&&!P?y:void 0},S==null?void 0:S.style),h),g=z("tag",d),[ue,ye,be]=F(g),J=A()(g,S==null?void 0:S.className,{[`${g}-${y}`]:P,[`${g}-has-color`]:y&&!P,[`${g}-hidden`]:!U,[`${g}-rtl`]:W==="rtl",[`${g}-borderless`]:!b},l,o,ye,be),m=B=>{B.stopPropagation(),N==null||N(B),!B.defaultPrevented&&X(!1)},[,Y]=(0,C.Z)((0,C.w)(e),(0,C.w)(S),{closable:!1,closeIconRender:B=>{const je=u.createElement("span",{className:`${g}-close-icon`,onClick:m},B);return(0,te.wm)(B,je,j=>({onClick:me=>{var _;(_=j==null?void 0:j.onClick)===null||_===void 0||_.call(j,me),m(me)},className:A()(j==null?void 0:j.className,`${g}-close-icon`)}))}}),ve=typeof I.onClick=="function"||v&&v.type==="a",q=O||null,Se=q?u.createElement(u.Fragment,null,q,v&&u.createElement("span",null,v)):v,fe=u.createElement("span",Object.assign({},Q,{ref:i,className:J,style:xe}),Se,Y,ce&&u.createElement(ge,{key:"preset",prefixCls:g}),de&&u.createElement(Ce,{key:"status",prefixCls:g}));return ue(ve?u.createElement(p.Z,{component:"Tag"},fe):fe)});ie.CheckableTag=oe;var w=ie}}]);