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