Browse Source

按设备查,展示表格累计收入

fanmiyou
nili 8 months ago
parent
commit
323a4a432e
  1. 2
      dist/index.html
  2. 1
      dist/p__AdvRecordList.5b127676.async.js
  3. 1
      dist/p__AdvRecordList.ec333a28.async.js
  4. 433
      dist/umi.51acf382.js
  5. 433
      dist/umi.ac3e0c0e.js
  6. 29
      src/pages/AdvRecordList.tsx
  7. 58
      src/services/matrix/admin.ts
  8. 15
      src/services/matrix/matrixController.ts
  9. 70
      src/services/matrix/typings.d.ts

2
dist/index.html

@ -9,6 +9,6 @@
</head>
<body>
<div id="root"></div>
<script src="/umi.ac3e0c0e.js"></script>
<script src="/umi.51acf382.js"></script>
</body></html>

1
dist/p__AdvRecordList.5b127676.async.js

@ -1 +0,0 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[857],{46701:function(P,o,e){e.r(o);var p=e(15009),u=e.n(p),v=e(99289),m=e.n(v),E=e(90930),h=e(85601),f=e(35312),x=e(67294),c=e(48357),l=e(85893),I=function(){var T=(0,x.useRef)(),M=(0,f.useIntl)(),D=function(){var d=m()(u()().mark(function t(){var r,s,n;return u()().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,(0,c.ln)();case 2:return s=_.sent,n=[],(r=s.data)===null||r===void 0||r.forEach(function(a){n.push({label:a.name,value:a.code})}),_.abrupt("return",n);case 6:case"end":return _.stop()}},t)}));return function(){return d.apply(this,arguments)}}(),O=[{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"},5:{text:"\u5FEB\u624B"},7:{text:"Sigmob"}}},{title:"\u5E7F\u544A\u7C7B\u578B",dataIndex:"advType",valueEnum:{1:{text:"\u6A2A\u5E45"},2:{text:"\u63D2\u9875"},3:{text:"\u6FC0\u52B1\u89C6\u9891"}}},{title:"ecpm(\u5143)",dataIndex:"ecpm",hideInSearch:!0,renderText:function(t){return t/100}},{title:"\u8BBE\u5907",dataIndex:"device",hideInSearch:!0,valueType:"textarea",renderText:function(t,r){return(0,l.jsxs)("p",{children:[r.deviceBrand," ",(0,l.jsx)("br",{})," ",r.deviceName]})}},{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,l.jsx)(E._z,{children:(0,l.jsx)(h.Z,{headerTitle:M.formatMessage({id:"pages.searchTable.title",defaultMessage:"Enquiry form"}),actionRef:T,rowKey:"key",search:{labelWidth:120},request:function(){var d=m()(u()().mark(function t(r){var s,n,i;return u()().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,(0,c._5)(r);case 2:return i=a.sent,a.abrupt("return",{data:(s=i.data)===null||s===void 0?void 0:s.data,total:(n=i.data)===null||n===void 0?void 0:n.total,success:!0});case 4:case"end":return a.stop()}},t)}));return function(t){return d.apply(this,arguments)}}(),columns:O})})};o.default=I}}]);

1
dist/p__AdvRecordList.ec333a28.async.js

@ -0,0 +1 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[857],{46701:function(U,m,e){e.r(m);var h=e(15009),i=e.n(h),I=e(99289),c=e.n(I),x=e(5574),T=e.n(x),b=e(90930),M=e(85601),p=e(67294),v=e(48357),l=e(85893),j=function(){var D=(0,p.useRef)(),O=(0,p.useState)(void 0),f=T()(O,2),E=f[0],P=f[1],R=function(){var n=c()(i()().mark(function t(){var r,s,_;return i()().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,(0,v.ln)();case 2:return s=a.sent,_=[],(r=s.data)===null||r===void 0||r.forEach(function(o){_.push({label:o.name,value:o.code})}),a.abrupt("return",_);case 6:case"end":return a.stop()}},t)}));return function(){return n.apply(this,arguments)}}(),y=[{title:"\u5E94\u7528\u540D\u79F0",hideInTable:!0,dataIndex:"code",valueType:"select",request:R},{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"},5:{text:"\u5FEB\u624B"},7:{text:"Sigmob"}}},{title:"\u5E7F\u544A\u7C7B\u578B",dataIndex:"advType",valueEnum:{1:{text:"\u6A2A\u5E45"},2:{text:"\u63D2\u9875"},3:{text:"\u6FC0\u52B1\u89C6\u9891"}}},{title:"ecpm(\u5143)",dataIndex:"ecpm",hideInSearch:!0,renderText:function(t){return t/100}},{title:"\u8BBE\u5907",dataIndex:"device",hideInSearch:!0,valueType:"textarea",renderText:function(t,r){return(0,l.jsxs)("p",{children:[r.deviceBrand," ",(0,l.jsx)("br",{})," ",r.deviceName]})}},{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"}],A=function(t){return t?parseFloat((t/1e5).toFixed(2)):0};return(0,l.jsx)(b._z,{children:(0,l.jsx)(M.Z,{headerTitle:E?"\u8868\u683C\u7D2F\u8BA1\uFF1A"+A(E)+"\u5143":"",actionRef:D,rowKey:"key",search:{labelWidth:120},request:function(){var n=c()(i()().mark(function t(r){var s,_,u,a;return i()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,(0,v._5)(r);case 2:return u=d.sent,r.current===1&&P((a=u.data)===null||a===void 0?void 0:a.sum),d.abrupt("return",{data:(s=u.data)===null||s===void 0?void 0:s.data,total:(_=u.data)===null||_===void 0?void 0:_.total,success:!0});case 5:case"end":return d.stop()}},t)}));return function(t){return n.apply(this,arguments)}}(),columns:y})})};m.default=j}}]);

