Browse Source

数据展示

fanmiyou
nili 8 months ago
parent
commit
346c62510c
  1. 9
      config/routes.ts
  2. 163
      dist/17.5b8b716b.async.js
  3. 58
      dist/245.2508f87f.async.js
  4. 286
      dist/418.2bc93afc.async.js
  5. 286
      dist/509.edc750af.async.js
  6. 96
      dist/624.7b73a47c.async.js
  7. 34
      dist/638.d29022f5.async.js
  8. 207
      dist/724.11269392.async.js
  9. 9
      dist/91.5ae90b01.async.js
  10. 26
      dist/970.3772d094.async.js
  11. 2
      dist/index.html
  12. 1
      dist/p__AdminManagement.c8a5c155.async.js
  13. 1
      dist/p__AdminManagement.ea5b8705.async.js
  14. 1
      dist/p__AdvRecordList.2ed1c75b.async.js
  15. 1
      dist/p__AdvRecordList.54974c8a.async.js
  16. 1
      dist/p__Overview.7bb5bb81.async.js
  17. 1
      dist/p__User__Login__index.88487dcd.async.js
  18. 1
      dist/p__User__Login__index.a2e43957.async.js
  19. 2
      dist/t__plugin-layout__Layout.2a198db8.async.js
  20. 252
      dist/umi.00fa7b67.js
  21. 18
      package.json
  22. 2
      src/pages/AdminManagement.tsx
  23. 81
      src/pages/AdvRecordList.tsx
  24. 16
      src/pages/Overview.tsx
  25. 27
      src/services/matrix/admin.ts
  26. 26
      src/services/matrix/matrixController.ts
  27. 56
      src/services/matrix/typings.d.ts

9
config/routes.ts

@ -22,12 +22,19 @@ export default [
}, },
], ],
}, },
{
path: '/overview',
name: '数据概览',
icon: 'dashboard',
component: './Overview',
},
{ {
path: '/advList', path: '/advList',
name: '广告列表', name: '广告列表',
icon: 'smile', icon: 'smile',
component: './AdvRecordList', component: './AdvRecordList',
}, },
{ {
path: '/adminList', path: '/adminList',
name: '人员管理', name: '人员管理',
@ -36,7 +43,7 @@ export default [
}, },
{ {
path: '/', path: '/',
redirect: '/advList', redirect: '/overview',
}, },
{ {
path: '*', path: '*',

163
dist/17.5b8b716b.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

286
dist/418.2bc93afc.async.js

File diff suppressed because one or more lines are too long

286
dist/509.edc750af.async.js

File diff suppressed because one or more lines are too long

96
dist/624.7b73a47c.async.js

File diff suppressed because one or more lines are too long

34
dist/638.d29022f5.async.js

File diff suppressed because one or more lines are too long

207
dist/724.11269392.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

26
dist/970.3772d094.async.js

File diff suppressed because one or more lines are too long

2
dist/index.html

@ -9,6 +9,6 @@
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script src="/umi.48417f56.js"></script> <script src="/umi.00fa7b67.js"></script>
</body></html> </body></html>

1
dist/p__AdminManagement.c8a5c155.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

1
dist/p__AdvRecordList.2ed1c75b.async.js

@ -1 +0,0 @@
"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),m=e(48357),h=e(90930),E=e(1507),f=e(35312),I=e(67294),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__AdvRecordList.54974c8a.async.js

@ -0,0 +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}}]);

1
dist/p__Overview.7bb5bb81.async.js

@ -0,0 +1 @@
"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),h=m()(V,2),j=h[0],X=h[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",theme:"classicDark",tooltip:{name:"\u6536\u5165",field:"income"},axis:{date:{title:"\u65E5\u671F"},income:{title:"\u6536\u5165\uFF08\u5143\uFF09"}},title:"\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:j?"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:j?"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.88487dcd.async.js

File diff suppressed because one or more lines are too long

1
dist/p__User__Login__index.a2e43957.async.js

File diff suppressed because one or more lines are too long

2
dist/t__plugin-layout__Layout.abca0916.async.js → dist/t__plugin-layout__Layout.2a198db8.async.js

File diff suppressed because one or more lines are too long

252
dist/umi.48417f56.js → dist/umi.00fa7b67.js

File diff suppressed because one or more lines are too long

18
package.json

