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
15 KiB
1 lines
15 KiB
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[816],{85099:function(G,y,n){n.r(y),n.d(y,{default:function(){return Ie}});var _=n(15009),l=n.n(_),T=n(99289),d=n.n(T),k=n(5574),f=n.n(k),v=n(48357),i=n(35312),u=n(8232),F=n(66309),s=n(71230),m=n(15746),C=n(14726),g=n(13169),Z=n(72051),U=n(17788),w=n(55102),o=n(34041),q=n(37804),N=n(16250),D=n(67294),je=n(72269),e=n(85893),xe=function(p){var K=function(){p.onSubmit()},P=[{title:"\u59D3\u540D",dataIndex:"name",ellipsis:!0},{title:"\u89D2\u8272",dataIndex:"role",render:function(A){var S="";switch(A){case 1:S="\u8D85\u7EA7\u7BA1\u7406\u5458";break;case 2:S="\u7BA1\u7406\u5458";break;case 3:S="\u6E38\u620F\u4E3B";break;case 4:S="\u8BBE\u5907\u4E3B";break;default:S=""}return S}},{title:"\u9690\u85CF",render:function(A){return(0,e.jsx)(je.Z,{defaultValue:A.hide!==0,onClick:function($){A.id&&(0,v.tQ)({adminId:A.id,hide:$?1:0})}},A.id)}}];return(0,e.jsx)(U.Z,{title:"\u6279\u91CF\u7F16\u8F91",visible:!0,footer:[],onCancel:K,children:(0,e.jsx)(Z.Z,{columns:P,dataSource:p.data})})},pe=xe,Ee=n(19632),ee=n.n(Ee),be=n(81072),ge=n(3089),Ze=n(55241),ue=n(86250),H=n(2453),ie=n(38171),Ce=function(p){var K=(0,D.useState)([]),P=f()(K,2),L=P[0],A=P[1],S=(0,D.useState)([]),$=f()(S,2),B=$[0],Y=$[1],z=u.Z.useForm(),Q=f()(z,1),W=Q[0],ne=function(){var x=d()(l()().mark(function I(M){var h;return l()().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=2,(0,v.yC)({adminId:M});case 2:h=O.sent,A(h.data||[]);case 4:case"end":return O.stop()}},I)}));return function(M){return x.apply(this,arguments)}}();return(0,D.useEffect)(function(){p.data.id&&ne(p.data.id)},[p.data.id]),(0,e.jsxs)(U.Z,{title:"\u7ED1\u5B9A\u8D26\u53F7",visible:!0,centered:!0,onCancel:function(){p.onCancel()},footer:[(0,e.jsx)(C.ZP,{onClick:function(){p.onCancel()},children:"\u53D6\u6D88"},"back"),(0,e.jsx)(Ze.Z,{title:"\u786E\u5B9A\u4FDD\u5B58\u5417",content:(0,e.jsxs)("div",{style:{textAlign:"center"},children:[(0,e.jsx)("p",{children:"\u8D26\u53F7\u4E00\u65E6\u7ED1\u5B9A\u540E\uFF0C\u65E0\u6CD5\u88AB\u5220\u9664"}),(0,e.jsx)("a",{onClick:d()(l()().mark(function x(){var I;return l()().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(I=[].concat(ee()(L),ee()(B)).map(function(R){return R.id}).filter(Boolean),!(p.data.id&&I)){h.next=7;break}return h.next=4,(0,v.cH)({adminId:p.data.id},I);case 4:p.onSubmit(),h.next=8;break;case 7:p.onCancel();case 8:case"end":return h.stop()}},x)})),children:"\u786E\u5B9A"})]}),children:(0,e.jsx)(C.ZP,{type:"primary",children:"\u4FDD\u5B58"})},"confirm")],children:[L.length>0&&(0,e.jsxs)(s.Z,{gutter:6,style:{marginTop:20},children:[(0,e.jsx)(m.Z,{span:4,children:"\u5DF2\u7ED1\u5B9A:"}),(0,e.jsx)(ue.Z,{vertical:!0,gap:"small",children:L.map(function(x){return(0,e.jsx)(s.Z,{children:(0,e.jsx)(ie.Z,{data:x})},x.id)})})]}),B.length>0&&(0,e.jsxs)(s.Z,{gutter:6,style:{marginTop:20},children:[(0,e.jsx)(m.Z,{span:4,children:"\u672C\u6B21\u65B0\u589E:"}),(0,e.jsx)(ue.Z,{vertical:!0,gap:"small",children:B.map(function(x){return(0,e.jsxs)(s.Z,{children:[(0,e.jsx)(ie.Z,{data:x}),(0,e.jsx)(ge.Z,{style:{marginLeft:20},onClick:function(){Y(B.filter(function(M){return M.id!==x.id}))}})]},x.id)})})]}),(0,e.jsx)(u.Z,{style:{marginTop:20},labelCol:{span:4},wrapperCol:{span:18},form:W,onFinish:function(){var x=d()(l()().mark(function I(M){var h,R;return l()().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(h=M.uid,h){b.next=4;break}return H.ZP.error("uid\u4E0D\u80FD\u4E3A\u7A7A"),b.abrupt("return");case 4:if(!(p.data.id&&h)){b.next=15;break}if(!(B.filter(function(V){return V.id===h}).length>0)){b.next=8;break}return H.ZP.error("\u8BE5\u8D26\u53F7\u5DF2\u6DFB\u52A0"),b.abrupt("return");case 8:if(!(L.filter(function(V){return V.id===h}).length>0)){b.next=11;break}return H.ZP.error("\u8BE5\u8D26\u53F7\u5DF2\u6DFB\u52A0"),b.abrupt("return");case 11:return b.next=13,(0,be.fn)({adminId:p.data.id,userId:h});case 13:R=b.sent,R.data?Y([].concat(ee()(B),[R.data])):H.ZP.error("uid\u975E\u6CD5");case 15:case"end":return b.stop()}},I)}));return function(I){return x.apply(this,arguments)}}(),children:(0,e.jsxs)(s.Z,{children:[(0,e.jsx)(u.Z.Item,{name:"uid",label:"uid",children:(0,e.jsx)(q.Z,{style:{width:200}})}),(0,e.jsx)(u.Z.Item,{wrapperCol:{offset:8,span:16},children:(0,e.jsx)(C.ZP,{type:"primary",htmlType:"submit",children:"\u6DFB\u52A0"})})]})})]})},Fe=Ce,Se=function(){var p=(0,D.useState)([]),K=f()(p,2),P=K[0],L=K[1],A=(0,D.useState)(!1),S=f()(A,2),$=S[0],B=S[1],Y=(0,D.useState)(void 0),z=f()(Y,2),Q=z[0],W=z[1],ne=(0,D.useState)(!1),x=f()(ne,2),I=x[0],M=x[1],h=(0,D.useState)(!1),R=f()(h,2),O=R[0],b=R[1],V=(0,D.useState)(0),se=f()(V,2),de=se[0],re=se[1],De=u.Z.useForm(),Be=f()(De,1),X=Be[0],ye=(0,D.useState)([]),oe=f()(ye,2),ce=oe[0],Pe=oe[1],Ae=(0,i.useModel)("@@initialState"),te=Ae.initialState,E=te==null?void 0:te.currentUser,ae=function(a){return a?parseFloat((a/1e5).toFixed(2)):0},me=function(a){var r=ce.find(function(j){return j.id===a});return r?r.name:""},fe=function(a){X.setFieldsValue(a),B(!0),b(!0),re(a.role?a.role:0)},ve=[{title:"\u59D3\u540D",dataIndex:"name"},{title:"\u5E94\u7528IDs",dataIndex:"appIds",render:function(a){return(0,e.jsx)("div",{children:a==null?void 0:a.map(function(r){return(0,e.jsx)(F.Z,{color:"blue",children:me(r)},r)})})}},{title:"\u89D2\u8272",dataIndex:"role",render:function(a){var r="";switch(a){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(a){return[(0,e.jsx)("a",{onClick:function(){return fe(a)},children:"\u7F16\u8F91"},"edit")]}}],he=[{title:"\u59D3\u540D",dataIndex:"name",ellipsis:!0},{title:"\u5E94\u7528IDs",dataIndex:"appIds",render:function(a){return(0,e.jsx)("div",{children:a==null?void 0:a.map(function(r){return(0,e.jsx)(F.Z,{color:"blue",children:me(r)},r)})})}},{title:"\u89D2\u8272",dataIndex:"role",render:function(a){var r="";switch(a){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;case 5:r="\u4EE3\u7406";break;default:r=""}return r}},{title:"\u672C\u6708\u6536\u5165\uFF08\u5143\uFF09",dataIndex:"incomeThisMonth",render:function(a,r){var j;return ae((j=r.overview)===null||j===void 0?void 0:j.thisMonthIncome)}},{title:"\u4E0A\u6708\u6536\u5165\uFF08\u5143\uFF09",dataIndex:"incomeLastMonth",render:function(a,r){var j;return ae((j=r.overview)===null||j===void 0?void 0:j.lastMonthIncome)}},{title:"\u7D2F\u8BA1\u6536\u5165\uFF08\u5143\uFF09",dataIndex:"incomeTotal",render:function(a,r){var j;return ae((j=r.overview)===null||j===void 0?void 0:j.totalIncome)}},{title:"\u5F53\u524D\u5206\u6210\u6BD4\u4F8B",dataIndex:"incomeRate"},{title:"\u64CD\u4F5C",render:function(a){return(0,e.jsxs)(s.Z,{gutter:6,children:[(0,e.jsx)(m.Z,{children:(0,e.jsx)("a",{onClick:function(){return fe(a)},children:"\u7F16\u8F91"},"edit")}),a.role===5&&(0,e.jsx)(m.Z,{children:(0,e.jsx)("a",{onClick:function(){W(a)},children:"\u7ED1\u5B9A\u8D26\u53F7"},"grant")})]})}}],Me=function(){X.submit()},Oe=function(){B(!1)},J=function(){var t=d()(l()().mark(function a(){var r;return l()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,(0,v.N0)();case 2:r=c.sent,r.data&&L(r.data);case 4:case"end":return c.stop()}},a)}));return function(){return t.apply(this,arguments)}}(),_e=function(){var t=d()(l()().mark(function a(){var r;return l()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,(0,v.ln)();case 2:r=c.sent,r.data&&Pe(r.data);case 4:case"end":return c.stop()}},a)}));return function(){return t.apply(this,arguments)}}();(0,D.useEffect)(function(){J(),_e()},[]);var Te=function(){X.resetFields(),B(!0),b(!1),re(0)},Ue=function(){var t=d()(l()().mark(function a(r){return l()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.prev=0,c.next=3,(0,v.P7)(r);case 3:c.next=8;break;case 5:return c.prev=5,c.t0=c.catch(0),c.abrupt("return");case 8:B(!1),J();case 10:case"end":return c.stop()}},a,null,[[0,5]])}));return function(r){return t.apply(this,arguments)}}();return(0,e.jsxs)("div",{children:[(0,e.jsxs)(s.Z,{align:"stretch",gutter:20,children:[(0,e.jsx)(m.Z,{children:(0,e.jsx)(C.ZP,{onClick:Te,children:"\u65B0\u5EFA\u8D26\u53F7"})}),(0,e.jsx)(m.Z,{children:(0,e.jsx)(C.ZP,{onClick:function(){M(!0)},children:"\u6279\u91CF\u7F16\u8F91"})})]}),(0,e.jsxs)(g.Z,{centered:!0,style:{backgroundColor:"white",padding:"20px",marginTop:20},children:[(E==null?void 0:E.role)&&E.role<3&&(0,e.jsx)(N.Z,{tab:"\u6E38\u620F\u4E3B",children:(0,e.jsx)(Z.Z,{columns:ve,dataSource:P.filter(function(t){return t.role===3&&t.hide===0})})},"1"),(0,e.jsx)(N.Z,{tab:"\u8BBE\u5907\u4E3B",children:(0,e.jsx)(Z.Z,{columns:he,dataSource:P.filter(function(t){return t.role===4&&t.hide===0})})},"2"),(0,e.jsx)(N.Z,{tab:"\u4EE3\u7406",children:(0,e.jsx)(Z.Z,{columns:he,dataSource:P.filter(function(t){return t.role===5&&t.hide===0})})},"3"),(E==null?void 0:E.role)&&E.role<2&&(0,e.jsx)(N.Z,{tab:"\u7BA1\u7406\u5458",children:(0,e.jsx)(Z.Z,{columns:ve,dataSource:P.filter(function(t){return t.role===2&&t.hide===0})})},"4")]}),(0,e.jsx)(U.Z,{title:"\u7F16\u8F91",visible:$,onOk:Me,onCancel:Oe,children:(0,e.jsxs)(u.Z,{labelCol:{span:4},wrapperCol:{span:18},form:X,onFinish:Ue,children:[(0,e.jsx)(u.Z.Item,{name:"id",style:{display:"none"},children:(0,e.jsx)(w.Z,{type:"hidden"})}),(0,e.jsx)(u.Z.Item,{label:"\u7528\u6237\u540D",name:"name",children:(0,e.jsx)(w.Z,{disabled:O})}),(0,e.jsx)(u.Z.Item,{label:"\u5BC6\u7801",name:"password",children:(0,e.jsx)(w.Z.Password,{disabled:O})}),(0,e.jsx)(u.Z.Item,{label:"\u5E94\u7528",name:"appIds",children:(0,e.jsx)(o.Z,{filterOption:function(a,r){var j=typeof(r==null?void 0:r.children)=="string"?r.children:"";return j.toLowerCase().includes(a.toLowerCase())},showSearch:!0,mode:"multiple",children:ce.map(function(t){return(0,e.jsx)(o.Z.Option,{value:t.id,children:t.name},t.id)})})}),(0,e.jsx)(u.Z.Item,{label:"\u89D2\u8272",name:"role",children:(0,e.jsxs)(o.Z,{disabled:O,onSelect:re,children:[(0,e.jsx)(o.Z.Option,{disabled:(E==null?void 0:E.role)&&E.role>1,value:2,children:"\u7BA1\u7406\u5458"}),(0,e.jsx)(o.Z.Option,{disabled:(E==null?void 0:E.role)&&E.role>2,value:3,children:"\u6E38\u620F\u4E3B"}),(0,e.jsx)(o.Z.Option,{value:4,children:"\u8BBE\u5907\u4E3B"}),(0,e.jsx)(o.Z.Option,{value:5,children:"\u4EE3\u7406"})]})}),de>3&&(0,e.jsxs)(s.Z,{children:[(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(u.Z.Item,{labelCol:{span:8},label:"\u6536\u5165\u6BD4\u4F8B",name:"incomeRate",children:(0,e.jsx)(q.Z,{placeholder:"1-100\u6574\u6570",style:{width:"80%"}})})}),de===4?(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(u.Z.Item,{labelCol:{span:8},label:"\u8BBE\u5907\u6570",name:"deviceCnt",children:(0,e.jsx)(q.Z,{style:{width:"80%"}})})}):""]})]})}),I&&(0,e.jsx)(pe,{data:P,onSubmit:function(){M(!1),J()}}),Q&&(0,e.jsx)(Fe,{data:Q,onCancel:function(){W(void 0)},onSubmit:function(){W(void 0),J()}})]})},Ie=Se},38171:function(G,y,n){var _=n(55241),l=n(2487),T=n(71230),d=n(7134),k=n(67294),f=n(52043),v=n(58125),i=n(85893),u=function(s){var m=(0,f.E7)(s.data.env);return(0,i.jsx)(_.Z,{content:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("p",{children:[(0,i.jsx)("label",{children:"\u603B\u6536\u5165\uFF1A"}),(0,v.P)(s.data.income),"\u5143"]}),(0,i.jsxs)("p",{children:[(0,i.jsx)("label",{children:"\u5DF2\u63D0\u73B0\uFF1A"}),(0,v.D)(s.data.realMoney),"\u5143"]}),m.length>0&&(0,i.jsx)(l.Z,{size:"small",header:(0,i.jsx)("div",{children:"\u8BBE\u5907\u5F02\u5E38\u4FE1\u606F"}),bordered:!0,dataSource:m,renderItem:function(g){return(0,i.jsx)(l.Z.Item,{children:g})}})]}),children:(0,i.jsxs)(T.Z,{children:[(0,i.jsx)(d.C,{src:s.data.avatar||"https://apks.bzgames.cn/matrix/fc3fca88a8b28ff602e7a38d8164938b.png"}),(0,i.jsxs)("p",{style:{fontSize:12,marginLeft:10,color:m.length>0?"red":""},children:["id:",s.data.id,(0,i.jsx)("br",{}),s.data.nickname||s.data.mobile]})]})})};y.Z=u},81072:function(G,y,n){n.d(y,{fn:function(){return m},pb:function(){return F},wv:function(){return i}});var _=n(15009),l=n.n(_),T=n(97857),d=n.n(T),k=n(99289),f=n.n(k),v=n(35312);function i(g,Z){return u.apply(this,arguments)}function u(){return u=f()(l()().mark(function g(Z,U){return l()().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",(0,v.request)("/api/admin/user/changeStatus",d()({method:"POST",params:d()({},Z)},U||{})));case 1:case"end":return o.stop()}},g)})),u.apply(this,arguments)}function F(g,Z){return s.apply(this,arguments)}function s(){return s=f()(l()().mark(function g(Z,U){return l()().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",(0,v.request)("/api/admin/user/list",d()({method:"POST",headers:{"Content-Type":"application/json"},data:Z},U||{})));case 1:case"end":return o.stop()}},g)})),s.apply(this,arguments)}function m(g,Z){return C.apply(this,arguments)}function C(){return C=f()(l()().mark(function g(Z,U){return l()().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",(0,v.request)("/api/admin/user/queryById",d()({method:"GET",params:d()({},Z)},U||{})));case 1:case"end":return o.stop()}},g)})),C.apply(this,arguments)}},52043:function(G,y,n){n.d(y,{E7:function(){return l},FG:function(){return _},RQ:function(){return k},XY:function(){return T},aV:function(){return f},m0:function(){return d}});var _=function(){return[{label:"\u51E1\u7C73\u6E38",value:"fanmiyou"},{label:"\u5947\u8FF9",value:"qiji"},{label:"\u5229\u597D",value:"lihao"},{label:"\u4F73\u7476",value:"jiayao"}]},l=function(i){var u=[];if(!i)return u;for(var F=i>>1,s=["\u7528\u6237\u6253\u5F00\u4E86USB\u8C03\u8BD5\u6A21\u5F0F","\u7528\u6237\u6253\u5F00\u4E86\u5F00\u53D1\u8005\u6A21\u5F0F","\u7528\u6237\u6253\u5F00\u4E86\u65E0\u969C\u788D\u6A21\u5F0F","\u7528\u6237\u624B\u673A\u5DF2\u7ECFRoot","\u7528\u6237\u5B89\u88C5\u4E86Xpose","\u7528\u6237\u5F00\u542F\u4E86VPN","\u7528\u6237\u5F00\u542F\u4EE3\u7406","\u652F\u4ED8\u5B9D\u672A\u5B89\u88C5","\u5FAE\u4FE1\u672A\u5B89\u88C5"],m=0,C=s;m<C.length;m++){var g=C[m];F&1&&u.push(g),F>>=1}return u},T=function(){return[{label:"\u5F85\u5BA1\u6279",value:"0",color:"orange"},{label:"\u5BA1\u6279\u901A\u8FC7",value:"1",color:"green"},{label:"\u8F6C\u8D26\u4E2D",value:"2",color:"orange"},{label:"\u8F6C\u8D26\u6210\u529F",value:"3",color:"green"},{label:"\u8F6C\u8D26\u5931\u8D25",value:"-1",color:"red"},{label:"\u5BA1\u6279\u62D2\u7EDD",value:"-2",color:"red"}]},d=function(i){var u=new Date(i),F=u.getFullYear().toString().padStart(4,"0"),s=(u.getMonth()+1).toString().padStart(2,"0"),m=u.getDate().toString().padStart(2,"0");return F+s+m},k=function(i,u){var F=i.toString();return F.padStart(u,"0")},f=function(i){var u=i;return u<1024?u+" B":(u=parseFloat((u/1024).toFixed(2)),u<1024?u+" KB":(u=parseFloat((u/1024).toFixed(2)),u+" MB"))}},58125:function(G,y,n){n.d(y,{D:function(){return l},P:function(){return _}});var _=function(d){return d?parseFloat((d/1e5).toFixed(2)):0},l=function(d){return d?parseFloat((d/100).toFixed(2)):0}}}]);
|
|
|