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
12 KiB

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