@ -4,7 +4,7 @@
"private": true, "private": true,
"description": "An out-of-box UI solution for enterprise applications", "description": "An out-of-box UI solution for enterprise applications",
"scripts": { "scripts": {
"openapi": "umi openapi", "openapi": "max openapi",
"analyze": "cross-env ANALYZE=1 max build", "analyze": "cross-env ANALYZE=1 max build",
"build": "max build", "build": "max build",
"deploy": "npm run build && npm run gh-pages", "deploy": "npm run build && npm run gh-pages",
@ -19,7 +19,6 @@
"lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src ", "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src ",
"lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src", "lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
"lint:prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\" --end-of-line auto", "lint:prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\" --end-of-line auto",
"openapi": "max openapi",
"prepare": "husky install", "prepare": "husky install",
"prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\"", "prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\"",
"preview": "npm run build && max preview --port 8000", "preview": "npm run build && max preview --port 8000",
@ -37,10 +36,17 @@
}, },
"lint-staged": { "lint-staged": {
"**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js", "**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
"**/*.{js,jsx,tsx,ts,less,md,json}": ["prettier --write"] "**/*.{js,jsx,tsx,ts,less,md,json}": [
"prettier --write"
]
}, },
"browserslist": ["> 1%", "last 2 versions", "not ie <= 10"], "browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 10"
],
"dependencies": { "dependencies": {
"@ant-design/charts": "^2.0.3",
"@ant-design/icons": "^4.8.1", "@ant-design/icons": "^4.8.1",
"@ant-design/pro-components": "^2.6.48", "@ant-design/pro-components": "^2.6.48",
"@umijs/route-utils": "^2.2.2", "@umijs/route-utils": "^2.2.2",
@ -88,5 +94,7 @@
"umi-presets-pro": "^2.0.3", "umi-presets-pro": "^2.0.3",
"umi-serve": "^1.9.11" "umi-serve": "^1.9.11"
}, },
"engines": { "node": ">=12.0.0" } "engines": {
"node": ">=12.0.0"
}
} }

2
src/pages/AdminManagement.tsx

