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

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[816],{3973:function(Ce,Q,r){r.r(Q);var f=r(15009),I=r.n(f),L=r(99289),W=r.n(L),J=r(5574),b=r.n(J),re=r(35312),g=r(8232),F=r(66309),Y=r(14726),te=r(13169),K=r(72051),ae=r(17788),T=r(55102),y=r(34041),N=r(71230),$=r(15746),z=r(8925),P=r(67294),k=r(48357),H=r(16250),t=r(85893),le=function(){var oe=(0,P.useState)([]),M=b()(oe,2),w=M[0],se=M[1],he=(0,P.useState)(!1),V=b()(he,2),ie=V[0],e=V[1],i=(0,P.useState)(!1),c=b()(i,2),a=c[0],o=c[1],_=(0,P.useState)(0),m=b()(_,2),x=m[0],C=m[1],D=g.Z.useForm(),E=b()(D,1),O=E[0],j=(0,P.useState)([]),A=b()(j,2),Z=A[0],p=A[1],X=(0,re.useModel)("@@initialState"),S=X.initialState,v=S==null?void 0:S.currentUser,R=function(l){return l?parseFloat((l/1e5).toFixed(2)):0},G=function(l){var n=Z.find(function(u){return u.id===l});return n?n.name:""},U=function(l){O.setFieldsValue(l),e(!0),o(!0),C(l.role?l.role:0)},q=[{title:"\u59D3\u540D",dataIndex:"name"},{title:"\u5E94\u7528IDs",dataIndex:"appIds",render:function(l){return(0,t.jsx)("div",{children:l==null?void 0:l.map(function(n){return(0,t.jsx)(F.Z,{color:"blue",children:G(n)},n)})})}},{title:"\u89D2\u8272",dataIndex:"role",render:function(l){var n="";switch(l){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(l){return[(0,t.jsx)("a",{onClick:function(){return U(l)},children:"\u7F16\u8F91"},"edit")]}}],h=[{title:"\u59D3\u540D",dataIndex:"name",ellipsis:!0},{title:"\u5E94\u7528IDs",dataIndex:"appIds",render:function(l){return(0,t.jsx)("div",{children:l==null?void 0:l.map(function(n){return(0,t.jsx)(F.Z,{color:"blue",children:G(n)},n)})})}},{title:"\u89D2\u8272",dataIndex:"role",render:function(l){var n="";switch(l){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(l,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(l,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(l,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(l){return[(0,t.jsx)("a",{onClick:function(){return U(l)},children:"\u7F16\u8F91"},"edit")]}}],de=function(){O.submit()},ce=function(){e(!1)},ee=function(){var s=W()(I()().mark(function l(){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()}},l)}));return function(){return s.apply(this,arguments)}}(),ue=function(){var s=W()(I()().mark(function l(){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()}},l)}));return function(){return s.apply(this,arguments)}}();(0,P.useEffect)(function(){ee(),ue()},[]);var ne=function(){O.resetFields(),e(!0),o(!1),C(0)},me=function(){var s=W()(I()().mark(function l(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()}},l,null,[[0,5]])}));return function(n){return s.apply(this,arguments)}}();return(0,t.jsxs)("div",{children:[(0,t.jsx)(Y.ZP,{onClick:ne,children:"\u65B0\u5EFA\u8D26\u53F7"}),(0,t.jsxs)(te.Z,{centered:!0,style:{backgroundColor:"white",padding:"20px"},children:[(v==null?void 0:v.role)&&v.role<3&&(0,t.jsx)(H.Z,{tab:"\u6E38\u620F\u4E3B",children:(0,t.jsx)(K.Z,{columns:q,dataSource:w.filter(function(s){return s.role===3})})},"1"),(0,t.jsx)(H.Z,{tab:"\u8BBE\u5907\u4E3B",children:(0,t.jsx)(K.Z,{columns:h,dataSource:w.filter(function(s){return s.role===4})})},"2"),(v==null?void 0:v.role)&&v.role<2&&(0,t.jsx)(H.Z,{tab:"\u7BA1\u7406\u5458",children:(0,t.jsx)(K.Z,{columns:q,dataSource:w.filter(function(s){return s.role===2})})},"3")]}),(0,t.jsx)(ae.Z,{title:"\u7F16\u8F91",visible:ie,onOk:de,onCancel:ce,children:(0,t.jsxs)(g.Z,{form:O,onFinish:me,children:[(0,t.jsx)(g.Z.Item,{name:"id",style:{display:"none"},children:(0,t.jsx)(T.Z,{type:"hidden"})}),(0,t.jsx)(g.Z.Item,{label:"\u7528\u6237\u540D",name:"name",children:(0,t.jsx)(T.Z,{disabled:a})}),(0,t.jsx)(g.Z.Item,{label:"\u5BC6\u7801",name:"password",children:(0,t.jsx)(T.Z.Password,{disabled:a})}),(0,t.jsx)(g.Z.Item,{label:"\u5E94\u7528",name:"appIds",children:(0,t.jsx)(y.Z,{mode:"multiple",children:Z.map(function(s){return(0,t.jsx)(y.Z.Option,{value:s.id,children:s.name},s.id)})})}),(0,t.jsx)(g.Z.Item,{label:"\u89D2\u8272",name:"role",children:(0,t.jsxs)(y.Z,{disabled:a,onSelect:C,children:[(0,t.jsx)(y.Z.Option,{disabled:(v==null?void 0:v.role)&&v.role>1,value:2,children:"\u7BA1\u7406\u5458"}),(0,t.jsx)(y.Z.Option,{disabled:(v==null?void 0:v.role)&&v.role>2,value:3,children:"\u6E38\u620F\u4E3B"}),(0,t.jsx)(y.Z.Option,{value:4,children:"\u8BBE\u5907\u4E3B"})]})}),x>3&&(0,t.jsxs)(N.Z,{children:[(0,t.jsx)($.Z,{span:12,children:(0,t.jsx)(g.Z.Item,{label:"\u6536\u5165\u6BD4\u4F8B",name:"incomeRate",children:(0,t.jsx)(z.Z,{placeholder:"1-100\u6574\u6570",style:{width:"80%"}})})}),(0,t.jsx)($.Z,{span:12,children:(0,t.jsx)(g.Z.Item,{label:"\u8BBE\u5907\u6570",name:"deviceCnt",children:(0,t.jsx)(z.Z,{style:{width:"80%"}})})})]})]})})]})};Q.default=le},66309:function(Ce,Q,r){r.d(Q,{Z:function(){return ie}});var f=r(67294),I=r(93967),L=r.n(I),W=r(98423),J=r(98787),b=r(69760),re=r(96159),g=r(45353),F=r(53124),Y=r(54548),te=r(10274),K=r(14747),ae=r(45503),T=r(91945);const y=e=>{const{paddingXXS:i,lineWidth:c,tagPaddingHorizontal:a,componentCls:o,calc:_}=e,m=_(a).sub(c).equal(),x=_(i).sub(c).equal();return{[o]:Object.assign(Object.assign({},(0,K.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:m,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",[`&${o}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${o}-close-icon`]:{marginInlineStart:x,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:m}}),[`${o}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}},N=e=>{const{lineWidth:i,fontSizeIcon:c,calc:a}=e,o=e.fontSizeSM;return(0,ae.TS)(e,{tagFontSize:o,tagLineHeight:(0,Y.bf)(a(e.lineHeightSM).mul(o).equal()),tagIconSize:a(c).sub(a(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 y(i)},$),P=function(e,i){var c={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&i.indexOf(a)<0&&(c[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)i.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(c[a[o]]=e[a[o]]);return c},H=f.forwardRef((e,i)=>{const{prefixCls:c,style:a,className:o,checked:_,onChange:m,onClick:x}=e,C=P(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:D,tag:E}=f.useContext(F.E_),O=S=>{m==null||m(!_),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,o,Z,p);return A(f.createElement("span",Object.assign({},C,{ref:i,style:Object.assign(Object.assign({},a),E==null?void 0:E.style),className:X,onClick:O})))}),t=r(98719);const le=e=>(0,t.Z)(e,(i,c)=>{let{textColor:a,lightBorderColor:o,lightColor:_,darkColor:m}=c;return{[`${e.componentCls}${e.componentCls}-${i}`]:{color:a,background:_,borderColor:o,"&-inverse":{color:e.colorTextLightSolid,background:m,borderColor:m},[`&${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 a=oe(c);return{[`${e.componentCls}${e.componentCls}-${i}`]:{color:e[`color${c}`],background:e[`color${a}Bg`],borderColor:e[`color${a}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 a in e)Object.prototype.hasOwnProperty.call(e,a)&&i.indexOf(a)<0&&(c[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)i.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(c[a[o]]=e[a[o]]);return c};const V=f.forwardRef((e,i)=>{const{prefixCls:c,className:a,rootClassName:o,style:_,children:m,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),v=(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},a,o,ce,ee),ne=d=>{d.stopPropagation(),D==null||D(d),!d.defaultPrevented&&S(!1)},[,me]=(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 ve;(ve=B==null?void 0:B.onClick)===null||ve===void 0||ve.call(B,_e),ne(_e)},className:L()(B==null?void 0:B.className,`${h}-close-icon`)}))}}),s=typeof j.onClick=="function"||m&&m.type==="a",l=x||null,n=l?f.createElement(f.Fragment,null,l,m&&f.createElement("span",null,m)):m,u=f.createElement("span",Object.assign({},v,{ref:i,className:ue,style:q}),n,me,R&&f.createElement(fe,{key:"preset",prefixCls:h}),G&&f.createElement(w,{key:"status",prefixCls:h}));return de(s?f.createElement(g.Z,{component:"Tag"},u):u)});V.CheckableTag=H;var ie=V}}]);