Browse Source

数据概览加昨日

master
nili 9 months ago
parent
commit
4e44abf787
  1. 2
      dist/index.html
  2. 1
      dist/p__AdvRecordList.928a9ef2.async.js
  3. 1
      dist/p__AdvRecordList.ae9d0fb3.async.js
  4. 2
      dist/p__User__Login__index.a9369d80.async.js
  5. 200
      dist/umi.33085593.js
  6. 2
      src/app.tsx
  7. 2
      src/pages/AdminManagement.tsx
  8. 14
      src/pages/AdvRecordList.tsx
  9. 2
      src/pages/AppManagement.tsx
  10. 3
      src/pages/Overview.tsx
  11. 14
      src/pages/User/Login/index.tsx
  12. 15
      src/services/matrix/admin.ts
  13. 7
      src/services/matrix/typings.d.ts

2
dist/index.html

@ -8,6 +8,6 @@
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script src="/umi.8fc52f76.js"></script> <script src="/umi.33085593.js"></script>
</body></html> </body></html>

1
dist/p__AdvRecordList.928a9ef2.async.js

@ -1 +0,0 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[857],{46701:function(ne,h,t){t.r(h);var b=t(5574),f=t.n(b),C=t(15009),d=t.n(C),U=t(97857),u=t.n(U),y=t(99289),p=t.n(y),D=t(48357),B=t(92296),c=t(31847),g=t(90930),K=t(85601),L=t(57470),x=t(64317),W=t(34540),S=t(35312),Z=t(13169),O=t(16250),F=t(27484),z=t.n(F),$=t(9220),m=t(67294),G=t(96974),r=t(85893),N=function(){var M=(0,m.useRef)(),H=(0,S.useIntl)(),J=[{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(e){return e/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"}],Q=(0,G.UO)(),v=Q.code,V=function(){var a=p()(d()().mark(function e(s){var n,i,_;return d()().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,D._5)(u()(u()({},s),{},{code:v}));case 2:return _=o.sent,o.abrupt("return",{data:(n=_.data)===null||n===void 0?void 0:n.data,total:(i=_.data)===null||i===void 0?void 0:i.total,success:!0});case 4:case"end":return o.stop()}},e)}));return function(s){return a.apply(this,arguments)}}(),X=(0,m.useState)(),P=f()(X,2),l=P[0],Y=P[1],w=(0,m.useState)([]),I=f()(w,2),T=I[0],k=I[1],q=c.Z.Divider,ee=(0,m.useState)(!1),j=f()(ee,2),R=j[0],te=j[1],ae=function(){var a=p()(d()().mark(function e(s){var n;return d()().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,(0,D.d1)({appCode:s});case 2:n=_.sent,n.data&&Y(n.data);case 4:case"end":return _.stop()}},e)}));return function(s){return a.apply(this,arguments)}}(),A=function(){var a=p()(d()().mark(function e(s){var n;return d()().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,(0,D.Zb)(u()(u()({},s),{},{code:v}));case 2:n=_.sent,n.data&&k(n.data);case 4:case"end":return _.stop()}},e)}));return function(s){return a.apply(this,arguments)}}();(0,m.useEffect)(function(){var a;(a=M.current)===null||a===void 0||a.reload(),ae(v),A({code:v})},[v]);var E=function(e){return e?parseFloat((e/1e5).toFixed(2)):0},re=T.map(function(a){return{date:function(){var e=a.date+"",s=e.slice(0,4),n=e.slice(4,6),i=e.slice(6,8);return"".concat(s,"-").concat(n,"-").concat(i)}(),income:E(a.income)}}),_e={data:re,xField:"date",yField:"income",tooltip:{name:"\u6536\u5165",field:"income"},axis:{date:{title:"\u65E5\u671F"}},title:"\u7D2F\u8BA1"+E(T.reduce(function(a,e){return a+(e.income?e.income:0)},0))+"\u5143",height:400,label:{text:function(e){return e.income>0?e.income:""},textBaseline:"bottom"}};return(0,r.jsx)(g._z,{children:(0,r.jsxs)(Z.Z,{defaultActiveKey:"1",centered:!0,style:{backgroundColor:"white",padding:"20px"},children:[(0,r.jsx)(O.Z,{tab:"\u5E7F\u544A\u8BE6\u60C5",children:(0,r.jsx)(K.Z,{headerTitle:H.formatMessage({id:"pages.searchTable.title",defaultMessage:"Enquiry form"}),actionRef:M,rowKey:"key",search:{labelWidth:120},request:V,columns:J})},"1"),(0,r.jsxs)(O.Z,{tab:"\u6570\u636E\u603B\u89C8",children:[(0,r.jsx)($.Z,{onResize:function(e){te(e.width<596)},children:(0,r.jsx)(c.Z,{children:(0,r.jsxs)(c.Z.Group,{direction:R?"column":"row",children:[(0,r.jsx)(c.Z,{statistic:{title:"\u7D2F\u8BA1\u6536\u5165\uFF08\u5143\uFF09",value:E(l==null?void 0:l.totalIncome)}}),(0,r.jsx)(q,{type:R?"horizontal":"vertical"}),(0,r.jsx)(c.Z,{statistic:{title:"\u4ECA\u65E5\u6536\u5165\uFF08\u5143\uFF09",value:E(l==null?void 0:l.todayIncome)}})]})})},"resize-observer"),(0,r.jsxs)(L.t,{defaultCollapsed:!0,split:!0,onFinish:A,children:[(0,r.jsx)(x.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,r.jsx)(x.Z,{name:"advType",label:"\u5E7F\u544A\u7C7B\u578B",valueEnum:{1:"\u6A2A\u5E45",2:"\u63D2\u9875",3:"\u6FC0\u52B1\u89C6\u9891"}}),(0,r.jsx)(W.Z,{fieldProps:{disabledDate:function(e){return e&&e>=z()().startOf("day")}},name:"date",label:"\u65F6\u95F4"})]}),(0,r.jsx)(B.Z,u()({},_e))]},"2")]})})};h.default=N}}]);

1
dist/p__AdvRecordList.ae9d0fb3.async.js

File diff suppressed because one or more lines are too long

2
dist/p__User__Login__index.039826c8.async.js → dist/p__User__Login__index.a9369d80.async.js

File diff suppressed because one or more lines are too long

200
dist/umi.8fc52f76.js → dist/umi.33085593.js

File diff suppressed because one or more lines are too long

2
src/app.tsx

@ -4,12 +4,12 @@ import { LinkOutlined } from '@ant-design/icons';
import { MenuDataItem, SettingDrawer } from '@ant-design/pro-components'; import { MenuDataItem, SettingDrawer } from '@ant-design/pro-components';
import { Link, history } from '@umijs/max'; import { Link, history } from '@umijs/max';
import { appList } from '@/services/matrix/admin';
import type { Settings as LayoutSettings } from '@ant-design/pro-components'; import type { Settings as LayoutSettings } from '@ant-design/pro-components';
import type { RunTimeLayoutConfig } from '@umijs/max'; import type { RunTimeLayoutConfig } from '@umijs/max';
import defaultSettings from '../config/defaultSettings'; import defaultSettings from '../config/defaultSettings';
import access from './access'; import access from './access';
import { errorConfig } from './requestErrorConfig'; import { errorConfig } from './requestErrorConfig';
import { appList } from './services/matrix/admin';
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const loginPath = '/user/login'; const loginPath = '/user/login';

2
src/pages/AdminManagement.tsx

@ -3,7 +3,7 @@ import { Button, Col, Form, Input, InputNumber, Modal, Row, Select, Table, Tag }
import { ColumnsType } from 'antd/es/table'; import { ColumnsType } from 'antd/es/table';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { adminList, appList, saveAdmin } from '../services/matrix/admin'; import { adminList, appList, saveAdmin } from '@/services/matrix/admin';
const AdminManagement = () => { const AdminManagement = () => {
const [data, setData] = useState<API.MatrixAdminBo[]>([]); const [data, setData] = useState<API.MatrixAdminBo[]>([]);

14
src/pages/AdvRecordList.tsx

@ -1,4 +1,3 @@
import { advList, incomeOverview } from '@/services/matrix/admin';
import { Column } from '@ant-design/charts'; import { Column } from '@ant-design/charts';
import { import {
PageContainer, PageContainer,
@ -17,10 +16,10 @@ import RcResizeObserver from 'rc-resize-observer';
import React, { useEffect, useRef, useState } from 'react'; import React, { useEffect, useRef, useState } from 'react';
import { useParams } from 'react-router-dom'; import { useParams } from 'react-router-dom';
import { incomeDaily } from '../services/matrix/admin';
// import { RequestOptionsType, ProFieldRequestData } from "@ant-design/pro-utils"; // import { RequestOptionsType, ProFieldRequestData } from "@ant-design/pro-utils";
import { advList, incomeDaily, incomeOverview } from '@/services/matrix/admin';
import type { ActionType } from '@ant-design/pro-components'; import type { ActionType } from '@ant-design/pro-components';
const AdvRecordList: React.FC = () => { const AdvRecordList: React.FC = () => {
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
@ -247,7 +246,7 @@ const AdvRecordList: React.FC = () => {
<StatisticCard.Group direction={responsive ? 'column' : 'row'}> <StatisticCard.Group direction={responsive ? 'column' : 'row'}>
<StatisticCard <StatisticCard
statistic={{ statistic={{
title: '累计收入(元)', title: '上月收入(元)',
value: formatIncome(overview?.totalIncome), value: formatIncome(overview?.totalIncome),
}} }}
/> />
@ -258,6 +257,13 @@ const AdvRecordList: React.FC = () => {
value: formatIncome(overview?.todayIncome), value: formatIncome(overview?.todayIncome),
}} }}
/> />
<Divider type={responsive ? 'horizontal' : 'vertical'} />
<StatisticCard
statistic={{
title: '昨日收入(元)',
value: formatIncome(overview?.yesterdayIncome),
}}
/>
</StatisticCard.Group> </StatisticCard.Group>
</StatisticCard> </StatisticCard>
</RcResizeObserver> </RcResizeObserver>

2
src/pages/AppManagement.tsx

@ -3,7 +3,7 @@ import { useModel } from '@umijs/max';
import { Button, Form, Input, Modal, Popover, QRCode } from 'antd'; import { Button, Form, Input, Modal, Popover, QRCode } from 'antd';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { appList, saveApp } from '../services/matrix/admin'; import { appList, saveApp } from '@/services/matrix/admin';
const AppManagement = () => { const AppManagement = () => {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);

3
src/pages/Overview.tsx

@ -1,4 +1,4 @@
import { appList, incomeOverview } from '@/services/matrix/admin'; import { appList, incomeDaily, incomeOverview } from '@/services/matrix/admin';
import { Column } from '@ant-design/charts'; import { Column } from '@ant-design/charts';
import { import {
PageContainer, PageContainer,
@ -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>();

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

@ -153,7 +153,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',
@ -175,7 +180,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',

15
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', {

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

@ -165,6 +165,12 @@ declare namespace API {
secret?: string; secret?: string;
}; };
type mockDataParams = {
appCode: string;
incomeYuan: number;
channel: string;
};
type offlineParams = { type offlineParams = {
deviceId: string; deviceId: string;
}; };
@ -172,6 +178,7 @@ declare namespace API {
type OverviewBo = { type OverviewBo = {
todayIncome?: number; todayIncome?: number;
totalIncome?: number; totalIncome?: number;
yesterdayIncome?: number;
}; };
type PageResultMatrixAdvRecordBo = { type PageResultMatrixAdvRecordBo = {

Loading…
Cancel
Save