@ -1,9 +1,9 @@
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, Form, Input, Modal, Select, Table, Tag } from 'antd';
import { ColumnsType } from 'antd/es/table'; import { ColumnsType } from 'antd/es/table';
import React, { useEffect, useState } from 'react'; import React, { 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[]>([]);

81
src/pages/AdvRecordList.tsx

@ -1,12 +1,11 @@
import { advList, appList } from '@/services/matrix/admin';
import { PageContainer, ProColumns, ProTable } from '@ant-design/pro-components'; import { PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
import { ProFieldRequestData, RequestOptionsType } from '@ant-design/pro-utils';
import { useIntl } from '@umijs/max'; import { useIntl } from '@umijs/max';
import React, { useRef } from 'react'; import React, { useRef } from 'react';
import { RequestOptionsType, ProFieldRequestData } from "@ant-design/pro-utils";
import type { ActionType } from '@ant-design/pro-components'; import type { ActionType } from '@ant-design/pro-components';
import { advList, appList } from '@/services/matrix/admin';
const AdvRecordList: React.FC = () => { const AdvRecordList: React.FC = () => {
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
/** /**
@ -19,122 +18,121 @@ const AdvRecordList: React.FC = () => {
let res = await appList(); let res = await appList();
let data: RequestOptionsType[] = []; let data: RequestOptionsType[] = [];
res.data?.forEach(x=>{ res.data?.forEach((x) => {
data.push({label: x.name, value: x.code}) data.push({ label: x.name, value: x.code });
}) });
return data; return data;
} };
const columns: ProColumns<API.MatrixAdvRecordBo>[] = [ const columns: ProColumns<API.MatrixAdvRecordBo>[] = [
{ {
title: "应用名称", title: '应用名称',
hideInTable: true, hideInTable: true,
dataIndex: 'code', dataIndex: 'code',
valueType: "select", valueType: 'select',
request: appNameMap request: appNameMap,
}, },
{ {
title: "设备Id", title: '设备Id',
dataIndex: 'deviceId', dataIndex: 'deviceId',
valueType: 'textarea', valueType: 'textarea',
ellipsis: true, ellipsis: true,
copyable: true copyable: true,
}, },
{ {
title: "应用名称", title: '应用名称',
hideInSearch: true, hideInSearch: true,
dataIndex: 'appName', dataIndex: 'appName',
valueType: 'textarea', valueType: 'textarea',
}, },
{ {
title: "平台", title: '平台',
dataIndex: 'platform', dataIndex: 'platform',
valueEnum: { valueEnum: {
1: { 1: {
text:"穿山甲" , text: '穿山甲',
}, },
2: { 2: {
text: "腾讯", text: '腾讯',
}, },
3: { 3: {
text: "百度联盟", text: '百度联盟',
}, },
4: { 4: {
text:"Mintegral", text: 'Mintegral',
}, },
5: { 5: {
text:"快手", text: '快手',
}, },
6: { 6: {
text:"游可赢", text: '游可赢',
}, },
7: { 7: {
text:"Sigmob", text: 'Sigmob',
}, },
8: { 8: {
text:"Admob", text: 'Admob',
}, },
}, },
}, },
{ {
title: "广告类型", title: '广告类型',
dataIndex: 'advType', dataIndex: 'advType',
valueEnum: { valueEnum: {
1: { 1: {
text:"横幅" , text: '横幅',
status: 'Default', status: 'Default',
}, },
2: { 2: {
text: "插页", text: '插页',
status: 'Processing', status: 'Processing',
}, },
3: { 3: {
text: "激励视频", text: '激励视频',
status: 'Success', status: 'Success',
}, },
}, },
}, },
{ {
title: "ecpm(元)", title: 'ecpm(元)',
dataIndex: 'ecpm', dataIndex: 'ecpm',
hideInSearch: true, hideInSearch: true,
renderText: (x) => { renderText: (x) => {
return x / 100; return x / 100;
} },
}, },
{ {
title: "设备品牌", title: '设备品牌',
dataIndex: 'deviceBrand', dataIndex: 'deviceBrand',
hideInSearch: true, hideInSearch: true,
valueType: 'textarea', valueType: 'textarea',
}, },
{ {
title: "设备名", title: '设备名',
dataIndex: 'deviceName', dataIndex: 'deviceName',
hideInSearch: true, hideInSearch: true,
valueType: 'textarea', valueType: 'textarea',
}, },
{ {
title: "ip", title: 'ip',
dataIndex: 'ip', dataIndex: 'ip',
hideInSearch: true, hideInSearch: true,
valueType: 'textarea', valueType: 'textarea',
}, },
{ {
title: "时间", title: '时间',
hideInSearch: true, hideInSearch: true,
dataIndex: 'createdAt', dataIndex: 'createdAt',
valueType: 'dateTime' valueType: 'dateTime',
}, },
{ {
title: "时间", title: '时间',
hideInTable: true, hideInTable: true,
dataIndex: 'createdAt', dataIndex: 'createdAt',
valueType: 'dateRange' valueType: 'dateRange',
} },
]; ];
return ( return (
<PageContainer> <PageContainer>
<ProTable<API.MatrixAdvRecordBo, API.AdvRecordQuery> <ProTable<API.MatrixAdvRecordBo, API.AdvRecordQuery>
@ -152,14 +150,13 @@ const AdvRecordList: React.FC = () => {
return { return {
data: res.data?.data, data: res.data?.data,
total: res.data?.total, total: res.data?.total,
success: true success: true,
} };
}} }}
columns={columns} columns={columns}
/> />
</PageContainer> </PageContainer>
); );
}; };
export default AdvRecordList;
export default AdvRecordList;

16
src/pages/Overview.tsx

@ -1,5 +1,5 @@
import { appList, incomeOverview } from '@/services/matrix/admin'; import { appList, incomeDaily, incomeOverview } from '@/services/matrix/admin';
import { Column } from '@ant-design/charts'; import { Line } from '@ant-design/charts';
import { import {
PageContainer, PageContainer,
ProFormDateRangePicker, ProFormDateRangePicker,
@ -11,7 +11,6 @@ import moment from 'moment';
import RcResizeObserver from 'rc-resize-observer'; import RcResizeObserver from 'rc-resize-observer';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useParams } from 'react-router-dom'; import { useParams } from 'react-router-dom';
import { incomeDaily } from '../services/matrix/admin';
const Overview: React.FC = () => { const Overview: React.FC = () => {
const [overview, setOverview] = useState<API.OverviewBo>(); const [overview, setOverview] = useState<API.OverviewBo>();
@ -66,8 +65,14 @@ const Overview: React.FC = () => {
const config = { const config = {
data: processedChartData, data: processedChartData,
// theme: 'Light',
xField: 'date', xField: 'date',
yField: 'income', yField: 'income',
theme: 'classicDark',
tooltip: {
name: '收入',
field: 'income',
},
axis: { axis: {
date: { date: {
title: '日期', title: '日期',
@ -114,7 +119,7 @@ const Overview: React.FC = () => {
</StatisticCard> </StatisticCard>
</RcResizeObserver> </RcResizeObserver>
<div style={{ backgroundColor: 'white', marginTop: '20px', padding: '40px' }}> <div style={{ marginTop: '20px', padding: '40px' }}>
<QueryFilter defaultCollapsed split onFinish={fetchDaily}> <QueryFilter defaultCollapsed split onFinish={fetchDaily}>
<ProFormSelect <ProFormSelect
name="code" name="code"
@ -155,8 +160,7 @@ const Overview: React.FC = () => {
label="时间" label="时间"
/> />
</QueryFilter> </QueryFilter>
{/* <Line {...config} /> */} <Line {...config} />
<Column {...config} />
</div> </div>
</PageContainer> </PageContainer>
); );

27
src/services/matrix/admin.ts

@ -53,6 +53,33 @@ export async function grantApp(
}); });
} }
/** 此处后端没有提供注释 POST /api/admin/incomeDaily */
export async function incomeDaily(body: API.IncomeQuery, options?: { [key: string]: any }) {
return request<API.RListDateIncome>('/api/admin/incomeDaily', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /api/admin/incomeOverview */
export async function incomeOverview(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.incomeOverviewParams,
options?: { [key: string]: any },
) {
return request<API.ROverviewBo>('/api/admin/incomeOverview', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /api/admin/login */ /** 此处后端没有提供注释 POST /api/admin/login */
export async function adminLogin( export async function adminLogin(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象) // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)

26
src/services/matrix/matrixController.ts

@ -2,6 +2,21 @@
/* eslint-disable */ /* eslint-disable */
import { request } from '@umijs/max'; import { request } from '@umijs/max';
/** 此处后端没有提供注释 POST /api/game/matrix/addWhiteList */
export async function addWhiteList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.addWhiteListParams,
options?: { [key: string]: any },
) {
return request<API.RVoid>('/api/game/matrix/addWhiteList', {
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,
@ -18,9 +33,16 @@ export async function saveAdvRecord(
} }
/** 此处后端没有提供注释 GET /api/game/matrix/whiteList */ /** 此处后端没有提供注释 GET /api/game/matrix/whiteList */
export async function whiteList(options?: { [key: string]: any }) { export async function whiteList(
return request<API.RListString>('/api/game/matrix/whiteList', { // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.whiteListParams,
options?: { [key: string]: any },
) {
return request<API.RBoolean>('/api/game/matrix/whiteList', {
method: 'GET', method: 'GET',
params: {
...params,
},
...(options || {}), ...(options || {}),
}); });
} }

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

@ -1,4 +1,9 @@
declare namespace API { declare namespace API {
type addWhiteListParams = {
deviceId: string;
appCode: string;
};
type adminLoginParams = { type adminLoginParams = {
name: string; name: string;
pwd: string; pwd: string;
@ -29,6 +34,11 @@ declare namespace API {
openId?: string; openId?: string;
}; };
type DateIncome = {
date?: number;
income?: number;
};
type getAppInfoParams = { type getAppInfoParams = {
appId?: string; appId?: string;
}; };
@ -38,6 +48,17 @@ declare namespace API {
adminId: number; adminId: number;
}; };
type incomeOverviewParams = {
appCode?: string;
};
type IncomeQuery = {
code?: string;
platform?: number;
advType?: number;
date?: string[];
};
type InviteInfo = { type InviteInfo = {
inviteCnt?: number; inviteCnt?: number;
list?: InviteUserInfo[]; list?: InviteUserInfo[];
@ -112,6 +133,12 @@ declare namespace API {
code?: string; code?: string;
url?: string; url?: string;
income?: number; income?: number;
channel?: string;
};
type OverviewBo = {
todayIncome?: number;
totalIncome?: number;
}; };
type PageResultMatrixAdvRecordBo = { type PageResultMatrixAdvRecordBo = {
@ -137,6 +164,12 @@ declare namespace API {
data?: AppInfo; data?: AppInfo;
}; };
type RBoolean = {
code?: number;
message?: string;
data?: boolean;
};
type RCurrentUser = { type RCurrentUser = {
code?: number; code?: number;
message?: string; message?: string;
@ -149,22 +182,22 @@ declare namespace API {
data?: InviteInfo; data?: InviteInfo;
}; };
type RListMatrixAdminBo = { type RListDateIncome = {
code?: number; code?: number;
message?: string; message?: string;
data?: MatrixAdminBo[]; data?: DateIncome[];
}; };
type RListMatrixApp = { type RListMatrixAdminBo = {
code?: number; code?: number;
message?: string; message?: string;
data?: MatrixApp[]; data?: MatrixAdminBo[];
}; };
type RListString = { type RListMatrixApp = {
code?: number; code?: number;
message?: string; message?: string;
data?: string[]; data?: MatrixApp[];
}; };
type RLoginBo = { type RLoginBo = {
@ -179,6 +212,12 @@ declare namespace API {
data?: MatrixAdmin; data?: MatrixAdmin;
}; };
type ROverviewBo = {
code?: number;
message?: string;
data?: OverviewBo;
};
type RPageResultMatrixAdvRecordBo = { type RPageResultMatrixAdvRecordBo = {
code?: number; code?: number;
message?: string; message?: string;
@ -218,6 +257,11 @@ declare namespace API {
score?: number; score?: number;
}; };
type whiteListParams = {
deviceId: string;
appCode: string;
};
type wxLoginParams = { type wxLoginParams = {
code: string; code: string;
appId: string; appId: string;

Loading…
Cancel
Save