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