Browse Source

同上

fanmiyou
nili 7 months ago
parent
commit
3a0e509073
  1. 33
      config/routes.ts
  2. 1
      dist/134.957d5baa.async.js
  3. 272
      dist/168.01472d0e.async.js
  4. 3
      dist/169.c5babfbf.async.js
  5. 23
      dist/17.a8d28792.async.js
  6. 58
      dist/245.2508f87f.async.js
  7. 1
      dist/397.0ef2ea1f.async.js
  8. 286
      dist/418.2bc93afc.async.js
  9. 1
      dist/430.69b00127.async.js
  10. 1
      dist/470.bb8d466d.async.js
  11. 8
      dist/559.683b9a7b.async.js
  12. 1
      dist/60.16c1b5e4.async.js
  13. 20
      dist/601.f0684ea2.async.js
  14. 30
      dist/706.1c4598f2.async.js
  15. 27
      dist/89.d8aaef40.async.js
  16. 9
      dist/91.5ae90b01.async.js
  17. 58
      dist/930.66e0f98d.async.js
  18. 26
      dist/970.3772d094.async.js
  19. 42
      dist/991.9f137da9.async.js
  20. 4
      dist/index.html
  21. 1
      dist/p__AdminManagement.8ca066a9.async.js
  22. 1
      dist/p__AdminManagement.ea5b8705.async.js
  23. 2
      dist/p__AdvRecordList.6627af53.async.js
  24. 1
      dist/p__AppManagement.edc3d5dd.async.js
  25. 10
      dist/p__Bind.a80b7711.async.js
  26. 1
      dist/p__DeviceOwnerApp.8642b903.async.js
  27. 1
      dist/p__Overview.86015104.async.js
  28. 1
      dist/p__Overview.e38f6d59.async.js
  29. 1
      dist/p__User__Login__index.a2e43957.async.js
  30. 1
      dist/p__User__Login__index.e1ea880f.async.js
  31. 1
      dist/p__Welcome.0f971878.async.js
  32. BIN
      dist/static/welcome.793d2d05.jpeg
  33. 1
      dist/umi.1ca9308c.css
  34. 433
      dist/umi.38177927.js
  35. 433
      dist/umi.a3b5cb79.js
  36. 1
      dist/umi.f9018446.css
  37. 4
      src/access.ts
  38. 3
      src/app.tsx
  39. BIN
      src/assets/welcome.jpeg
  40. 3
      src/global.less
  41. 84
      src/pages/AdminManagement.tsx
  42. 71
      src/pages/DeviceOwnerApp.tsx
  43. 2
      src/pages/Overview.tsx
  44. 30
      src/pages/User/Login/index.tsx
  45. 162
      src/pages/Welcome.tsx
  46. 27
      src/services/matrix/admin.ts
  47. 2
      src/services/matrix/index.ts
  48. 30
      src/services/matrix/matrixController.ts
  49. 47
      src/services/matrix/typings.d.ts

33
config/routes.ts

