Browse Source

feat: 内部用户和刷数据v2支持表格刷新

qiji
nili 3 months ago
parent
commit
ea09733d9a
  1. 2
      dist/_umi_route_preload_helper.32d131c3.js
  2. 4
      dist/index.html
  3. 1
      dist/p__SuperAdmin.762227e0.async.js
  4. 1
      dist/p__SuperAdmin.dec1a716.async.js
  5. 2
      dist/umi.9bb2df36.js
  6. 33
      src/pages/SuperAdmin/InnerUserManagement.tsx
  7. 52
      src/pages/SuperAdmin/MockScheduleManagement.tsx

2
dist/_umi_route_preload_helper.fc289021.js → dist/_umi_route_preload_helper.32d131c3.js

@ -1 +1 @@
!function(){"use strict";var t="/".replace(/([^/])$/,"$1/"),e=location.pathname,n=e.startsWith(t)&&decodeURI("/".concat(e.slice(t.length)));if(n){var a=document,c=a.head,r=a.createElement.bind(a),i=function(t,e,n){var a,c=e.r[t]||(null===(a=Object.entries(e.r).find((function(e){var n=e[0];return new RegExp("^".concat(n.replace(/\/:[^/]+/g,"/[^/]+").replace("/*","/.+"),"$")).test(t)})))||void 0===a?void 0:a[1]);return null==c?void 0:c.map((function(t){var a=e.f[t][1],c=e.f[t][0];return{type:c.split(".").pop(),url:"".concat(n.publicPath).concat(c),attrs:[["data-".concat(e.b),"".concat(e.p,":").concat(a)]]}}))}(n,{"p":"ant-design-pro","b":"webpack","f":[["15.a664eb81.async.js",15],["134.6fc81d91.async.js",134],["169.57647c7d.async.js",169],["p__Welcome.61596037.async.js",185],["p__MoneyManagement.4138f9c6.async.js",190],["t__plugin-layout__Layout.6cae69f5.chunk.css",301],["t__plugin-layout__Layout.4594a64b.async.js",301],["p__User__Login__index.9d3ab92e.async.js",366],["p__DeviceOwnerApp.c61abcd9.async.js",371],["390.41467286.async.js",390],["393.38316f72.async.js",393],["397.fb5f72c1.async.js",397],["p__SuperAdmin.dec1a716.async.js",455],["p__Proxy__ProxyUserManagement.3e781dae.async.js",526],["531.35af34f5.async.js",531],["539.290aefb9.async.js",539],["p__AdvRecordListV2.93e34297.async.js",542],["p__Bind.b6ee068f.async.js",557],["559.016bfdbb.async.js",559],["p__404.0c100574.async.js",571],["635.8a884f26.async.js",635],["p__App__AppManagement.6464403a.async.js",731],["761.f7bbde11.async.js",761],["p__AdminManagement.22b52ba3.async.js",816],["841.614ef4c0.async.js",841],["p__AdvRecordList.fc092f59.async.js",857],["p__UserManagement.0ef1f876.async.js",903],["905.6e225d1b.async.js",905],["930.fca7adbf.async.js",930],["931.c2d40e0b.async.js",931],["p__Proxy__ProxyAdvRecordListV2.20a0f4c8.async.js",990]],"r":{"/*":[19,27],"/":[1,5,6,18,20,27],"/welcome":[1,2,3,10,18,28,5,6,20,27],"/super":[0,1,2,12,14,15,27,28,29,5,6,18,20],"/adminList":[0,1,2,14,15,22,23,27,5,6,18,20],"/bind":[1,2,10,11,17,18,28,5,6,20,27],"/appList":[1,2,11,14,15,21,27,28,29,5,6,18,20],"/advList/:code":[1,2,14,15,18,24,25,27,28,5,6,20],"/advListV2/:code":[0,1,2,14,15,16,18,24,27,28,5,6,20],"/user/:code":[0,1,2,14,15,26,27,28,5,6,18,20],"/money/:code":[0,1,2,4,14,15,27,28,5,6,18,20],"/app/:code":[1,2,8,14,15,18,24,27,28,5,6,20],"/user/login":[1,2,7,14],"/proxy/advListV2/:code":[0,1,2,14,15,18,24,27,28,30,5,6,20],"/proxy/user/:code":[0,1,2,13,14,15,27,28,5,6,18,20]}},{publicPath:"https://apks.bzgames.cn/matrix_fe/"});null==i||i.forEach((function(t){var e,n=t.type,a=t.url;if("js"===n)(e=r("script")).src=a,e.async=!0;else{if("css"!==n)return;(e=r("link")).href=a,e.rel="preload",e.as="style"}t.attrs.forEach((function(t){e.setAttribute(t[0],t[1]||"")})),c.appendChild(e)}))}}(); !function(){"use strict";var t="/".replace(/([^/])$/,"$1/"),e=location.pathname,n=e.startsWith(t)&&decodeURI("/".concat(e.slice(t.length)));if(n){var a=document,c=a.head,r=a.createElement.bind(a),i=function(t,e,n){var a,c=e.r[t]||(null===(a=Object.entries(e.r).find((function(e){var n=e[0];return new RegExp("^".concat(n.replace(/\/:[^/]+/g,"/[^/]+").replace("/*","/.+"),"$")).test(t)})))||void 0===a?void 0:a[1]);return null==c?void 0:c.map((function(t){var a=e.f[t][1],c=e.f[t][0];return{type:c.split(".").pop(),url:"".concat(n.publicPath).concat(c),attrs:[["data-".concat(e.b),"".concat(e.p,":").concat(a)]]}}))}(n,{"p":"ant-design-pro","b":"webpack","f":[["15.a664eb81.async.js",15],["134.6fc81d91.async.js",134],["169.57647c7d.async.js",169],["p__Welcome.61596037.async.js",185],["p__MoneyManagement.4138f9c6.async.js",190],["t__plugin-layout__Layout.6cae69f5.chunk.css",301],["t__plugin-layout__Layout.4594a64b.async.js",301],["p__User__Login__index.9d3ab92e.async.js",366],["p__DeviceOwnerApp.c61abcd9.async.js",371],["390.41467286.async.js",390],["393.38316f72.async.js",393],["397.fb5f72c1.async.js",397],["p__SuperAdmin.762227e0.async.js",455],["p__Proxy__ProxyUserManagement.3e781dae.async.js",526],["531.35af34f5.async.js",531],["539.290aefb9.async.js",539],["p__AdvRecordListV2.93e34297.async.js",542],["p__Bind.b6ee068f.async.js",557],["559.016bfdbb.async.js",559],["p__404.0c100574.async.js",571],["635.8a884f26.async.js",635],["p__App__AppManagement.6464403a.async.js",731],["761.f7bbde11.async.js",761],["p__AdminManagement.22b52ba3.async.js",816],["841.614ef4c0.async.js",841],["p__AdvRecordList.fc092f59.async.js",857],["p__UserManagement.0ef1f876.async.js",903],["905.6e225d1b.async.js",905],["930.fca7adbf.async.js",930],["931.c2d40e0b.async.js",931],["p__Proxy__ProxyAdvRecordListV2.20a0f4c8.async.js",990]],"r":{"/*":[19,27],"/":[1,5,6,18,20,27],"/welcome":[1,2,3,10,18,28,5,6,20,27],"/super":[0,1,2,12,14,15,27,28,29,5,6,18,20],"/adminList":[0,1,2,14,15,22,23,27,5,6,18,20],"/bind":[1,2,10,11,17,18,28,5,6,20,27],"/appList":[1,2,11,14,15,21,27,28,29,5,6,18,20],"/advList/:code":[1,2,14,15,18,24,25,27,28,5,6,20],"/advListV2/:code":[0,1,2,14,15,16,18,24,27,28,5,6,20],"/user/:code":[0,1,2,14,15,26,27,28,5,6,18,20],"/money/:code":[0,1,2,4,14,15,27,28,5,6,18,20],"/app/:code":[1,2,8,14,15,18,24,27,28,5,6,20],"/user/login":[1,2,7,14],"/proxy/advListV2/:code":[0,1,2,14,15,18,24,27,28,30,5,6,20],"/proxy/user/:code":[0,1,2,13,14,15,27,28,5,6,18,20]}},{publicPath:"https://apks.bzgames.cn/matrix_fe/"});null==i||i.forEach((function(t){var e,n=t.type,a=t.url;if("js"===n)(e=r("script")).src=a,e.async=!0;else{if("css"!==n)return;(e=r("link")).href=a,e.rel="preload",e.as="style"}t.attrs.forEach((function(t){e.setAttribute(t[0],t[1]||"")})),c.appendChild(e)}))}}();

