WIP: user-zzy-dev #1
|
|
@ -1,6 +1,11 @@
|
||||||
import React, { useState, useRef } from 'react';
|
import React, { useState, useRef } from 'react';
|
||||||
import Table, { ProColumns, ActionType } from '@/components/Table';
|
import Table, { ProColumns, ActionType } from '@/components/Table';
|
||||||
import { getAddressList, deleteAddress, createAddress, modifyAddress } from '@/services/address';
|
import {
|
||||||
|
getAddressList,
|
||||||
|
deleteAddress,
|
||||||
|
createAddress,
|
||||||
|
modifyAddress,
|
||||||
|
} from '@/services/Recharge/address';
|
||||||
|
|
|||||||
import { fetchTableData } from '@/utils/table';
|
import { fetchTableData } from '@/utils/table';
|
||||||
import DeleteButton from '@/components/Table/DeleteButton';
|
import DeleteButton from '@/components/Table/DeleteButton';
|
||||||
import AddAddressModal from './components/addAddressModal';
|
import AddAddressModal from './components/addAddressModal';
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { useState, useRef } from 'react';
|
import React, { useState, useRef } from 'react';
|
||||||
import Table, { ProColumns, ActionType } from '@/components/Table';
|
import Table, { ProColumns, ActionType } from '@/components/Table';
|
||||||
import { addCoinType, getCoinTypeList, modifyCoinType } from '@/services/coinType';
|
import { addCoinType, getCoinTypeList, modifyCoinType } from '@/services/Recharge/coinType';
|
||||||
import { fetchTableData } from '@/utils/table';
|
import { fetchTableData } from '@/utils/table';
|
||||||
import AddCoinTypeModal from './components/addCoinTypeModal';
|
import AddCoinTypeModal from './components/addCoinTypeModal';
|
||||||
import EditCoinTypeModal from './components/editCoinTypeModal';
|
import EditCoinTypeModal from './components/editCoinTypeModal';
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { useRef } from 'react';
|
import React, { useRef } from 'react';
|
||||||
import Table, { ProColumns, ActionType } from '@/components/Table';
|
import Table, { ProColumns, ActionType } from '@/components/Table';
|
||||||
import { getRecordList } from '@/services/record';
|
import { getRecordList } from '@/services/Recharge/record';
|
||||||
import { fetchTableData } from '@/utils/table';
|
import { fetchTableData } from '@/utils/table';
|
||||||
import { getBalanceAmount } from '@/utils/formatBalance';
|
import { getBalanceAmount } from '@/utils/formatBalance';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { useRef } from 'react';
|
import React, { useRef } from 'react';
|
||||||
import Table, { ProColumns, ActionType } from '@/components/Table';
|
import Table, { ProColumns, ActionType } from '@/components/Table';
|
||||||
import { getWithdrawList, solveWithdraw } from '@/services/withdraw';
|
import { getWithdrawList, solveWithdraw } from '@/services/Recharge/withdraw';
|
||||||
import { fetchTableData } from '@/utils/table';
|
import { fetchTableData } from '@/utils/table';
|
||||||
import { getBalanceAmount } from '@/utils/formatBalance';
|
import { getBalanceAmount } from '@/utils/formatBalance';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
import React, { useState, useRef } from 'react';
|
||||||
|
import Table, { ProColumns, ActionType } from '@/components/Table';
|
||||||
|
import { getAccountList, deleteUser } from '@/services/System/accountManage';
|
||||||
|
import { fetchTableData } from '@/utils/table';
|
||||||
|
import DeleteButton from '@/components/Table/DeleteButton';
|
||||||
|
import { Switch } from 'antd';
|
||||||
|
|
||||||
|
const AccountManageList = () => {
|
||||||
|
const handleEdit = (row: any) => {};
|
||||||
|
|
||||||
|
const handleDelete = async (name: any) => {
|
||||||
|
await deleteUser({ name: name });
|
||||||
|
};
|
||||||
|
const onChange = (checked: boolean) => {};
|
||||||
|
const tableRef = useRef<ActionType>();
|
||||||
|
const columns: ProColumns<any>[] = [
|
||||||
|
{
|
||||||
|
title: '账号',
|
||||||
|
dataIndex: 'name',
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '角色',
|
||||||
|
dataIndex: 'role',
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '用户状态',
|
||||||
|
dataIndex: 'status',
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
valueType: 'option',
|
||||||
|
width: 180,
|
||||||
|
render: (_, row) => [
|
||||||
|
<a
|
||||||
|
key="edit"
|
||||||
|
onClick={() => {
|
||||||
|
handleEdit(row);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</a>,
|
||||||
|
<Switch key="switch" defaultChecked={row.status} size="small" onChange={onChange} />,
|
||||||
|
<DeleteButton
|
||||||
|
key="delete"
|
||||||
|
onDelete={() => {
|
||||||
|
handleDelete(row.name);
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Table
|
||||||
|
columns={columns}
|
||||||
|
rowKey="id"
|
||||||
|
toolBarActions={[
|
||||||
|
{
|
||||||
|
type: 'add',
|
||||||
|
onConfirm: () => {},
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
actionRef={tableRef}
|
||||||
|
request={async (params) => {
|
||||||
|
const res = await fetchTableData(getAccountList, params);
|
||||||
|
return res;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AccountManageList;
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
import React, { useState, useRef } from 'react';
|
||||||
|
import Table, { ProColumns, ActionType } from '@/components/Table';
|
||||||
|
import { fetchTableData } from '@/utils/table';
|
||||||
|
import DeleteButton from '@/components/Table/DeleteButton';
|
||||||
|
|
||||||
|
const PermissionsList = () => {
|
||||||
|
const handleEdit = (row: any) => {};
|
||||||
|
|
||||||
|
const handleDelete = async (name: any) => {};
|
||||||
|
const tableRef = useRef<ActionType>();
|
||||||
|
const columns: ProColumns<any>[] = [
|
||||||
|
{
|
||||||
|
title: '收款地址',
|
||||||
|
dataIndex: 'address',
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '收款游戏币类型',
|
||||||
|
dataIndex: 'bc_type',
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
valueType: 'option',
|
||||||
|
width: 150,
|
||||||
|
render: (_, row) => [
|
||||||
|
<a
|
||||||
|
key="edit"
|
||||||
|
onClick={() => {
|
||||||
|
handleEdit(row);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</a>,
|
||||||
|
<DeleteButton
|
||||||
|
key="delete"
|
||||||
|
onDelete={() => {
|
||||||
|
handleDelete(row.name);
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Table
|
||||||
|
columns={columns}
|
||||||
|
rowKey="id"
|
||||||
|
toolBarActions={[
|
||||||
|
{
|
||||||
|
type: 'add',
|
||||||
|
onConfirm: () => {},
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
actionRef={tableRef}
|
||||||
|
request={async (params) => {
|
||||||
|
return {};
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default PermissionsList;
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
import React, { useRef } from 'react';
|
||||||
|
import Table, { ProColumns, ActionType } from '@/components/Table';
|
||||||
|
import { getRoleList, deleteRole } from '@/services/System/role';
|
||||||
|
import { fetchTableData } from '@/utils/table';
|
||||||
|
import DeleteButton from '@/components/Table/DeleteButton';
|
||||||
|
|
||||||
|
const RoleList = () => {
|
||||||
|
const handleEdit = (row: any) => {};
|
||||||
|
const handleAuth = (row: any) => {};
|
||||||
|
const handleDelete = async (role: any) => {
|
||||||
|
await deleteRole({ role: role });
|
||||||
|
};
|
||||||
|
const tableRef = useRef<ActionType>();
|
||||||
|
const columns: ProColumns<any>[] = [
|
||||||
|
{
|
||||||
|
title: '角色名称',
|
||||||
|
dataIndex: 'role_name',
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '用户类型',
|
||||||
|
dataIndex: 'role',
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
valueType: 'option',
|
||||||
|
width: 180,
|
||||||
|
render: (_, row) => [
|
||||||
|
<a
|
||||||
|
key="edit"
|
||||||
|
onClick={() => {
|
||||||
|
handleEdit(row);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</a>,
|
||||||
|
<a
|
||||||
|
key="auth"
|
||||||
|
onClick={() => {
|
||||||
|
handleAuth(row);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
授权
|
||||||
|
</a>,
|
||||||
|
<DeleteButton
|
||||||
|
key="delete"
|
||||||
|
onDelete={() => {
|
||||||
|
handleDelete(row.role);
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Table
|
||||||
|
columns={columns}
|
||||||
|
rowKey="id"
|
||||||
|
toolBarActions={[
|
||||||
|
{
|
||||||
|
type: 'add',
|
||||||
|
onConfirm: () => {},
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
actionRef={tableRef}
|
||||||
|
request={async (params) => {
|
||||||
|
const res = await fetchTableData(getRoleList, params);
|
||||||
|
return res;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RoleList;
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
import React, { useState, useRef } from 'react';
|
||||||
|
import Table, { ProColumns, ActionType } from '@/components/Table';
|
||||||
|
import { getUserList } from '@/services/User/user';
|
||||||
|
import { fetchTableData } from '@/utils/table';
|
||||||
|
|
||||||
|
const UserManageList = () => {
|
||||||
|
const tableRef = useRef<ActionType>();
|
||||||
|
const columns: ProColumns<any>[] = [
|
||||||
|
{
|
||||||
|
title: '用户钱包地址',
|
||||||
|
dataIndex: 'address',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '登陆时间',
|
||||||
|
dataIndex: 'last_time',
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '注册时间',
|
||||||
|
dataIndex: 'first_time',
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Table
|
||||||
|
columns={columns}
|
||||||
|
rowKey="id"
|
||||||
|
toolBarActions={[
|
||||||
|
{
|
||||||
|
type: 'add',
|
||||||
|
onConfirm: () => {},
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
actionRef={tableRef}
|
||||||
|
request={async (params) => {
|
||||||
|
const res = await fetchTableData(getUserList, params);
|
||||||
|
return res;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default UserManageList;
|
||||||
|
|
@ -41,6 +41,32 @@ export default [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: '系统设置',
|
||||||
|
path: RoutePath.SYSTEM,
|
||||||
|
routes: [
|
||||||
|
{
|
||||||
|
path: RoutePath.SYSTEM,
|
||||||
|
redirect: RoutePath.ACCOUNT.LIST,
|
||||||
|
hideInMenu: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '账号管理',
|
||||||
|
path: RoutePath.ACCOUNT.LIST,
|
||||||
|
component: './System/Account/List',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '角色管理',
|
||||||
|
path: RoutePath.ROLE.LIST,
|
||||||
|
component: './System/Role/List',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '权限管理',
|
||||||
|
path: RoutePath.PERMISSIONS.LIST,
|
||||||
|
component: './System/Permissions/List',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: '设置',
|
name: '设置',
|
||||||
path: RoutePath.SETTING,
|
path: RoutePath.SETTING,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
const SETTING = '/setting';
|
const SETTING = '/setting';
|
||||||
const RECHARGE = '/recharge';
|
const RECHARGE = '/recharge';
|
||||||
|
const SYSTEM = '/system';
|
||||||
const RoutePath = {
|
const RoutePath = {
|
||||||
LOGIN: '/login',
|
LOGIN: '/login',
|
||||||
RECHARGE: RECHARGE,
|
RECHARGE: RECHARGE,
|
||||||
|
|
@ -15,6 +16,16 @@ const RoutePath = {
|
||||||
WITHDRAW: {
|
WITHDRAW: {
|
||||||
LIST: `${RECHARGE}/withdraw`,
|
LIST: `${RECHARGE}/withdraw`,
|
||||||
},
|
},
|
||||||
|
SYSTEM: SYSTEM,
|
||||||
|
ACCOUNT: {
|
||||||
|
LIST: `${SYSTEM}/account`,
|
||||||
|
},
|
||||||
|
ROLE: {
|
||||||
|
LIST: `${SYSTEM}/role`,
|
||||||
|
},
|
||||||
|
PERMISSIONS: {
|
||||||
|
LIST: `${SYSTEM}/permissions`,
|
||||||
|
},
|
||||||
SETTING: SETTING,
|
SETTING: SETTING,
|
||||||
WORK: {
|
WORK: {
|
||||||
LIST: `${SETTING}/work`,
|
LIST: `${SETTING}/work`,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取后台用户列表
|
||||||
|
* @param {object} params
|
||||||
|
* @returns {array} data
|
||||||
|
*/
|
||||||
|
export const getAccountList = (params) => {
|
||||||
|
return request.request({
|
||||||
|
url: '/tgb/api/v1/user/get',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除后台用户
|
||||||
|
* @param {object} data
|
||||||
|
* name 用户名
|
||||||
|
* @returns {array} data
|
||||||
|
*/
|
||||||
|
export const deleteUser = (data) => {
|
||||||
|
return request.request({
|
||||||
|
url: '/tgb/api/v1/user/get',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取后台角色列表
|
||||||
|
* @param {object} params
|
||||||
|
* @returns {array} data
|
||||||
|
* role_name 角色名称
|
||||||
|
* role 角色类型
|
||||||
|
*/
|
||||||
|
export const getRoleList = (params) => {
|
||||||
|
return request.request({
|
||||||
|
url: '/tgb/api/v1/user/role',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除后台角色
|
||||||
|
* @param {object} params
|
||||||
|
* role 角色类型
|
||||||
|
* @returns {array} data
|
||||||
|
*/
|
||||||
|
export const deleteRole = (data) => {
|
||||||
|
return request.request({
|
||||||
|
url: '/tgb/api/v1/user/role/delete',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取后台角色列表
|
||||||
|
* @param {object} params
|
||||||
|
* @returns {array} data
|
||||||
|
* role_name 角色名称
|
||||||
|
* role 角色类型
|
||||||
|
*/
|
||||||
|
export const getUserList = (params) => {
|
||||||
|
return request.request({
|
||||||
|
url: '/tgb/api/v1/account/get',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue
就组件和页面首字母大写,理解不清楚的看看pancake代码