Browse Source

h5展示列

fanmiyou
nili 7 months ago
parent
commit
b1753932bf
  1. 2
      dist/index.html
  2. 1
      dist/p__AdvRecordList.e1c1d752.async.js
  3. 1
      dist/p__AdvRecordList.ec333a28.async.js
  4. 1
      dist/p__DeviceOwnerApp.15acd8c2.async.js
  5. 1
      dist/p__DeviceOwnerApp.287b3a44.async.js
  6. 2
      dist/umi.a7e407cb.js
  7. 20
      src/pages/AdvRecordList.tsx
  8. 20
      src/pages/DeviceOwnerApp.tsx

2
dist/index.html

@ -9,6 +9,6 @@
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script src="/umi.920dedb8.js"></script> <script src="/umi.a7e407cb.js"></script>
</body></html> </body></html>

1
dist/p__AdvRecordList.e1c1d752.async.js

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

1
dist/p__AdvRecordList.ec333a28.async.js

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

1
dist/p__DeviceOwnerApp.15acd8c2.async.js

File diff suppressed because one or more lines are too long

1
dist/p__DeviceOwnerApp.287b3a44.async.js

File diff suppressed because one or more lines are too long

2
dist/umi.920dedb8.js → dist/umi.a7e407cb.js

File diff suppressed because one or more lines are too long

20
src/pages/AdvRecordList.tsx

@ -1,4 +1,4 @@
import { PageContainer, ProColumns, ProTable } from '@ant-design/pro-components'; import { ColumnsState, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
import { ProFieldRequestData, RequestOptionsType } from '@ant-design/pro-utils'; import { ProFieldRequestData, RequestOptionsType } from '@ant-design/pro-utils';
import React, { useRef, useState } from 'react'; import React, { useRef, useState } from 'react';
@ -18,6 +18,18 @@ const AdvRecordList: React.FC = () => {
return data; return data;
}; };
const isMobile = () => {
return window.innerWidth <= 768;
};
const [columnsState, setColumnsState] = useState<Record<string, ColumnsState>>({
deviceId: { show: !isMobile() },
appName: { show: !isMobile() },
platform: { show: !isMobile() },
device: { show: !isMobile() },
ip: { show: !isMobile() },
advType: { show: !isMobile() },
});
const columns: ProColumns<API.MatrixAdvRecordBo>[] = [ const columns: ProColumns<API.MatrixAdvRecordBo>[] = [
{ {
title: '应用名称', title: '应用名称',
@ -144,6 +156,12 @@ const AdvRecordList: React.FC = () => {
}; };
}} }}
columns={columns} columns={columns}
columnsState={{
value: columnsState,
onChange: (newState) => {
setColumnsState(newState);
},
}}
/> />
</PageContainer> </PageContainer>
); );

20
src/pages/DeviceOwnerApp.tsx

@ -1,5 +1,6 @@
import { advList, appList } from '@/services/matrix/admin'; import { advList, appList } from '@/services/matrix/admin';
import { import {
ColumnsState,
PageContainer, PageContainer,
ProColumns, ProColumns,
ProFieldRequestData, ProFieldRequestData,
@ -38,6 +39,10 @@ const DeviceOwnerApp: React.FC = () => {
return data; return data;
}; };
const isMobile = () => {
return window.innerWidth <= 768;
};
const fetchDevice = async (params: any) => { const fetchDevice = async (params: any) => {
if (!params.appName) { if (!params.appName) {
return { return {
@ -65,6 +70,15 @@ const DeviceOwnerApp: React.FC = () => {
deviceRef.current?.reload(); deviceRef.current?.reload();
}; };
const [columnsState, setColumnsState] = useState<Record<string, ColumnsState>>({
deviceId: { show: !isMobile() },
appName: { show: !isMobile() },
platform: { show: !isMobile() },
deviceBrand: { show: !isMobile() },
deviceName: { show: !isMobile() },
ip: { show: !isMobile() },
});
const columns: ProColumns<API.MatrixAdvRecordBo>[] = [ const columns: ProColumns<API.MatrixAdvRecordBo>[] = [
{ {
title: '应用名称', title: '应用名称',
@ -252,6 +266,12 @@ const DeviceOwnerApp: React.FC = () => {
}} }}
request={fetchData} request={fetchData}
columns={columns} columns={columns}
columnsState={{
value: columnsState,
onChange: (newState) => {
setColumnsState(newState);
},
}}
/> />
</TabPane> </TabPane>
</Tabs> </Tabs>

Loading…
Cancel
Save