4
dist/index.html

@ -7,10 +7,10 @@
<title>Ant Design Pro</title> <title>Ant Design Pro</title>
<link rel="stylesheet" href="https://apks.bzgames.cn/matrix_fe/umi.1ca9308c.css"> <link rel="stylesheet" href="https://apks.bzgames.cn/matrix_fe/umi.1ca9308c.css">
<script async src="/scripts/loading.js"></script> <script async src="/scripts/loading.js"></script>
<script src="https://apks.bzgames.cn/matrix_fe/_umi_route_preload_helper.fc289021.js"></script> <script src="https://apks.bzgames.cn/matrix_fe/_umi_route_preload_helper.32d131c3.js"></script>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script src="https://apks.bzgames.cn/matrix_fe/umi.0ea2c086.js"></script> <script src="https://apks.bzgames.cn/matrix_fe/umi.9bb2df36.js"></script>
</body> </body>
</html> </html>

1
dist/p__SuperAdmin.762227e0.async.js

File diff suppressed because one or more lines are too long

1
dist/p__SuperAdmin.dec1a716.async.js

File diff suppressed because one or more lines are too long

2
dist/umi.0ea2c086.js → dist/umi.9bb2df36.js

File diff suppressed because one or more lines are too long

33
src/pages/SuperAdmin/InnerUserManagement.tsx