433
dist/umi.51acf382.js

File diff suppressed because one or more lines are too long

433
dist/umi.ac3e0c0e.js

File diff suppressed because one or more lines are too long

29
src/pages/AdvRecordList.tsx

@ -1,24 +1,18 @@
import { PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
import { ProFieldRequestData, RequestOptionsType } from '@ant-design/pro-utils';
import { useIntl } from '@umijs/max';
import React, { useRef } from 'react';
import React, { useRef, useState } from 'react';
import { advList, appList } from '@/services/matrix/admin';
import type { ActionType } from '@ant-design/pro-components';
const AdvRecordList: React.FC = () => {
const actionRef = useRef<ActionType>();
/**
* @en-US International configuration
* @zh-CN
* */
const intl = useIntl();
const [income, setIncome] = useState<number | undefined>(undefined);
const appNameMap: ProFieldRequestData = async () => {
let res = await appList();
let data: RequestOptionsType[] = [];
res.data?.forEach((x) => {
res.data?.forEach((x: API.MatrixApp) => {
data.push({ label: x.name, value: x.code });
});
return data;
@ -122,20 +116,27 @@ const AdvRecordList: React.FC = () => {
},
];
const formatIncome = (v: number | undefined) => {
if (!v) {
return 0;
}
return parseFloat((v / 1000_00).toFixed(2));
};
return (
<PageContainer>
<ProTable<API.MatrixAdvRecordBo, API.AdvRecordQuery>
headerTitle={intl.formatMessage({
id: 'pages.searchTable.title',
defaultMessage: 'Enquiry form',
})}
headerTitle={income ? '表格累计:' + formatIncome(income) + '元' : ''}
actionRef={actionRef}
rowKey="key"
search={{
labelWidth: 120,
}}
request={async (params: any) => {
request={async (params: API.AdvRecordQuery) => {
const res = await advList(params);
if (params.current === 1) {
setIncome(res.data?.sum);
}
return {
data: res.data?.data,
total: res.data?.total,

58
src/services/matrix/admin.ts

@ -2,6 +2,33 @@
/* eslint-disable */
import { request } from '@umijs/max';
/** 此处后端没有提供注释 POST /api/admin/addSchedule */
export async function addSchedule(body: API.AddMockScheduleReq, options?: { [key: string]: any }) {
return request<API.RVoid>('/api/admin/addSchedule', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /api/admin/addWhiteList */
export async function addWhiteList1(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.addWhiteList1Params,
options?: { [key: string]: any },
) {
return request<API.RVoid>('/api/admin/addWhiteList', {
method: 'POST',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /api/admin/adminList */
export async function adminList(options?: { [key: string]: any }) {
return request<API.RListMatrixAdminBo>('/api/admin/adminList', {
@ -38,6 +65,21 @@ export async function current(options?: { [key: string]: any }) {
});
}
/** 此处后端没有提供注释 POST /api/admin/deleteWhiteList */
export async function deleteWhiteList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.deleteWhiteListParams,
options?: { [key: string]: any },
) {
return request<API.RVoid>('/api/admin/deleteWhiteList', {
method: 'POST',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /api/admin/grantApp */
export async function grantApp(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
@ -133,3 +175,19 @@ export async function saveApp(body: API.MatrixApp, options?: { [key: string]: an
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /api/admin/scheduleList */
export async function scheduleList(options?: { [key: string]: any }) {
return request<API.RListMatrixMockSchedule>('/api/admin/scheduleList', {
method: 'GET',
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /api/admin/whiteList */
export async function whiteList1(options?: { [key: string]: any }) {
return request<API.RListMatrixWhiteDevice>('/api/admin/whiteList', {
method: 'GET',
...(options || {}),
});
}

15
src/services/matrix/matrixController.ts

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

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

@ -1,4 +1,15 @@
declare namespace API {
type AddMockScheduleReq = {
appId?: number;
incomeYuan?: number;
scheduleTime?: number;
};
type addWhiteList1Params = {
deviceId: string;
channel: string;
};
type addWhiteListParams = {
deviceId: string;
appCode: string;
@ -45,10 +56,19 @@ declare namespace API {
income?: number;
};
type deleteWhiteListParams = {
deviceId: string;
};
type deviceListParams = {
appCode: string;
};
type getAdvListParams = {
appCode: string;
deviceId: string;
};
type getAppInfoParams = {
appId?: string;
};
@ -156,15 +176,44 @@ declare namespace API {
sign?: string;
};
type MatrixAdvRecordSimple = {
deviceId?: string;
platform?: number;
advType?: number;
ecpm?: number;
createdAt?: number;
};
type MatrixApp = {
id?: number;
name?: string;
code?: string;
url?: string;
income?: number;
channel?: string;
hide?: number;
secret?: string;
};
type MatrixMockSchedule = {
id?: number;
appId?: number;
channel?: string;
incomeYuan?: number;
mockIncome?: number;
status?: number;
scheduleTime?: string;
createdAt?: string;
updatedAt?: string;
};
type MatrixWhiteDevice = {
id?: number;
deviceId?: string;
channel?: string;
createdAt?: string;
};
type mockDataParams = {
appCode: string;
incomeYuan: number;
@ -179,11 +228,14 @@ declare namespace API {
todayIncome?: number;
totalIncome?: number;
yesterdayIncome?: number;
lastMonthIncome?: number;
thisMonthIncome?: number;
};
type PageResultMatrixAdvRecordBo = {
data?: MatrixAdvRecordBo[];
total?: number;
sum?: number;
};
type RankList = {
@ -240,12 +292,30 @@ declare namespace API {
data?: MatrixAdminDevice[];
};
type RListMatrixAdvRecordSimple = {
code?: number;
message?: string;
data?: MatrixAdvRecordSimple[];
};
type RListMatrixApp = {
code?: number;
message?: string;
data?: MatrixApp[];
};
type RListMatrixMockSchedule = {
code?: number;
message?: string;
data?: MatrixMockSchedule[];
};
type RListMatrixWhiteDevice = {
code?: number;
message?: string;
data?: MatrixWhiteDevice[];
};
type RLoginBo = {
code?: number;
message?: string;

Loading…
Cancel
Save