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

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