@ -1,26 +1,16 @@
import { innerUserList } from '@/services/matrix/superAdmin'; import { innerUserList } from '@/services/matrix/superAdmin';
import { SearchOutlined } from '@ant-design/icons'; import { SearchOutlined } from '@ant-design/icons';
import { ProColumns, ProTable } from '@ant-design/pro-components'; import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { Button, Form, Input, InputNumber, Modal, Space } from 'antd'; import { Button, Form, Input, InputNumber, Modal, Space } from 'antd';
import { useEffect, useState } from 'react'; import { useRef, useState } from 'react';
import { saveInnerUser } from '../../services/matrix/superAdmin'; import { saveInnerUser } from '../../services/matrix/superAdmin';
import UserInfo from '../User/UserInfo'; import UserInfo from '../User/UserInfo';
const InnerUserManagement = () => { const InnerUserManagement = () => {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [whiteUserArr, setWhiteUserArr] = useState<API.WhiteUserBo[]>([]);
const [filteredArr, setFilteredArr] = useState<API.WhiteUserBo[]>([]);
const [form] = Form.useForm(); const [form] = Form.useForm();
const actionRef = useRef<ActionType>();
const fetchApp = async () => {
const res = await innerUserList();
if (res.data) {
setWhiteUserArr(res.data);
setFilteredArr(res.data);
}
};
const columns: ProColumns<API.WhiteUserBo>[] = [ const columns: ProColumns<API.WhiteUserBo>[] = [
{ {
@ -113,10 +103,6 @@ const InnerUserManagement = () => {
}, },
]; ];
useEffect(() => {
fetchApp();
}, []);
return ( return (
<> <>
<Button <Button
@ -131,11 +117,16 @@ const InnerUserManagement = () => {
<ProTable <ProTable
search={false} search={false}
onReset={() => { actionRef={actionRef}
setFilteredArr(whiteUserArr); request={async () => {
const res = await innerUserList();
return {
data: res.data,
total: res.data?.length,
success: true,
};
}} }}
columns={columns} columns={columns}
dataSource={filteredArr}
/> />
<Modal <Modal
@ -156,7 +147,7 @@ const InnerUserManagement = () => {
onFinish={async ({ userId }) => { onFinish={async ({ userId }) => {
if (userId) { if (userId) {
await saveInnerUser({ userId: userId }); await saveInnerUser({ userId: userId });
fetchApp(); actionRef.current?.reload();
} }
}} }}
> >

52
src/pages/SuperAdmin/MockScheduleManagement.tsx

@ -1,16 +1,17 @@
import { appList } from '@/services/matrix/admin'; import { appList } from '@/services/matrix/admin';
import { addScheduleV2, scheduleListV2 } from '@/services/matrix/superAdmin'; import { addScheduleV2, scheduleListV2 } from '@/services/matrix/superAdmin';
import { formatIncome } from '@/utils/numberUtils'; import { formatIncome } from '@/utils/numberUtils';
import { Button, DatePicker, Form, Input, Modal, Select, Table, Tag, message } from 'antd'; import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { ColumnsType } from 'antd/es/table'; import { Button, DatePicker, Form, Input, Modal, Select, Tag, message } from 'antd';
import moment, { Moment } from 'moment'; import moment, { Moment } from 'moment';
import { useEffect, useState } from 'react'; import { useEffect, useRef, useState } from 'react';
const MockScheduleManagement = () => { const MockScheduleManagement = () => {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [appArr, setAppArr] = useState<API.MatrixApp[]>([]); const [appArr, setAppArr] = useState<API.MatrixApp[]>([]);
const [scheduleArr, setScheduleArr] = useState<API.MatrixMockSchedule[]>([]);
const [scheduleForm] = Form.useForm(); const [scheduleForm] = Form.useForm();
const actionRef = useRef<ActionType>();
const fetchApp = async () => { const fetchApp = async () => {
const res = await appList(); const res = await appList();
@ -24,20 +25,13 @@ const MockScheduleManagement = () => {
return app ? app.name : ''; return app ? app.name : '';
}; };
const fetchScheduleList = async () => { const sColumns: ProColumns<API.MatrixMockScheduleV2>[] = [
const res = await scheduleListV2();
if (res.data) {
setScheduleArr(res.data);
}
};
const sColumns: ColumnsType<API.MatrixMockScheduleV2> = [
{ {
title: '应用', title: '应用',
dataIndex: 'appId', dataIndex: 'appId',
render: (appId) => ( renderText: (_, r) => (
<Tag color="blue" key={appId}> <Tag color="blue" key={r.appId}>
{getAppNameById(appId)} {getAppNameById(r.appId || 0)}
</Tag> </Tag>
), ),
}, },
@ -48,21 +42,21 @@ const MockScheduleManagement = () => {
{ {
title: '已刷金额', title: '已刷金额',
dataIndex: 'mockIncome', dataIndex: 'mockIncome',
render: (r: number) => { renderText: (r: number) => {
return formatIncome(r); return formatIncome(r);
}, },
}, },
{ {
title: '开始时间', title: '开始时间',
dataIndex: 'scheduleTime', dataIndex: 'scheduleTime',
render: (r: string) => { renderText: (r: string) => {
return moment(r).format('YYYY-MM-DD HH:mm'); return moment(r).format('YYYY-MM-DD HH:mm');
}, },
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'status', dataIndex: 'status',
render: (r: number) => { renderText: (r: number) => {
switch (r) { switch (r) {
case 0: case 0:
return '未开始'; return '未开始';
@ -77,14 +71,14 @@ const MockScheduleManagement = () => {
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'createdAt', dataIndex: 'createdAt',
render: (r: string) => { renderText: (r: string) => {
return moment(r).format('YYYY-MM-DD HH:mm'); return moment(r).format('YYYY-MM-DD HH:mm');
}, },
}, },
{ {
title: '更新时间', title: '更新时间',
dataIndex: 'updatedAt', dataIndex: 'updatedAt',
render: (r: string) => { renderText: (r: string) => {
return moment(r).format('YYYY-MM-DD HH:mm'); return moment(r).format('YYYY-MM-DD HH:mm');
}, },
}, },
@ -92,7 +86,6 @@ const MockScheduleManagement = () => {
useEffect(() => { useEffect(() => {
fetchApp(); fetchApp();
fetchScheduleList();
}, []); }, []);
const addScheduleTask = () => { const addScheduleTask = () => {
@ -104,8 +97,19 @@ const MockScheduleManagement = () => {
<> <>
<div> <div>
<Button onClick={addScheduleTask}></Button> <Button onClick={addScheduleTask}></Button>
<Table columns={sColumns} dataSource={scheduleArr} /> <ProTable
search={false}
actionRef={actionRef}
request={async () => {
const res = await scheduleListV2();
return {
data: res.data,
total: res.data?.length,
success: true,
};
}}
columns={sColumns}
/>
<Modal <Modal
title="添加任务" title="添加任务"
visible={visible} visible={visible}
@ -135,7 +139,7 @@ const MockScheduleManagement = () => {
return; return;
} }
message.success('任务提交成功'); message.success('任务提交成功');
fetchScheduleList(); actionRef.current?.reload();
setVisible(false); setVisible(false);
}} }}
> >

Loading…
Cancel
Save