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