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),C=r(8232),R=r(66309),ae=r(14726),le=r(13169),w=r(72051),U=r(17788),L=r(96365),E=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],h=t[1],v=(0,S.useState)(0),O=y()(v,2),x=O[0],j=O[1],p=C.Z.useForm(),N=y()(p,1),b=N[0],I=(0,S.useState)([]),D=y()(I,2),B=D[0],_=D[1],z=(0,te.useModel)("@@initialState"),$=z.initialState,f=$==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),h(!0),j(l.role?l.role:0)},g=[{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&&_(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),h(!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:[(f==null?void 0:f.role)&&f.role<3&&(0,a.jsx)(G.Z,{tab:"\u6E38\u620F\u4E3B",children:(0,a.jsx)(w.Z,{columns:g,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)(C.Z,{form:b,onFinish:me,children:[(0,a.jsx)(C.Z.Item,{name:"id",style:{display:"none"},children:(0,a.jsx)(L.Z,{type:"hidden"})}),(0,a.jsx)(C.Z.Item,{label:"\u7528\u6237\u540D",name:"name",children:(0,a.jsx)(L.Z,{disabled:o})}),(0,a.jsx)(C.Z.Item,{label:"\u5BC6\u7801",name:"password",children:(0,a.jsx)(L.Z.Password,{disabled:o})}),(0,a.jsx)(C.Z.Item,{label:"\u5E94\u7528",name:"appIds",children:(0,a.jsx)(E.Z,{mode:"multiple",children:B.map(function(i){return(0,a.jsx)(E.Z.Option,{value:i.id,children:i.name},i.id)})})}),(0,a.jsx)(C.Z.Item,{label:"\u89D2\u8272",name:"role",children:(0,a.jsxs)(E.Z,{disabled:o,onSelect:j,children:[(0,a.jsx)(E.Z.Option,{disabled:(f==null?void 0:f.role)&&f.role>1,value:2,children:"\u7BA1\u7406\u5458"}),(0,a.jsx)(E.Z.Option,{disabled:(f==null?void 0:f.role)&&f.role>2,value:3,children:"\u6E38\u620F\u4E3B"}),(0,a.jsx)(E.Z.Option,{value:4,children:"\u8BBE\u5907\u4E3B"})]})}),x>3&&(0,a.jsxs)(W.Z,{children:[(0,a.jsx)(F.Z,{span:12,children:(0,a.jsx)(C.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)(C.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),C=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:h}=e,v=h(t).sub(c).equal(),O=h(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: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}}},E=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=E(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:h,onChange:v,onClick:O}=e,x=X(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:j,tag:p}=m.useContext(C.E_),N=z=>{v==null||v(!h),O==null||O(z)},b=j("tag",c),[I,D,B]=F(b),_=M()(b,`${b}-checkable`,{[`${b}-checkable-checked`]:h},p==null?void 0:p.className,o,D,B);return I(m.createElement("span",Object.assign({},x,{ref:s,style:Object.assign(Object.assign({},t),p==null?void 0:p.style),className:_,onClick:N})))}),G=r(98719);const a=e=>(0,G.Z)(e,(s,c)=>{let{textColor:t,lightBorderColor:o,lightColor:h,darkColor:v}=c;return{[`${e.componentCls}${e.componentCls}-${s}`]:{color:t,background:h,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=E(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=E(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:h,children:v,icon:O,color:x,onClose:j,closeIcon:p,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:_}=m.useContext(C.E_),[z,$]=m.useState(!0);m.useEffect(()=>{"visible"in I&&$(I.visible)},[I.visible]);const f=(0,V.o2)(x),A=(0,V.yT)(x),Z=f||A,q=Object.assign(Object.assign({backgroundColor:x&&!Z?x:void 0},_==null?void 0:_.style),h),g=D("tag",c),[ie,ce,de]=F(g),ee=M()(g,_==null?void 0:_.className,{[`${g}-${x}`]:Z,[`${g}-has-color`]:x&&!Z,[`${g}-hidden`]:!z,[`${g}-rtl`]:B==="rtl",[`${g}-borderless`]:!b},t,o,ce,de),ne=d=>{d.stopPropagation(),j==null||j(d),!d.defaultPrevented&&$(!1)},[,ue]=(0,y.Z)({closable:N,closeIcon:p!=null?p:_==null?void 0:_.closeIcon,customCloseIconRender:d=>d===null?m.createElement(P.Z,{className:`${g}-close-icon`,onClick:ne}):m.createElement("span",{className:`${g}-close-icon`,onClick:ne},d),defaultCloseIcon:null,defaultClosable:!1}),me=typeof I.onClick=="function"||v&&v.type==="a",i=O||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,f&&m.createElement(oe,{key:"preset",prefixCls:g}),A&&m.createElement(Q,{key:"status",prefixCls:g}));return ie(me?m.createElement(te.Z,{component:"Tag"},n):n)},Y=m.forwardRef(se);Y.CheckableTag=K;var k=Y}}]);