@ -1,4 +1,5 @@
/** import { layout } from '../src/app';
/**
* @name umi * @name umi
* @description path,component,routes,redirect,wrappers,name,icon * @description path,component,routes,redirect,wrappers,name,icon
* @param path path 第一种是动态参数 :id * * @param path path 第一种是动态参数 :id *
@ -22,28 +23,54 @@ export default [
}, },
], ],
}, },
{
path: '/welcome',
name: '欢迎',
icon: 'smile',
component: './Welcome',
},
{ {
path: '/overview', path: '/overview',
name: '数据概览', name: '数据概览',
icon: 'dashboard', icon: 'dashboard',
access: 'canAdmin',
component: './Overview', component: './Overview',
}, },
{ {
path: '/advList', path: '/advList',
name: '广告列表', name: '广告列表',
icon: 'smile', icon: 'smile',
access: 'canAdmin',
component: './AdvRecordList', component: './AdvRecordList',
}, },
{
path: '/appList',
name: '应用列表',
icon: 'smile',
access: 'canDeviceOwner',
component: './DeviceOwnerApp',
},
{ {
path: '/adminList', path: '/adminList',
name: '人员管理', name: '人员管理',
access: 'canAdmin', access: 'canAdmin',
component: './AdminManagement' component: './AdminManagement'
}, },
{
path: '/bind',
name: '绑定设备',
access: 'canDeviceOwner',
component: './Bind'
},
{
path: '/appManage',
name: '应用管理',
access: 'canAdmin',
component: './AppManagement'
},
{ {
path: '/', path: '/',
redirect: '/overview', redirect: '/welcome',
}, },
{ {
path: '*', path: '*',

1
dist/134.957d5baa.async.js

File diff suppressed because one or more lines are too long

272
dist/168.01472d0e.async.js

File diff suppressed because one or more lines are too long

3
dist/169.c5babfbf.async.js

File diff suppressed because one or more lines are too long

23
dist/17.5b8b716b.async.js → dist/17.a8d28792.async.js

File diff suppressed because one or more lines are too long

58
dist/245.2508f87f.async.js

File diff suppressed because one or more lines are too long

1
dist/397.0ef2ea1f.async.js

File diff suppressed because one or more lines are too long

286
dist/418.2bc93afc.async.js

File diff suppressed because one or more lines are too long

1
dist/430.69b00127.async.js

File diff suppressed because one or more lines are too long

1
dist/470.bb8d466d.async.js

File diff suppressed because one or more lines are too long

8
dist/559.683b9a7b.async.js

File diff suppressed because one or more lines are too long

1
dist/60.16c1b5e4.async.js

File diff suppressed because one or more lines are too long

20
dist/624.7b73a47c.async.js → dist/601.f0684ea2.async.js

File diff suppressed because one or more lines are too long

30
dist/706.1c4598f2.async.js

File diff suppressed because one or more lines are too long

27
dist/89.d8aaef40.async.js

File diff suppressed because one or more lines are too long

9
dist/91.5ae90b01.async.js

File diff suppressed because one or more lines are too long

58
dist/930.66e0f98d.async.js

File diff suppressed because one or more lines are too long

26
dist/970.3772d094.async.js

File diff suppressed because one or more lines are too long

42
dist/991.9f137da9.async.js

File diff suppressed because one or more lines are too long

4
dist/index.html

@ -4,11 +4,11 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="shortcut icon" href="logo.jpg"> <link rel="shortcut icon" href="logo.jpg">
<title>Ant Design Pro</title> <title>Ant Design Pro</title>
<link rel="stylesheet" href="/umi.1ca9308c.css"> <link rel="stylesheet" href="/umi.f9018446.css">
<script async="" src="/scripts/loading.js"></script> <script async="" src="/scripts/loading.js"></script>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script src="/umi.38177927.js"></script> <script src="/umi.a3b5cb79.js"></script>
</body></html> </body></html>

1
dist/p__AdminManagement.8ca066a9.async.js

File diff suppressed because one or more lines are too long

1
dist/p__AdminManagement.ea5b8705.async.js

File diff suppressed because one or more lines are too long

2
dist/p__AdvRecordList.54974c8a.async.js → dist/p__AdvRecordList.6627af53.async.js

@ -1 +1 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[857],{46701:function(O,i,e){e.r(i);var p=e(15009),d=e.n(p),v=e(99289),o=e.n(v),h=e(90930),E=e(50624),f=e(35312),I=e(67294),m=e(48357),c=e(85893),x=function(){var T=(0,I.useRef)(),M=(0,f.useIntl)(),D=function(){var u=o()(d()().mark(function a(){var s,_,r;return d()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,m.ln)();case 2:return _=n.sent,r=[],(s=_.data)===null||s===void 0||s.forEach(function(t){r.push({label:t.name,value:t.code})}),n.abrupt("return",r);case 6:case"end":return n.stop()}},a)}));return function(){return u.apply(this,arguments)}}(),P=[{title:"\u5E94\u7528\u540D\u79F0",hideInTable:!0,dataIndex:"code",valueType:"select",request:D},{title:"\u8BBE\u5907Id",dataIndex:"deviceId",valueType:"textarea",ellipsis:!0,copyable:!0},{title:"\u5E94\u7528\u540D\u79F0",hideInSearch:!0,dataIndex:"appName",valueType:"textarea"},{title:"\u5E73\u53F0",dataIndex:"platform",valueEnum:{1:{text:"\u7A7F\u5C71\u7532"},2:{text:"\u817E\u8BAF"},3:{text:"\u767E\u5EA6\u8054\u76DF"},4:{text:"Mintegral"},5:{text:"\u5FEB\u624B"},6:{text:"\u6E38\u53EF\u8D62"},7:{text:"Sigmob"},8:{text:"Admob"}}},{title:"\u5E7F\u544A\u7C7B\u578B",dataIndex:"advType",valueEnum:{1:{text:"\u6A2A\u5E45",status:"Default"},2:{text:"\u63D2\u9875",status:"Processing"},3:{text:"\u6FC0\u52B1\u89C6\u9891",status:"Success"}}},{title:"ecpm(\u5143)",dataIndex:"ecpm",hideInSearch:!0,renderText:function(a){return a/100}},{title:"\u8BBE\u5907\u54C1\u724C",dataIndex:"deviceBrand",hideInSearch:!0,valueType:"textarea"},{title:"\u8BBE\u5907\u540D",dataIndex:"deviceName",hideInSearch:!0,valueType:"textarea"},{title:"ip",dataIndex:"ip",hideInSearch:!0,valueType:"textarea"},{title:"\u65F6\u95F4",hideInSearch:!0,dataIndex:"createdAt",valueType:"dateTime"},{title:"\u65F6\u95F4",hideInTable:!0,dataIndex:"createdAt",valueType:"dateRange"}];return(0,c.jsx)(h._z,{children:(0,c.jsx)(E.Z,{headerTitle:M.formatMessage({id:"pages.searchTable.title",defaultMessage:"Enquiry form"}),actionRef:T,rowKey:"key",search:{labelWidth:120},request:function(){var u=o()(d()().mark(function a(s){var _,r,l;return d()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,m._5)(s);case 2:return l=t.sent,t.abrupt("return",{data:(_=l.data)===null||_===void 0?void 0:_.data,total:(r=l.data)===null||r===void 0?void 0:r.total,success:!0});case 4:case"end":return t.stop()}},a)}));return function(a){return u.apply(this,arguments)}}(),columns:P})})};i.default=x}}]); "use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[857],{46701:function(O,i,e){e.r(i);var p=e(15009),d=e.n(p),v=e(99289),o=e.n(v),h=e(90930),E=e(85601),f=e(35312),I=e(67294),m=e(48357),c=e(85893),x=function(){var T=(0,I.useRef)(),M=(0,f.useIntl)(),D=function(){var u=o()(d()().mark(function a(){var s,_,r;return d()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,m.ln)();case 2:return _=n.sent,r=[],(s=_.data)===null||s===void 0||s.forEach(function(t){r.push({label:t.name,value:t.code})}),n.abrupt("return",r);case 6:case"end":return n.stop()}},a)}));return function(){return u.apply(this,arguments)}}(),P=[{title:"\u5E94\u7528\u540D\u79F0",hideInTable:!0,dataIndex:"code",valueType:"select",request:D},{title:"\u8BBE\u5907Id",dataIndex:"deviceId",valueType:"textarea",ellipsis:!0,copyable:!0},{title:"\u5E94\u7528\u540D\u79F0",hideInSearch:!0,dataIndex:"appName",valueType:"textarea"},{title:"\u5E73\u53F0",dataIndex:"platform",valueEnum:{1:{text:"\u7A7F\u5C71\u7532"},2:{text:"\u817E\u8BAF"},3:{text:"\u767E\u5EA6\u8054\u76DF"},4:{text:"Mintegral"},5:{text:"\u5FEB\u624B"},6:{text:"\u6E38\u53EF\u8D62"},7:{text:"Sigmob"},8:{text:"Admob"}}},{title:"\u5E7F\u544A\u7C7B\u578B",dataIndex:"advType",valueEnum:{1:{text:"\u6A2A\u5E45",status:"Default"},2:{text:"\u63D2\u9875",status:"Processing"},3:{text:"\u6FC0\u52B1\u89C6\u9891",status:"Success"}}},{title:"ecpm(\u5143)",dataIndex:"ecpm",hideInSearch:!0,renderText:function(a){return a/100}},{title:"\u8BBE\u5907\u54C1\u724C",dataIndex:"deviceBrand",hideInSearch:!0,valueType:"textarea"},{title:"\u8BBE\u5907\u540D",dataIndex:"deviceName",hideInSearch:!0,valueType:"textarea"},{title:"ip",dataIndex:"ip",hideInSearch:!0,valueType:"textarea"},{title:"\u65F6\u95F4",hideInSearch:!0,dataIndex:"createdAt",valueType:"dateTime"},{title:"\u65F6\u95F4",hideInTable:!0,dataIndex:"createdAt",valueType:"dateRange"}];return(0,c.jsx)(h._z,{children:(0,c.jsx)(E.Z,{headerTitle:M.formatMessage({id:"pages.searchTable.title",defaultMessage:"Enquiry form"}),actionRef:T,rowKey:"key",search:{labelWidth:120},request:function(){var u=o()(d()().mark(function a(s){var _,r,l;return d()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,m._5)(s);case 2:return l=t.sent,t.abrupt("return",{data:(_=l.data)===null||_===void 0?void 0:_.data,total:(r=l.data)===null||r===void 0?void 0:r.total,success:!0});case 4:case"end":return t.stop()}},a)}));return function(a){return u.apply(this,arguments)}}(),columns:P})})};i.default=x}}]);

1
dist/p__AppManagement.edc3d5dd.async.js

@ -0,0 +1 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[39],{84702:function(Q,v,e){e.r(v);var j=e(15009),d=e.n(j),P=e(99289),p=e.n(P),A=e(5574),m=e.n(A),x=e(90930),I=e(85601),U=e(35312),s=e(8232),C=e(55241),T=e(10397),B=e(14726),R=e(17788),i=e(96365),E=e(67294),h=e(48357),n=e(85893),W=function(){var b=(0,E.useState)(!1),f=m()(b,2),K=f[0],u=f[1],L=s.Z.useForm(),y=m()(L,1),o=y[0],Z=(0,E.useState)([]),M=m()(Z,2),F=M[0],S=M[1],g=(0,U.useModel)("@@initialState"),c=g.initialState,l=c==null?void 0:c.currentUser,$=l&&l.role&&l.role<2,G=function(r){o.setFieldsValue(r),u(!0)},O=[{title:"\u5E94\u7528\u540D",dataIndex:"name"},{title:"code",dataIndex:"code"},{title:"\u4E0B\u8F7D\u5730\u5740",dataIndex:"url",renderText:function(r){return(0,n.jsx)(C.Z,{overlayInnerStyle:{padding:0},content:(0,n.jsx)(T.Z,{value:r||"",bordered:!1}),children:(0,n.jsx)("a",{children:r})})}}],N=[].concat(O,[{title:"secret",dataIndex:"secret",ellipsis:!0,copyable:!0},{title:"\u64CD\u4F5C",width:80,renderText:function(r){return(0,n.jsx)("a",{onClick:function(){return G(r)},children:"\u7F16\u8F91"},"edit")}}]),V=function(){o.submit()},z=function(){u(!1)},D=function(){var _=p()(d()().mark(function r(){var t;return d()().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,(0,h.ln)();case 2:t=a.sent,t.data&&S(t.data);case 4:case"end":return a.stop()}},r)}));return function(){return _.apply(this,arguments)}}();(0,E.useEffect)(function(){D()},[]);var J=function(){o.resetFields(),u(!0)},X=function(){var _=p()(d()().mark(function r(t){return d()().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,(0,h.XJ)(t);case 3:a.next=8;break;case 5:return a.prev=5,a.t0=a.catch(0),a.abrupt("return");case 8:u(!1),D();case 10:case"end":return a.stop()}},r,null,[[0,5]])}));return function(t){return _.apply(this,arguments)}}();return(0,n.jsxs)(x._z,{children:[l&&l.role&&l.role<2&&(0,n.jsx)(B.ZP,{style:{marginBottom:"20px"},onClick:J,children:"\u65B0\u5EFA\u5E94\u7528"}),(0,n.jsx)(I.Z,{search:!1,columns:$?N:O,dataSource:F}),(0,n.jsx)(R.Z,{title:"\u7F16\u8F91",visible:K,onOk:V,onCancel:z,children:(0,n.jsxs)(s.Z,{form:o,onFinish:X,children:[(0,n.jsx)(s.Z.Item,{name:"id",style:{display:"none"},children:(0,n.jsx)(i.Z,{type:"hidden"})}),(0,n.jsx)(s.Z.Item,{name:"code",style:{display:"none"},children:(0,n.jsx)(i.Z,{type:"hidden"})}),(0,n.jsx)(s.Z.Item,{label:"\u5E94\u7528\u540D",name:"name",children:(0,n.jsx)(i.Z,{})}),(0,n.jsx)(s.Z.Item,{label:"\u4E0B\u8F7D\u5730\u5740",name:"url",children:(0,n.jsx)(i.Z,{})})]})})]})};v.default=W}}]);

10
dist/p__Bind.a80b7711.async.js

File diff suppressed because one or more lines are too long

1
dist/p__DeviceOwnerApp.8642b903.async.js

File diff suppressed because one or more lines are too long

1
dist/p__Overview.86015104.async.js

@ -0,0 +1 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[628],{58451:function(_e,f,e){e.r(f);var b=e(97857),C=e.n(b),T=e(15009),r=e.n(T),R=e(99289),v=e.n(R),x=e(5574),m=e.n(x),E=e(48357),I=e(64289),o=e(31847),B=e(90930),K=e(57470),p=e(64317),L=e(34540),W=e(27484),g=e.n(W),y=e(9220),l=e(67294),S=e(96974),a=e(85893),Z=function(){var F=(0,l.useState)(),D=m()(F,2),i=D[0],z=D[1],G=(0,l.useState)([]),O=m()(G,2),P=O[0],$=O[1],H=(0,l.useState)([]),M=m()(H,2),J=M[0],N=M[1],Q=o.Z.Divider,V=(0,l.useState)(!1),j=m()(V,2),h=j[0],X=j[1],Y=(0,S.UO)(),A=Y.code,w=function(){var t=v()(r()().mark(function _(){var s;return r()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,E.d1)({appCode:A});case 2:s=n.sent,s.data&&z(s.data);case 4:case"end":return n.stop()}},_)}));return function(){return t.apply(this,arguments)}}(),k=function(){var t=v()(r()().mark(function _(){var s;return r()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,E.ln)();case 2:s=n.sent,s.data&&N(s.data);case 4:case"end":return n.stop()}},_)}));return function(){return t.apply(this,arguments)}}(),U=function(){var t=v()(r()().mark(function _(s){var u;return r()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,(0,E.Zb)(s);case 2:u=d.sent,u.data&&$(u.data);case 4:case"end":return d.stop()}},_)}));return function(s){return t.apply(this,arguments)}}();(0,l.useEffect)(function(){w(),k(),U({code:A})},[]);var c=function(_){return _?parseFloat((_/1e5).toFixed(2)):0},q=P.map(function(t){return{date:t.date+"",income:c(t.income)}}),ee={data:q,xField:"date",yField:"income",tooltip:{name:"\u6536\u5165",field:"income"},axis:{date:{title:"\u65E5\u671F"},income:{title:"\u6536\u5165\uFF08\u5143\uFF09"}},title:"\u533A\u95F4\u7D2F\u8BA1"+c(P.reduce(function(t,_){return t+(_.income?_.income:0)},0))+"\u5143",height:400,label:{text:function(_){return _.\u6536\u5165>0?_.\u6536\u5165:""},textBaseline:"bottom"}};return(0,a.jsxs)(B._z,{children:[(0,a.jsx)(y.Z,{onResize:function(_){X(_.width<596)},children:(0,a.jsx)(o.Z,{children:(0,a.jsxs)(o.Z.Group,{direction:h?"column":"row",children:[(0,a.jsx)(o.Z,{statistic:{title:"\u7D2F\u8BA1\u6536\u5165\uFF08\u5143\uFF09",value:c(i==null?void 0:i.totalIncome)}}),(0,a.jsx)(Q,{type:h?"horizontal":"vertical"}),(0,a.jsx)(o.Z,{statistic:{title:"\u4ECA\u65E5\u6536\u5165\uFF08\u5143\uFF09",value:c(i==null?void 0:i.todayIncome)}})]})})},"resize-observer"),(0,a.jsxs)("div",{style:{marginTop:"20px",padding:"40px"},children:[(0,a.jsxs)(K.t,{defaultCollapsed:!0,split:!0,onFinish:U,children:[(0,a.jsx)(p.Z,{name:"code",label:"\u5E94\u7528",options:J.map(function(t){return{label:t.name,value:t.code}})}),(0,a.jsx)(p.Z,{label:"\u5E73\u53F0",name:"platform",valueEnum:{1:"\u7A7F\u5C71\u7532",2:"\u817E\u8BAF",3:"\u767E\u5EA6\u8054\u76DF",4:"Mintegral",5:"\u5FEB\u624B",6:"\u6E38\u53EF\u8D62",7:"Sigmob",8:"Admob"}}),(0,a.jsx)(p.Z,{name:"advType",label:"\u5E7F\u544A\u7C7B\u578B",valueEnum:{1:"\u6A2A\u5E45",2:"\u63D2\u9875",3:"\u6FC0\u52B1\u89C6\u9891"}}),(0,a.jsx)(L.Z,{fieldProps:{disabledDate:function(_){return _&&_>=g()().startOf("day")}},name:"date",label:"\u65F6\u95F4"})]}),(0,a.jsx)(I.Z,C()({},ee))]})]})};f.default=Z}}]);

1
dist/p__Overview.e38f6d59.async.js

@ -1 +0,0 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[628],{58451:function(_e,p,e){e.r(p);var b=e(97857),C=e.n(b),T=e(15009),r=e.n(T),R=e(99289),v=e.n(R),x=e(5574),m=e.n(x),E=e(48357),I=e(64289),i=e(31847),B=e(90930),g=e(57470),f=e(64317),K=e(34540),L=e(27484),W=e.n(L),y=e(9220),l=e(67294),S=e(96974),a=e(85893),Z=function(){var F=(0,l.useState)(),D=m()(F,2),o=D[0],z=D[1],G=(0,l.useState)([]),O=m()(G,2),P=O[0],$=O[1],H=(0,l.useState)([]),M=m()(H,2),J=M[0],N=M[1],Q=i.Z.Divider,V=(0,l.useState)(!1),j=m()(V,2),h=j[0],X=j[1],Y=(0,S.UO)(),A=Y.code,w=function(){var t=v()(r()().mark(function _(){var s;return r()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,E.d1)({appCode:A});case 2:s=n.sent,s.data&&z(s.data);case 4:case"end":return n.stop()}},_)}));return function(){return t.apply(this,arguments)}}(),k=function(){var t=v()(r()().mark(function _(){var s;return r()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,E.ln)();case 2:s=n.sent,s.data&&N(s.data);case 4:case"end":return n.stop()}},_)}));return function(){return t.apply(this,arguments)}}(),U=function(){var t=v()(r()().mark(function _(s){var u;return r()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return console.log("fetchDaily"),console.log(s),d.next=4,(0,E.Zb)(s);case 4:u=d.sent,u.data&&$(u.data);case 6:case"end":return d.stop()}},_)}));return function(s){return t.apply(this,arguments)}}();(0,l.useEffect)(function(){w(),k(),U({code:A})},[]);var c=function(_){return _?parseFloat((_/1e5).toFixed(2)):0},q=P.map(function(t){return{date:t.date+"",income:c(t.income)}}),ee={data:q,xField:"date",yField:"income",tooltip:{name:"\u6536\u5165",field:"income"},axis:{date:{title:"\u65E5\u671F"},income:{title:"\u6536\u5165\uFF08\u5143\uFF09"}},title:"\u533A\u95F4\u7D2F\u8BA1"+c(P.reduce(function(t,_){return t+(_.income?_.income:0)},0))+"\u5143",height:400,label:{text:function(_){return _.\u6536\u5165>0?_.\u6536\u5165:""},textBaseline:"bottom"}};return(0,a.jsxs)(B._z,{children:[(0,a.jsx)(y.Z,{onResize:function(_){X(_.width<596)},children:(0,a.jsx)(i.Z,{children:(0,a.jsxs)(i.Z.Group,{direction:h?"column":"row",children:[(0,a.jsx)(i.Z,{statistic:{title:"\u7D2F\u8BA1\u6536\u5165\uFF08\u5143\uFF09",value:c(o==null?void 0:o.totalIncome)}}),(0,a.jsx)(Q,{type:h?"horizontal":"vertical"}),(0,a.jsx)(i.Z,{statistic:{title:"\u4ECA\u65E5\u6536\u5165\uFF08\u5143\uFF09",value:c(o==null?void 0:o.todayIncome)}})]})})},"resize-observer"),(0,a.jsxs)("div",{style:{marginTop:"20px",padding:"40px"},children:[(0,a.jsxs)(g.t,{defaultCollapsed:!0,split:!0,onFinish:U,children:[(0,a.jsx)(f.Z,{name:"code",label:"\u5E94\u7528",options:J.map(function(t){return{label:t.name,value:t.code}})}),(0,a.jsx)(f.Z,{label:"\u5E73\u53F0",name:"platform",valueEnum:{1:"\u7A7F\u5C71\u7532",2:"\u817E\u8BAF",3:"\u767E\u5EA6\u8054\u76DF",4:"Mintegral",5:"\u5FEB\u624B",6:"\u6E38\u53EF\u8D62",7:"Sigmob",8:"Admob"}}),(0,a.jsx)(f.Z,{name:"advType",label:"\u5E7F\u544A\u7C7B\u578B",valueEnum:{1:"\u6A2A\u5E45",2:"\u63D2\u9875",3:"\u6FC0\u52B1\u89C6\u9891"}}),(0,a.jsx)(K.Z,{fieldProps:{disabledDate:function(_){return _&&_>=W()().startOf("day")}},name:"date",label:"\u65F6\u95F4"})]}),(0,a.jsx)(I.Z,C()({},ee))]})]})};p.default=Z}}]);

1
dist/p__User__Login__index.a2e43957.async.js

File diff suppressed because one or more lines are too long

1
dist/p__User__Login__index.e1ea880f.async.js

File diff suppressed because one or more lines are too long

1
dist/p__Welcome.0f971878.async.js

File diff suppressed because one or more lines are too long

BIN
dist/static/welcome.793d2d05.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

1
dist/umi.1ca9308c.css

@ -1 +0,0 @@
html,body,#root{height:100%;margin:0;padding:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.colorWeak{filter:invert(80%)}.ant-layout{min-height:100vh}.ant-pro-sider.ant-layout-sider.ant-pro-sider-fixed{left:unset}canvas{display:block}body{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}ul,ol{list-style:none}@media (max-width: 768px){.ant-table{width:100%;overflow-x:auto}.ant-table-thead>tr>th,.ant-table-tbody>tr>th,.ant-table-thead>tr>td,.ant-table-tbody>tr>td{white-space:pre}.ant-table-thead>tr>th>span,.ant-table-tbody>tr>th>span,.ant-table-thead>tr>td>span,.ant-table-tbody>tr>td>span{display:block}}html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{text-decoration:underline;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type="range"]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}

433
dist/umi.38177927.js

File diff suppressed because one or more lines are too long

433
dist/umi.a3b5cb79.js

File diff suppressed because one or more lines are too long

1
dist/umi.f9018446.css

@ -0,0 +1 @@
html,body,#root{height:100%;margin:0;padding:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.colorWeak{filter:invert(80%)}.ant-layout{min-height:100vh}.ant-pro-sider.ant-layout-sider.ant-pro-sider-fixed{left:unset}.ant-menu-item-selected{background:#f0f8ff!important}canvas{display:block}body{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}ul,ol{list-style:none}@media (max-width: 768px){.ant-table{width:100%;overflow-x:auto}.ant-table-thead>tr>th,.ant-table-tbody>tr>th,.ant-table-thead>tr>td,.ant-table-tbody>tr>td{white-space:pre}.ant-table-thead>tr>th>span,.ant-table-tbody>tr>th>span,.ant-table-thead>tr>td>span,.ant-table-tbody>tr>td>span{display:block}}html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{text-decoration:underline;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type="range"]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}

4
src/access.ts

@ -4,8 +4,8 @@
export default function access(initialState: { currentUser?: API.MatrixAdmin } | undefined) { export default function access(initialState: { currentUser?: API.MatrixAdmin } | undefined) {
const { currentUser } = initialState ?? {}; const { currentUser } = initialState ?? {};
let data = { let data = {
canAdmin: currentUser && currentUser.role && currentUser.role < 3 canAdmin: currentUser && currentUser.role && currentUser.role <= 3,
canDeviceOwner: currentUser && currentUser.role && currentUser.role > 3,
}; };
return data; return data;
} }

3
src/app.tsx

@ -2,8 +2,7 @@ import { AvatarDropdown, AvatarName, Question, SelectLang } from '@/components';
import { current } from '@/services/matrix/admin'; import { current } from '@/services/matrix/admin';
import { LinkOutlined } from '@ant-design/icons'; import { LinkOutlined } from '@ant-design/icons';
import { SettingDrawer } from '@ant-design/pro-components'; import { SettingDrawer } from '@ant-design/pro-components';
import { history, Link } from '@umijs/max'; import { Link, history } from '@umijs/max';
import React from 'react';
import defaultSettings from '../config/defaultSettings'; import defaultSettings from '../config/defaultSettings';
import { errorConfig } from './requestErrorConfig'; import { errorConfig } from './requestErrorConfig';

BIN
src/assets/welcome.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

3
src/global.less

@ -20,6 +20,9 @@ body,
left: unset; left: unset;
} }
.ant-menu-item-selected{
background: #f0f8ff !important
}
canvas { canvas {
display: block; display: block;
} }

84
src/pages/AdminManagement.tsx

@ -1,30 +1,33 @@
import { adminList, appList, saveAdmin } from '@/services/matrix/admin';
import { useModel } from '@umijs/max'; import { useModel } from '@umijs/max';
import { Button, Form, Input, Modal, Select, Table, Tag } from 'antd'; import { Button, Col, Form, Input, InputNumber, Modal, Row, Select, Table, Tag } from 'antd';
import { ColumnsType } from 'antd/es/table'; import { ColumnsType } from 'antd/es/table';
import React, { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { adminList, appList, saveAdmin } from '../services/matrix/admin';
const AdminManagement = () => { const AdminManagement = () => {
const [data, setData] = useState<API.MatrixAdminBo[]>([]); const [data, setData] = useState<API.MatrixAdminBo[]>([]);
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [editing, setEditing] = useState(false);
const [role, setRole] = useState<number>(0);
const [form] = Form.useForm(); const [form] = Form.useForm();
const [appArr, setAppArr] = useState<API.MatrixApp[]>([]); const [appArr, setAppArr] = useState<API.MatrixApp[]>([]);
const { initialState } = useModel('@@initialState'); const { initialState } = useModel('@@initialState');
const currentUser = initialState?.currentUser; const currentUser = initialState?.currentUser;
const getAppNameById = (appId:number) => { const getAppNameById = (appId: number) => {
const app = appArr.find(app => app.id === appId); const app = appArr.find((app) => app.id === appId);
return app ? app.name : ''; return app ? app.name : '';
}; };
const handleEdit = (record:API.MatrixAdminBo) => { const handleEdit = (record: API.MatrixAdminBo) => {
form.setFieldsValue(record); form.setFieldsValue(record);
setVisible(true); setVisible(true);
setEditing(true);
setRole(record.role ? record.role : 0);
}; };
const columns: ColumnsType<API.MatrixAdminBo> = [
const columns:ColumnsType<API.MatrixAdminBo> = [
{ {
title: '姓名', title: '姓名',
dataIndex: 'name', dataIndex: 'name',
@ -33,9 +36,9 @@ const AdminManagement = () => {
{ {
title: '应用IDs', title: '应用IDs',
dataIndex: 'appIds', dataIndex: 'appIds',
render: (text:[]) => ( render: (text: []) => (
<div> <div>
{text?.map(appId => ( {text?.map((appId) => (
<Tag color="blue" key={appId}> <Tag color="blue" key={appId}>
{getAppNameById(appId)} {getAppNameById(appId)}
</Tag> </Tag>
@ -46,7 +49,7 @@ const AdminManagement = () => {
{ {
title: '角色', title: '角色',
dataIndex: 'role', dataIndex: 'role',
render: (r:number) => { render: (r: number) => {
let roleText = ''; let roleText = '';
switch (r) { switch (r) {
case 1: case 1:
@ -58,6 +61,9 @@ const AdminManagement = () => {
case 3: case 3:
roleText = '普通账号'; roleText = '普通账号';
break; break;
case 4:
roleText = '口子';
break;
default: default:
roleText = ''; roleText = '';
} }
@ -66,13 +72,14 @@ const AdminManagement = () => {
}, },
{ {
title: '操作', title: '操作',
render: (record:API.MatrixAdminBo) => [ render: (record: API.MatrixAdminBo) => [
<a key="edit" onClick={() => handleEdit(record)}></a>, <a key="edit" onClick={() => handleEdit(record)}>
</a>,
], ],
}, },
]; ];
const handleOk = () => { const handleOk = () => {
form.submit(); form.submit();
}; };
@ -88,12 +95,12 @@ const AdminManagement = () => {
} }
}; };
const fetchApp = async() =>{ const fetchApp = async () => {
const res = await appList(); const res = await appList();
if (res.data) { if (res.data) {
setAppArr(res.data); setAppArr(res.data);
} }
} };
useEffect(() => { useEffect(() => {
fetchData(); fetchData();
@ -103,10 +110,12 @@ const AdminManagement = () => {
const handleNew = () => { const handleNew = () => {
form.resetFields(); // 重置表单字段 form.resetFields(); // 重置表单字段
setVisible(true); setVisible(true);
setEditing(false);
setRole(0);
}; };
const handleSaveAdmin = async (values: API.MatrixAdminBo) => { const handleSaveAdmin = async (values: API.MatrixAdminBo) => {
try{ try {
await saveAdmin(values); await saveAdmin(values);
} catch (e) { } catch (e) {
return; return;
@ -120,25 +129,20 @@ const AdminManagement = () => {
<Button onClick={handleNew}></Button> <Button onClick={handleNew}></Button>
<Table columns={columns} dataSource={data} /> <Table columns={columns} dataSource={data} />
<Modal <Modal title="编辑" visible={visible} onOk={handleOk} onCancel={handleCancel}>
title="编辑"
visible={visible}
onOk={handleOk}
onCancel={handleCancel}
>
<Form form={form} onFinish={handleSaveAdmin}> <Form form={form} onFinish={handleSaveAdmin}>
<Form.Item name="id" style={{ display: 'none' }}> <Form.Item name="id" style={{ display: 'none' }}>
<Input type="hidden" /> <Input type="hidden" />
</Form.Item> </Form.Item>
<Form.Item label="用户名" name="name"> <Form.Item label="用户名" name="name">
<Input /> <Input disabled={editing} />
</Form.Item> </Form.Item>
<Form.Item label="密码" name="password"> <Form.Item label="密码" name="password">
<Input.Password /> <Input.Password disabled={editing} />
</Form.Item> </Form.Item>
<Form.Item label="应用" name="appIds"> <Form.Item label="应用" name="appIds">
<Select mode="multiple"> <Select mode="multiple">
{appArr.map(app => ( {appArr.map((app) => (
<Select.Option key={app.id} value={app.id}> <Select.Option key={app.id} value={app.id}>
{app.name} {app.name}
</Select.Option> </Select.Option>
@ -146,16 +150,34 @@ const AdminManagement = () => {
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item label="角色" name="role"> <Form.Item label="角色" name="role">
<Select> <Select disabled={editing} onSelect={setRole}>
<Select.Option disabled={currentUser?.role && currentUser.role > 1} value={2}></Select.Option> <Select.Option disabled={currentUser?.role && currentUser.role > 1} value={2}>
<Select.Option value={3}></Select.Option>
</Select.Option>
<Select.Option disabled={currentUser?.role && currentUser.role > 2} value={3}>
</Select.Option>
<Select.Option value={4}></Select.Option>
</Select> </Select>
</Form.Item> </Form.Item>
{role > 3 && (
<Row>
<Col span={12}>
<Form.Item label="收入比例" name="incomeRate">
<InputNumber placeholder="1-100整数" style={{ width: '80%' }} />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="设备数" name="deviceCnt">
<InputNumber style={{ width: '80%' }} />
</Form.Item>
</Col>
</Row>
)}
</Form> </Form>
</Modal> </Modal>
</div> </div>
); );
}; };
export default AdminManagement; export default AdminManagement;

71
src/pages/DeviceOwnerApp.tsx

@ -1,10 +1,15 @@
import { advList } from '@/services/matrix/admin'; import { advList, appList } from '@/services/matrix/admin';
import { PageContainer, ProColumns, ProTable } from '@ant-design/pro-components'; import {
PageContainer,
ProColumns,
ProFieldRequestData,
ProTable,
RequestOptionsType,
} from '@ant-design/pro-components';
import { useIntl, useModel } from '@umijs/max'; import { useIntl, useModel } from '@umijs/max';
import { Tabs } from 'antd'; import { Tabs } from 'antd';
import TabPane from 'antd/es/tabs/TabPane'; import TabPane from 'antd/es/tabs/TabPane';
import React, { useEffect, useRef, useState } from 'react'; import React, { useRef, useState } from 'react';
import { useParams } from 'react-router-dom';
// import { RequestOptionsType, ProFieldRequestData } from "@ant-design/pro-utils"; // import { RequestOptionsType, ProFieldRequestData } from "@ant-design/pro-utils";
@ -19,13 +24,29 @@ const DeviceOwnerApp: React.FC = () => {
* @zh-CN * @zh-CN
* */ * */
const intl = useIntl(); const intl = useIntl();
const { code } = useParams();
const { initialState } = useModel('@@initialState'); const { initialState } = useModel('@@initialState');
const currentUser = initialState?.currentUser; const currentUser = initialState?.currentUser;
const fetchDevice = async () => { const appNameMap: ProFieldRequestData = async () => {
const res = await deviceList({ appCode: code ? code : '' }); let res = await appList();
let data: RequestOptionsType[] = [];
res.data?.forEach((x) => {
data.push({ label: x.name, value: x.code });
});
return data;
};
const fetchDevice = async (params: any) => {
if (!params.appName) {
return {
data: [],
total: 0,
success: true,
};
}
const res = await deviceList({ appCode: params.appName ? params.appName : '' });
if (res.data) { if (res.data) {
setUsedDeviceCnt(res.data?.filter((device) => device.status === 0).length); setUsedDeviceCnt(res.data?.filter((device) => device.status === 0).length);
} }
@ -45,6 +66,12 @@ const DeviceOwnerApp: React.FC = () => {
}; };
const columns: ProColumns<API.MatrixAdvRecordBo>[] = [ const columns: ProColumns<API.MatrixAdvRecordBo>[] = [
{
title: '应用名称',
dataIndex: 'appName',
valueType: 'textarea',
request: appNameMap,
},
{ {
title: '设备id', title: '设备id',
dataIndex: 'deviceId', dataIndex: 'deviceId',
@ -52,12 +79,6 @@ const DeviceOwnerApp: React.FC = () => {
ellipsis: true, ellipsis: true,
copyable: true, copyable: true,
}, },
{
title: '应用名称',
hideInSearch: true,
dataIndex: 'appName',
valueType: 'textarea',
},
{ {
title: '平台', title: '平台',
dataIndex: 'platform', dataIndex: 'platform',
@ -165,6 +186,13 @@ const DeviceOwnerApp: React.FC = () => {
]; ];
const deviceColumns: ProColumns<API.MatrixAdminDevice>[] = [ const deviceColumns: ProColumns<API.MatrixAdminDevice>[] = [
{
title: '应用名称',
dataIndex: 'appName',
valueType: 'textarea',
request: appNameMap,
hideInTable: true,
},
{ {
title: '设备id', title: '设备id',
dataIndex: 'deviceId', dataIndex: 'deviceId',
@ -172,6 +200,7 @@ const DeviceOwnerApp: React.FC = () => {
ellipsis: true, ellipsis: true,
width: 400, width: 400,
copyable: true, copyable: true,
hideInSearch: true,
}, },
{ {
title: '状态', title: '状态',
@ -186,6 +215,7 @@ const DeviceOwnerApp: React.FC = () => {
}, },
filters: true, filters: true,
onFilter: true, onFilter: true,
hideInSearch: true,
}, },
{ {
title: '绑定时间', title: '绑定时间',
@ -207,7 +237,14 @@ const DeviceOwnerApp: React.FC = () => {
]; ];
const fetchData = async (params: any) => { const fetchData = async (params: any) => {
const res = await advList({ ...params, code: code }); if (!params.appName) {
return {
data: [],
total: 0,
success: true,
};
}
const res = await advList({ ...params, code: params.appName });
return { return {
data: res.data?.data, data: res.data?.data,
total: res.data?.total, total: res.data?.total,
@ -215,11 +252,6 @@ const DeviceOwnerApp: React.FC = () => {
}; };
}; };
useEffect(() => {
actionRef.current?.reload();
deviceRef.current?.reload();
}, [code]);
return ( return (
<PageContainer> <PageContainer>
<Tabs defaultActiveKey="1" centered style={{ backgroundColor: 'white', padding: '20px' }}> <Tabs defaultActiveKey="1" centered style={{ backgroundColor: 'white', padding: '20px' }}>
@ -233,7 +265,6 @@ const DeviceOwnerApp: React.FC = () => {
<ProTable<API.MatrixAdminDevice> <ProTable<API.MatrixAdminDevice>
actionRef={deviceRef} actionRef={deviceRef}
rowKey="id" rowKey="id"
search={false}
request={fetchDevice} request={fetchDevice}
columns={deviceColumns} columns={deviceColumns}
/> />

2
src/pages/Overview.tsx

@ -36,8 +36,6 @@ const Overview: React.FC = () => {
}; };
const fetchDaily = async (params: API.IncomeQuery) => { const fetchDaily = async (params: API.IncomeQuery) => {
console.log('fetchDaily');
console.log(params);
const res = await incomeDaily(params); const res = await incomeDaily(params);
if (res.data) { if (res.data) {
setDaily(res.data); setDaily(res.data);

30
src/pages/User/Login/index.tsx

@ -1,13 +1,12 @@
import { Footer } from '@/components'; import loginBg from '@/assets/loginBg.jpg';
import { adminLogin as login } from '@/services/matrix/admin'; import { adminLogin as login } from '@/services/matrix/admin';
import { LockOutlined, UserOutlined } from '@ant-design/icons'; import { LockOutlined, UserOutlined } from '@ant-design/icons';
import { LoginForm, ProFormCheckbox, ProFormText } from '@ant-design/pro-components'; import { LoginForm, ProFormCheckbox, ProFormText } from '@ant-design/pro-components';
import { FormattedMessage, Helmet, history, SelectLang, useIntl, useModel } from '@umijs/max'; import { FormattedMessage, Helmet, SelectLang, history, useIntl, useModel } from '@umijs/max';
import { message, Tabs } from 'antd'; import { Tabs, message } from 'antd';
import { createStyles } from 'antd-style'; import { createStyles } from 'antd-style';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { flushSync } from 'react-dom'; import { flushSync } from 'react-dom';
import loginBg from '@/assets/loginBg.jpg';
import Settings from '../../../../config/defaultSettings'; import Settings from '../../../../config/defaultSettings';
@ -86,8 +85,9 @@ const Login: React.FC = () => {
}); });
message.success(defaultLoginSuccessMessage); message.success(defaultLoginSuccessMessage);
await fetchUserInfo(); await fetchUserInfo();
const urlParams = new URL(window.location.href).searchParams; // const urlParams = new URL(window.location.href).searchParams;
history.push(urlParams.get('redirect') || '/'); // history.push(urlParams.get('redirect') || '/');
history.push('/');
// 如果失败去设置用户错误信息 // 如果失败去设置用户错误信息
// setUserLoginState(msg); // setUserLoginState(msg);
} catch (error) { } catch (error) {
@ -115,9 +115,9 @@ const Login: React.FC = () => {
style={{ style={{
flex: '1', flex: '1',
padding: '32px 0', padding: '32px 0',
position:'absolute', position: 'absolute',
left: '10vw', left: '10vw',
bottom: '10vh' bottom: '10vh',
}} }}
> >
<LoginForm <LoginForm
@ -155,7 +155,12 @@ const Login: React.FC = () => {
name="name" name="name"
fieldProps={{ fieldProps={{
size: 'large', size: 'large',
prefix: <UserOutlined />, prefix: (
<UserOutlined
onPointerEnterCapture={undefined}
onPointerLeaveCapture={undefined}
/>
),
}} }}
placeholder={intl.formatMessage({ placeholder={intl.formatMessage({
id: 'pages.login.username.placeholder', id: 'pages.login.username.placeholder',
@ -177,7 +182,12 @@ const Login: React.FC = () => {
name="pwd" name="pwd"
fieldProps={{ fieldProps={{
size: 'large', size: 'large',
prefix: <LockOutlined />, prefix: (
<LockOutlined
onPointerEnterCapture={undefined}
onPointerLeaveCapture={undefined}
/>
),
}} }}
placeholder={intl.formatMessage({ placeholder={intl.formatMessage({
id: 'pages.login.password.placeholder', id: 'pages.login.password.placeholder',

162
src/pages/Welcome.tsx

@ -1,163 +1,29 @@
import { PageContainer } from '@ant-design/pro-components'; import { Flex, Image, theme } from 'antd';
import { useModel } from '@umijs/max';
import { Card, theme } from 'antd';
import React from 'react'; import React from 'react';
import welcome from '../assets/welcome.jpeg';
/** /**
* *
* @param param0 * @param param0
* @returns * @returns
*/ */
const InfoCard: React.FC<{
title: string;
index: number;
desc: string;
href: string;
}> = ({ title, href, index, desc }) => {
const { useToken } = theme;
const { token } = useToken();
return (
<div
style={{
backgroundColor: token.colorBgContainer,
boxShadow: token.boxShadow,
borderRadius: '8px',
fontSize: '14px',
color: token.colorTextSecondary,
lineHeight: '22px',
padding: '16px 19px',
minWidth: '220px',
flex: 1,
}}
>
<div
style={{
display: 'flex',
gap: '4px',
alignItems: 'center',
}}
>
<div
style={{
width: 48,
height: 48,
lineHeight: '22px',
backgroundSize: '100%',
textAlign: 'center',
padding: '8px 16px 16px 12px',
color: '#FFF',
fontWeight: 'bold',
backgroundImage:
"url('https://gw.alipayobjects.com/zos/bmw-prod/daaf8d50-8e6d-4251-905d-676a24ddfa12.svg')",
}}
>
{index}
</div>
<div
style={{
fontSize: '16px',
color: token.colorText,
paddingBottom: 8,
}}
>
{title}
</div>
</div>
<div
style={{
fontSize: '14px',
color: token.colorTextSecondary,
textAlign: 'justify',
lineHeight: '22px',
marginBottom: 8,
}}
>
{desc}
</div>
<a href={href} target="_blank" rel="noreferrer">
{'>'}
</a>
</div>
);
};
const Welcome: React.FC = () => { const Welcome: React.FC = () => {
const { token } = theme.useToken(); const { token } = theme.useToken();
const { initialState } = useModel('@@initialState'); // const { initialState } = useModel('@@initialState');
return ( return (
<PageContainer> <Flex
<Card align="center"
style={{ justify="center"
borderRadius: 8, vertical
}} style={{ width: '100%', backgroundColor: 'white', padding: 20 }}
bodyStyle={{ >
backgroundImage: <Image preview={false} width={300} src={welcome} />
initialState?.settings?.navTheme === 'realDark' <p style={{ marginTop: 20, fontSize: 20, color: token.colorTextBase }}>
? 'background-image: linear-gradient(75deg, #1A1B1F 0%, #191C1F 100%)' 使
: 'background-image: linear-gradient(75deg, #FBFDFF 0%, #F5F7FF 100%)',
}}
>
<div
style={{
backgroundPosition: '100% -30%',
backgroundRepeat: 'no-repeat',
backgroundSize: '274px auto',
backgroundImage:
"url('https://gw.alipayobjects.com/mdn/rms_a9745b/afts/img/A*BuFmQqsB2iAAAAAAAAAAAAAAARQnAQ')",
}}
>
<div
style={{
fontSize: '20px',
color: token.colorTextHeading,
}}
>
使 Ant Design Pro
</div>
<p
style={{
fontSize: '14px',
color: token.colorTextSecondary,
lineHeight: '22px',
marginTop: 16,
marginBottom: 32,
width: '65%',
}}
>
Ant Design Pro umiAnt Design ProComponents
//
</p> </p>
<div </Flex>
style={{
display: 'flex',
flexWrap: 'wrap',
gap: 16,
}}
>
<InfoCard
index={1}
href="https://umijs.org/docs/introduce/introduce"
title="了解 umi"
desc="umi 是一个可扩展的企业级前端应用框架,umi 以路由为基础的,同时支持配置式路由和约定式路由,保证路由的功能完备,并以此进行功能扩展。"
/>
<InfoCard
index={2}
title="了解 ant design"
href="https://ant.design"
desc="antd 是基于 Ant Design 设计体系的 React UI 组件库,主要用于研发企业级中后台产品。"
/>
<InfoCard
index={3}
title="了解 Pro Components"
href="https://procomponents.ant.design"
desc="ProComponents 是一个基于 Ant Design 做了更高抽象的模板组件,以 一个组件就是一个页面为开发理念,为中后台开发带来更好的体验。"
/>
</div>
</div>
</Card>
</PageContainer>
); );
}; };

27
src/services/matrix/admin.ts

@ -95,6 +95,21 @@ export async function adminLogin(
}); });
} }
/** 此处后端没有提供注释 GET /api/admin/mockData */
export async function mockData(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.mockDataParams,
options?: { [key: string]: any },
) {
return request<API.RVoid>('/api/admin/mockData', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /api/admin/saveAdmin */ /** 此处后端没有提供注释 POST /api/admin/saveAdmin */
export async function saveAdmin(body: API.MatrixAdminBo, options?: { [key: string]: any }) { export async function saveAdmin(body: API.MatrixAdminBo, options?: { [key: string]: any }) {
return request<API.RVoid>('/api/admin/saveAdmin', { return request<API.RVoid>('/api/admin/saveAdmin', {
@ -106,3 +121,15 @@ export async function saveAdmin(body: API.MatrixAdminBo, options?: { [key: strin
...(options || {}), ...(options || {}),
}); });
} }
/** 此处后端没有提供注释 POST /api/admin/saveApp */
export async function saveApp(body: API.MatrixApp, options?: { [key: string]: any }) {
return request<API.RVoid>('/api/admin/saveApp', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}

2
src/services/matrix/index.ts

@ -4,11 +4,13 @@
// API 唯一标识: // API 唯一标识:
import * as admin from './admin'; import * as admin from './admin';
import * as appController from './appController'; import * as appController from './appController';
import * as device from './device';
import * as loginController from './loginController'; import * as loginController from './loginController';
import * as matrixController from './matrixController'; import * as matrixController from './matrixController';
export default { export default {
matrixController, matrixController,
loginController, loginController,
admin, admin,
device,
appController, appController,
}; };

30
src/services/matrix/matrixController.ts

@ -17,6 +17,21 @@ export async function addWhiteList(
}); });
} }
/** 此处后端没有提供注释 POST /api/game/matrix/bindDevice */
export async function bindDevice(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.bindDeviceParams,
options?: { [key: string]: any },
) {
return request<API.RString>('/api/game/matrix/bindDevice', {
method: 'POST',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /api/game/matrix/saveAdvRecord */ /** 此处后端没有提供注释 POST /api/game/matrix/saveAdvRecord */
export async function saveAdvRecord( export async function saveAdvRecord(
body: API.MatrixAdvRecordEditBo, body: API.MatrixAdvRecordEditBo,
@ -32,6 +47,21 @@ export async function saveAdvRecord(
}); });
} }
/** 此处后端没有提供注释 POST /api/game/matrix/saveAdvRecordV2 */
export async function saveAdvRecordV2(
body: API.MatrixAdvRecordEditBo,
options?: { [key: string]: any },
) {
return request<API.RVoid>('/api/game/matrix/saveAdvRecordV2', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /api/game/matrix/whiteList */ /** 此处后端没有提供注释 GET /api/game/matrix/whiteList */
export async function whiteList( export async function whiteList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象) // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)

47
src/services/matrix/typings.d.ts

@ -27,6 +27,12 @@ declare namespace API {
recommend?: AppInfo[]; recommend?: AppInfo[];
}; };
type bindDeviceParams = {
deviceId: string;
appCode: string;
adminName: string;
};
type CurrentUser = { type CurrentUser = {
avatarUrl?: string; avatarUrl?: string;
nickName?: string; nickName?: string;
@ -39,6 +45,10 @@ declare namespace API {
income?: number; income?: number;
}; };
type deviceListParams = {
appCode: string;
};
type getAppInfoParams = { type getAppInfoParams = {
appId?: string; appId?: string;
}; };
@ -91,6 +101,9 @@ declare namespace API {
appIds?: string; appIds?: string;
role?: number; role?: number;
channel?: string; channel?: string;
parentAdminId?: number;
deviceCnt?: number;
incomeRate?: number;
}; };
type MatrixAdminBo = { type MatrixAdminBo = {
@ -99,6 +112,18 @@ declare namespace API {
password?: string; password?: string;
appIds?: number[]; appIds?: number[];
role?: number; role?: number;
deviceCnt?: number;
incomeRate?: number;
};
type MatrixAdminDevice = {
id?: number;
deviceId?: string;
appId?: number;
adminId?: number;
status?: number;
createdAt?: string;
updatedAt?: string;
}; };
type MatrixAdvRecordBo = { type MatrixAdvRecordBo = {
@ -110,6 +135,8 @@ declare namespace API {
deviceBrand?: string; deviceBrand?: string;
deviceName?: string; deviceName?: string;
ip?: string; ip?: string;
advId?: number;
sign?: string;
appName?: string; appName?: string;
appId?: number; appId?: number;
createdAt?: number; createdAt?: number;
@ -125,6 +152,8 @@ declare namespace API {
deviceBrand?: string; deviceBrand?: string;
deviceName?: string; deviceName?: string;
ip?: string; ip?: string;
advId?: number;
sign?: string;
}; };
type MatrixApp = { type MatrixApp = {
@ -133,7 +162,17 @@ declare namespace API {
code?: string; code?: string;
url?: string; url?: string;
income?: number; income?: number;
channel?: string; secret?: string;
};
type mockDataParams = {
appCode: string;
incomeYuan: number;
channel: string;
};
type offlineParams = {
deviceId: string;
}; };
type OverviewBo = { type OverviewBo = {
@ -194,6 +233,12 @@ declare namespace API {
data?: MatrixAdminBo[]; data?: MatrixAdminBo[];
}; };
type RListMatrixAdminDevice = {
code?: number;
message?: string;
data?: MatrixAdminDevice[];
};
type RListMatrixApp = { type RListMatrixApp = {
code?: number; code?: number;
message?: string; message?: string;

Loading…
Cancel
Save