Browse Source

commit

main
mac 5 months ago
parent
commit
cc3c1e19ed
  1. BIN
      .DS_Store
  2. 196
      package-lock.json
  3. 3
      package.json
  4. 74
      src/api/index.ts
  5. 59
      src/pages/account-review/index.tsx
  6. 65
      src/pages/assets-manage/assets-list.tsx
  7. 45
      src/pages/assets-manage/profit-list.tsx
  8. 53
      src/pages/chart/data.ts
  9. 76
      src/pages/chart/index.tsx
  10. 78
      src/pages/google/index.tsx
  11. 78
      src/pages/review/deposit.tsx
  12. 102
      src/pages/review/withdraw.tsx
  13. 56
      src/pages/system-log/emailLog.tsx
  14. 56
      src/pages/system-log/operationLog.tsx
  15. 57
      src/pages/system-log/walletLog.tsx
  16. 92
      src/pages/system/email-list.tsx
  17. 109
      src/pages/system/notify.tsx
  18. 118
      src/pages/system/receive.tsx
  19. 156
      src/pages/system/simulation-list.tsx
  20. 122
      src/pages/system/withdraw.tsx
  21. 4
      src/pages/vip-manage/proxy-list.tsx
  22. 74
      src/route/routes.ts
  23. 4
      src/utils/axios.ts

BIN
.DS_Store

196
package-lock.json

@ -31,6 +31,7 @@
"less": "^3.11.1",
"less-loader": "^5.0.0",
"moment": "^2.24.0",
"qrcode": "^1.5.3",
"react": "^16.13.1",
"react-canvas-nest": "^1.0.10",
"react-dom": "^16.13.1",
@ -8459,6 +8460,11 @@
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
"integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA=="
},
"node_modules/dijkstrajs": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
"integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA=="
},
"node_modules/dir-glob": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
@ -8717,6 +8723,11 @@
"node": ">= 4"
}
},
"node_modules/encode-utf8": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz",
"integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw=="
},
"node_modules/encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
@ -10322,7 +10333,6 @@
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"dev": true,
"dependencies": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
@ -15813,7 +15823,6 @@
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"dev": true,
"dependencies": {
"p-locate": "^4.1.0"
},
@ -17236,7 +17245,6 @@
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"dev": true,
"dependencies": {
"p-limit": "^2.2.0"
},
@ -17369,7 +17377,6 @@
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"dev": true,
"engines": {
"node": ">=8"
}
@ -17591,6 +17598,14 @@
"resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz",
"integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA=="
},
"node_modules/pngjs": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz",
"integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/pnp-webpack-plugin": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/pnp-webpack-plugin/-/pnp-webpack-plugin-1.5.0.tgz",
@ -18879,6 +18894,90 @@
"teleport": ">=0.2.0"
}
},
"node_modules/qrcode": {
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.3.tgz",
"integrity": "sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==",
"dependencies": {
"dijkstrajs": "^1.0.1",
"encode-utf8": "^1.0.3",
"pngjs": "^5.0.0",
"yargs": "^15.3.1"
},
"bin": {
"qrcode": "bin/qrcode"
},
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/qrcode/node_modules/cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
}
},
"node_modules/qrcode/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/qrcode/node_modules/wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/qrcode/node_modules/yargs": {
"version": "15.4.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
"dependencies": {
"cliui": "^6.0.0",
"decamelize": "^1.2.0",
"find-up": "^4.1.0",
"get-caller-file": "^2.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^2.0.0",
"set-blocking": "^2.0.0",
"string-width": "^4.2.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
"yargs-parser": "^18.1.2"
},
"engines": {
"node": ">=8"
}
},
"node_modules/qrcode/node_modules/yargs-parser": {
"version": "18.1.3",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
"dependencies": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/qs": {
"version": "6.5.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz",
@ -33440,6 +33539,11 @@
}
}
},
"dijkstrajs": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
"integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA=="
},
"dir-glob": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
@ -33653,6 +33757,11 @@
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q=="
},
"encode-utf8": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz",
"integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw=="
},
"encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
@ -34912,7 +35021,6 @@
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"dev": true,
"requires": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
@ -39170,7 +39278,6 @@
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"dev": true,
"requires": {
"p-locate": "^4.1.0"
}
@ -40288,7 +40395,6 @@
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"dev": true,
"requires": {
"p-limit": "^2.2.0"
}
@ -40393,8 +40499,7 @@
"path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"dev": true
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="
},
"path-is-absolute": {
"version": "1.0.1",
@ -40563,6 +40668,11 @@
"resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz",
"integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA=="
},
"pngjs": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz",
"integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw=="
},
"pnp-webpack-plugin": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/pnp-webpack-plugin/-/pnp-webpack-plugin-1.5.0.tgz",
@ -41589,6 +41699,74 @@
"resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
"integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw=="
},
"qrcode": {
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.3.tgz",
"integrity": "sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==",
"requires": {
"dijkstrajs": "^1.0.1",
"encode-utf8": "^1.0.3",
"pngjs": "^5.0.0",
"yargs": "^15.3.1"
},
"dependencies": {
"cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"requires": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
}
},
"strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"requires": {
"ansi-regex": "^5.0.1"
}
},
"wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
}
},
"yargs": {
"version": "15.4.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
"requires": {
"cliui": "^6.0.0",
"decamelize": "^1.2.0",
"find-up": "^4.1.0",
"get-caller-file": "^2.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^2.0.0",
"set-blocking": "^2.0.0",
"string-width": "^4.2.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
"yargs-parser": "^18.1.2"
}
},
"yargs-parser": {
"version": "18.1.3",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
"requires": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
}
}
}
},
"qs": {
"version": "6.5.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz",

3
package.json

@ -26,6 +26,7 @@
"less": "^3.11.1",
"less-loader": "^5.0.0",
"moment": "^2.24.0",
"qrcode": "^1.5.3",
"react": "^16.13.1",
"react-canvas-nest": "^1.0.10",
"react-dom": "^16.13.1",
@ -92,4 +93,4 @@
"pre-commit": "lint-staged"
}
}
}
}

74
src/api/index.ts

@ -88,7 +88,75 @@ export default {
},
user_relation(data: object) {
return $axios.post('/admin/inviti', data)
}
},
assets_review(data: object) {
return $axios.post('/admin/assetsReview', data)
},
profit_list(data: object) {
return $axios.post('/admin/profitList', data)
},
review_submit(data: object) {
return $axios.post('/admin/dataReview', data)
},
review_depositReview(data: object) {
return $axios.post('/admin/depositReview', data)
},
review_withdrawReview(data: object) {
return $axios.post('/admin/withdrawReview', data)
},
delete_nofity(data: object) {
return $axios.post('/admin/delMessageList', data)
},
add_nofity(data: object) {
return $axios.post('/admin/addMessageList', data)
},
update_nofity(data: object) {
return $axios.post('/admin/updMessageList', data)
},
add_receiveManage(data: object) {
return $axios.post('/admin/addPlatformDeposit', data)
},
delete_receiveManage(data: object) {
return $axios.post('/admin/delPlatformDeposit', data)
},
update_receiveManage(data: object) {
return $axios.post('/admin/updPlatformDeposit', data)
},
add_withdrawManage(data: object) {
return $axios.post('/admin/addWithdrawMethod', data)
},
delete_withdrawManage(data: object) {
return $axios.post('/admin/delWithdrawMethod', data)
},
update_withdrawManage(data: object) {
return $axios.post('/admin/updWithdrawMethod', data)
},
get_emailList(data: object) {
return $axios.post('/admin/emailList', data)
},
update_emailList(data: object) {
return $axios.post('/admin/updEmail', data)
},
get_simulationList(data: object) {
return $axios.post('/admin/levelList', data)
},
set_simulationList(data: object) {
return $axios.post('/admin/Updlevel', data)
},
get_emailRecord(data: object) {
return $axios.post('/admin/emailRecords', data)
},
get_operationRecord(data: object) {
return $axios.post('/admin/emailRecords', data)
},
get_walletRecord(data: object) {
return $axios.post('/admin/walletDetails', data)
},
get_googleBingCode(data: object) {
return $axios.post('/admin/authenticatorCode', data)
},
bind_googleCode(data: object) {
return $axios.post('/admin/bindAuthenticator', data)
},
}

59
src/pages/account-review/index.tsx

@ -1,11 +1,31 @@
import api from "@/api"
import MyTable from "@/components/MyTable"
import { getTime } from "@/utils"
import React from "react"
import { EditOutlined } from "@ant-design/icons"
import { Button, Input, Modal, notification } from "antd"
import React, { useEffect, useRef, useState } from "react"
const AccountReview = () => {
const [visible, setVisible] = useState(false)
const [currentItem, setCurrentItem] = useState({} as any)
const tableRef = useRef(null)
const columns = [
{
title: '操作',
width: 100,
render: (row) => {
return row.status_code === 0 ? (
<div style={{ display: "flex", alignItems: 'center' }}>
<EditOutlined onClick={() => {
setCurrentItem(() => row)
setVisible(true)
}} />
</div>
) : <></>
}
},
{ dataIndex: 'account', title: '帐号', width: 200 },
{ dataIndex: 'password', title: '密码', width: 200 },
{
@ -17,12 +37,49 @@ const AccountReview = () => {
{ dataIndex: 'status', title: '状态' },
]
const handleReview = async (type: number) => {
setVisible(false)
const res: any = await api.review_submit({
status_code: type,
id: currentItem.id
})
if (res.code === 0) {
notification.success({
message: type === 1 ? '已拒绝' : '已同意'
})
tableRef.current.update()
}
}
useEffect(() => {
!visible && setCurrentItem({})
}, [visible])
return (
<div>
<MyTable
ref={tableRef}
apiFun={api.get_accountReviewList}
columns={columns}
/>
<Modal
visible={visible}
onCancel={() => setVisible(false)}
title={`账号审核:${currentItem.account}`}
footer={() => null}
>
<div>{currentItem.account}</div>
<div style={{ marginTop: 10, display: 'flex' }}>
<div></div>
<div>{currentItem.password} </div>
</div>
<div style={{ marginTop: 20 }}>
<Button onClick={() => setVisible(false)}></Button>
<Button style={{ margin: '0 10px', backgroundColor: "#FF8C00", borderColor: '#FF8C00' }} type="primary" onClick={() => handleReview(1)}></Button>
<Button type="primary" onClick={() => handleReview(2)}></Button>
</div>
</Modal>
</div>
)
}

65
src/pages/assets-manage/assets-list.tsx

@ -1,11 +1,32 @@
import api from "@/api"
import MyTable from "@/components/MyTable"
import { getTime } from "@/utils"
import React from "react"
import { EditOutlined } from "@ant-design/icons"
import { Button, Form, Input, Modal, Switch, notification } from "antd"
import React, { useEffect, useRef, useState } from "react"
const AssetsList = () => {
const [visible, setVisible] = useState(false)
const [currentItem, setCurrentItem] = useState({} as any)
const [form] = Form.useForm()
const currentType = useRef(1)
const tableRef = useRef(null)
const columns = [
{
title: '操作',
render: (row) => {
return row.status_code === 0 ? (
<div style={{ display: "flex", alignItems: 'center' }}>
<EditOutlined onClick={() => {
setCurrentItem(() => row)
setVisible(true)
}} />
</div>
) : <></>
}
},
{
title: '状态',
dataIndex: 'status',
@ -49,15 +70,55 @@ const AssetsList = () => {
dataIndex: 'review',
width: 200
},
]
useEffect(() => {
!visible && setCurrentItem({})
}, [visible])
const onFinish = async (values) => {
setVisible(false)
const res: any = await api.assets_review({
...values,
id: currentItem.id,
status_code: currentType.current
})
if (res.code === 0) {
tableRef.current.update()
form.resetFields()
notification.success({
message: currentType.current === 1 ? '已拒绝' : '已同意'
})
}
}
return (
<div>
<MyTable
apiFun={api.get_assetsList}
columns={columns}
ref={tableRef}
/>
<Modal
visible={visible}
onCancel={() => setVisible(false)}
footer={() => null}
title={`审核用户:${currentItem.email}`}
>
<Form form={form} onFinish={onFinish}>
<Form.Item name="reason" label="原因" initialValue="">
<Input placeholder="请输入原因" />
</Form.Item>
<Form.Item label="邮箱通知" name="email_flag" initialValue={false} valuePropName="checked">
<Switch />
</Form.Item>
<Form.Item>
<Button onClick={() => setVisible(false)}></Button>
<Button style={{ margin: '0 10px', backgroundColor: "#FF8C00", borderColor: '#FF8C00' }} type="primary" htmlType="submit" onClick={() => currentType.current = 1}></Button>
<Button type="primary" htmlType="submit" onClick={() => currentType.current = 2}></Button>
</Form.Item>
</Form>
</Modal>
</div>
)
}

45
src/pages/assets-manage/profit-list.tsx

@ -0,0 +1,45 @@
import api from "@/api"
import MyTable from "@/components/MyTable"
import React from "react"
const ProfitList = () => {
const columns = [
{
title: '金额',
dataIndex: 'amount',
width: 200
},
{
title: '订单号',
dataIndex: 'order',
width: 200
},
{
title: '来源',
dataIndex: 'source',
width: 200
},
{
title: '时间',
dataIndex: 'time',
render: (text) => new Date(text * 1000).toLocaleString(), // 将时间戳转换为人类可读的格式
width: 200
},
{
title: '类型',
dataIndex: 'type',
},
]
return (
<div>
<MyTable
apiFun={api.profit_list}
columns={columns}
/>
</div>
)
}
export default ProfitList

53
src/pages/chart/data.ts

@ -1,53 +0,0 @@
import dagre from 'dagre';
const edgeType = 'smoothstep';
export const flattenTree = (tree) => {
let stack = [tree];
let nodes = [];
let edges = [];
while (stack.length > 0) {
let node = stack.pop();
nodes.push({ id: node.id, data: { ...node, label: `${node.name}` }, position: node.position });
if (node.children && node.children.length > 0) {
node.children.map(item => {
edges.push({ source: node.id, target: item.id, id: item.id, type: edgeType, animated: true });
stack.unshift(item);
});
};
};
return { nodes, edges };
};
export const getLayoutedElements = (nodes, edges, direction = 'TB') => {
const dagreGraph = new dagre.graphlib.Graph();
dagreGraph.setDefaultEdgeLabel(() => ({}));
const nodeWidth = 172;
const nodeHeight = 36;
const isHorizontal = direction === 'LR';
dagreGraph.setGraph({ rankdir: direction });
nodes.forEach((node: any) => {
dagreGraph.setNode(node.id, { width: nodeWidth, height: nodeHeight });
});
edges.forEach((edge: any) => {
dagreGraph.setEdge(edge.source, edge.target);
});
dagre.layout(dagreGraph);
nodes.forEach((node: any) => {
const nodeWithPosition = dagreGraph.node(node.id);
node.targetPosition = isHorizontal ? 'left' : 'top';
node.sourcePosition = isHorizontal ? 'right' : 'bottom';
node.position = {
x: nodeWithPosition.x - nodeWidth / 2,
y: nodeWithPosition.y - nodeHeight / 2,
};
return node;
});
return { nodes, edges };
};

76
src/pages/chart/index.tsx

@ -6,7 +6,8 @@ import ReactFlow, {
useEdgesState,
Controls
} from 'react-flow-renderer';
import { getLayoutedElements, flattenTree } from './data';
import dagre from 'dagre';
import { Button, Form, Input, Modal, notification } from 'antd';
import api from '@/api';
@ -54,7 +55,7 @@ const InviteChart: FC = () => {
return (
<div>
<Button onClick={() => onLayout('LR')} style={{ display: 'none' }} ref={buttonRef}>123123123</Button>
<Button onClick={() => onLayout('LR')} style={{ display: 'none' }} ref={buttonRef}></Button>
<Form layout='inline' form={form} onFinish={onFinish}>
<Form.Item name="email">
<Input placeholder='请输入邮箱' style={{ width: 300 }} />
@ -81,4 +82,73 @@ const InviteChart: FC = () => {
);
};
export default InviteChart;
const edgeType = 'smoothstep';
const flattenTree = (tree) => {
let stack = [tree];
let nodes = [];
let edges = [];
while (stack.length > 0) {
let node = stack.pop();
nodes.push({
id: node.id, data: {
...node, label: (
<div>
<div>{node.name}</div>
<div>{node.email}</div>
<div>{node.invitiCode}</div>
<div>{node.level}</div>
</div>
)
}, position: node.position, style: {
width: 260,
}
});
if (node.children && node.children.length > 0) {
node.children.map(item => {
edges.push({ source: node.id, target: item.id, id: item.id, type: edgeType, animated: true });
stack.unshift(item);
});
};
};
return { nodes, edges };
};
const getLayoutedElements = (nodes, edges, direction = 'TB') => {
const dagreGraph = new dagre.graphlib.Graph();
dagreGraph.setDefaultEdgeLabel(() => ({}));
const nodeWidth = 300;
const nodeHeight = 100;
const isHorizontal = direction === 'LR';
dagreGraph.setGraph({ rankdir: direction });
nodes.forEach((node: any) => {
dagreGraph.setNode(node.id, { width: nodeWidth, height: nodeHeight });
});
edges.forEach((edge: any) => {
dagreGraph.setEdge(edge.source, edge.target);
});
dagre.layout(dagreGraph);
console.log(dagreGraph);
nodes.forEach((node: any) => {
const nodeWithPosition = dagreGraph.node(node.id);
node.targetPosition = isHorizontal ? 'left' : 'top';
node.sourcePosition = isHorizontal ? 'right' : 'bottom';
node.position = {
x: nodeWithPosition.x - nodeWidth / 2,
y: nodeWithPosition.y - nodeHeight / 2,
};
return node;
});
return { nodes, edges };
};
export default InviteChart;

78
src/pages/google/index.tsx

@ -0,0 +1,78 @@
import api from "@/api"
import { Button, Form, Input, notification } from "antd"
import React, { useRef, useState } from "react"
import QRcode from 'qrcode'
const GoogleBind = () => {
const password = useRef(null)
const codeRef = useRef(null)
const [code, setCode] = useState('')
const [qrcode, setQrcode] = useState('')
const getCode = async () => {
const pwd = password.current.input.value;
if (!pwd) return notification.error({ message: '请输入密码!' })
const res: any = await api.get_googleBingCode({
password: pwd
})
if (res.code === 0) {
password.current.input.value = ''
setCode(res.data.url)
QRcode.toDataURL(res.data.url, (err, url) => {
setQrcode(url)
})
}
}
const bindCode = async () => {
const code = codeRef.current.input.value;
const res: any = await api.bind_googleCode({
code: Number(code)
})
if (res.code === 0) {
codeRef.current.input.value = '';
setCode('')
setQrcode('')
notification.success({
message: '绑定成功'
})
}
}
return (
<div style={{ maxWidth: 600 }}>
<h2></h2>
<Form.Item label="登录密码">
<Input.Password ref={password} />
</Form.Item>
<Form.Item>
<Button type="primary" onClick={getCode}></Button>
</Form.Item>
{
qrcode && (
<div style={{ marginTop: 30 }}>
<h2></h2>
<Form.Item label="二维码">
<img src={qrcode} style={{ width: 200, height: 200 }} alt="" />
</Form.Item>
<Form.Item label="谷歌验证码">
<Input placeholder="请输入谷歌验证码" ref={codeRef} />
</Form.Item>
<Form.Item>
<Button type="primary" onClick={bindCode}></Button>
</Form.Item>
</div>
)
}
</div>
)
}
export default GoogleBind

78
src/pages/review/deposit.tsx

@ -1,13 +1,34 @@
import api from "@/api"
import MyTable from "@/components/MyTable"
import { getTime } from "@/utils"
import { Tooltip } from "antd"
import { EditOutlined } from "@ant-design/icons"
import { Button, Form, Input, Modal, Switch, Tooltip, notification } from "antd"
import { title } from "process"
import React from "react"
import React, { useRef, useState } from "react"
const DepositReview = () => {
const [visible, setVisible] = useState(false)
const [currentItem, setCurrentItem] = useState({} as any)
const tableRef = useRef(null)
const currentType = useRef(1)
const [form] = Form.useForm()
const columns = [
{
title: '操作',
width: 100,
render: (row) => {
return row.status_code === 0 ? (
<div style={{ display: "flex", alignItems: 'center' }}>
<EditOutlined onClick={() => {
setCurrentItem(() => row)
setVisible(true)
}} />
</div>
) : <></>
}
},
{
title: '状态',
dataIndex: 'status',
@ -53,13 +74,66 @@ const DepositReview = () => {
dataIndex: 'order'
},
]
console.log(currentItem);
const onFinish = async (values) => {
setVisible(false)
const res: any = await api.review_depositReview({
...values,
id: currentItem.id,
status_code: currentType.current
})
if (res.code === 0) {
tableRef.current.update()
form.resetFields()
notification.success({
message: currentType.current === 1 ? '已拒绝' : '已同意'
})
}
}
return (
<div>
<MyTable
apiFun={api.get_depositReviewList}
columns={columns}
ref={tableRef}
/>
<Modal
visible={visible}
onCancel={() => setVisible(false)}
footer={() => null}
title={`存款审核:${currentItem.email}`}
>
<Form form={form} onFinish={onFinish}>
<Form.Item label="用户">
<div>{currentItem.email}</div>
</Form.Item>
<Form.Item label="币种">
<div>{currentItem.symbol}</div>
</Form.Item>
<Form.Item label="存款方式">
<div>{currentItem.deposit_method}</div>
</Form.Item>
<Form.Item label="图片">
<Tooltip title={<img src={currentItem.url} style={{ width: '100%', height: 'auto', objectFit: 'contain' }} alt="" />}>
<img src={currentItem.url} style={{ width: 100, height: 60, objectFit: 'contain' }} alt="" onClick={() => window.open(currentItem.url)} />
</Tooltip>
</Form.Item>
<Form.Item name="reason" label="原因" initialValue="">
<Input placeholder="请输入原因" />
</Form.Item>
<Form.Item label="邮箱通知" name="email_flag" initialValue={false} valuePropName="checked">
<Switch />
</Form.Item>
<Form.Item>
<Button onClick={() => setVisible(false)}></Button>
<Button style={{ margin: '0 10px', backgroundColor: "#FF8C00", borderColor: '#FF8C00' }} type="primary" htmlType="submit" onClick={() => currentType.current = 1}></Button>
<Button type="primary" htmlType="submit" onClick={() => currentType.current = 2}></Button>
</Form.Item>
</Form>
</Modal>
</div>
)
}

102
src/pages/review/withdraw.tsx

@ -1,11 +1,33 @@
import api from "@/api"
import MyTable from "@/components/MyTable"
import { getTime } from "@/utils"
import React from "react"
import { EditOutlined } from "@ant-design/icons"
import { Button, Form, Input, Modal, Switch, notification } from "antd"
import React, { useRef, useState } from "react"
const WithdrawReview = () => {
const [visible, setVisible] = useState(false)
const [currentItem, setCurrentItem] = useState({} as any)
const tableRef = useRef(null)
const currentType = useRef(1)
const [form] = Form.useForm()
const columns = [
{
title: '操作',
width: 100,
render: (row) => {
return row.status_code === 0 ? (
<div style={{ display: "flex", alignItems: 'center' }}>
<EditOutlined onClick={() => {
setCurrentItem(() => row)
setVisible(true)
}} />
</div>
) : <></>
}
},
{ "dataIndex": "Withdraw_method", "title": "取款方式" },
{ "dataIndex": "withdraw_source", "title": "取款来自" },
{ "dataIndex": "account", "title": "MT账户" },
@ -21,12 +43,90 @@ const WithdrawReview = () => {
{ "dataIndex": "type", "title": "钱包类型" },
]
const onFinish = async (values) => {
setVisible(false)
const res: any = await api.review_withdrawReview({
...values,
id: currentItem.id,
status_code: currentType.current
})
if (res.code === 0) {
tableRef.current.update()
form.resetFields()
notification.success({
message: currentType.current === 1 ? '已拒绝' : '已同意'
})
}
}
return (
<div>
<MyTable
apiFun={api.get_withdrawReviewList}
columns={columns}
ref={tableRef}
/>
<Modal
visible={visible}
onCancel={() => setVisible(false)}
footer={() => null}
title={`取款审核:${currentItem.email}`}
>
<Form form={form} onFinish={onFinish}>
<div style={{ display: 'flex' }}>
<Form.Item label="用户" style={{ flex: 1 }}>
<div>{currentItem.email}</div>
</Form.Item>
</div>
<div style={{ display: 'flex' }}>
<Form.Item label="钱包地址" style={{ flex: 1 }}>
<div>{currentItem.address}</div>
</Form.Item>
</div>
<div style={{ display: 'flex' }}>
<Form.Item label="取款方式" style={{ flex: 1 }}>
<div>{currentItem.Withdraw_method}</div>
</Form.Item>
<Form.Item label="取款来自" style={{ flex: 1 }}>
<div>{currentItem.withdraw_source}</div>
</Form.Item>
</div>
<div style={{ display: 'flex' }}>
<Form.Item label="取款金额" style={{ flex: 1 }}>
<div>{currentItem.amount}</div>
</Form.Item>
<Form.Item label="取款手续费" style={{ flex: 1 }}>
<div>{currentItem.fee}</div>
</Form.Item>
</div>
<div style={{ display: 'flex' }}>
<Form.Item label="取款币种" style={{ flex: 1 }}>
<div>{currentItem.symbol}</div>
</Form.Item>
<Form.Item label="时间" style={{ flex: 1 }}>
<div>{getTime(currentItem.time * 1000)}</div>
</Form.Item>
</div>
<Form.Item name="reason" label="原因" initialValue="">
<Input placeholder="请输入原因" />
</Form.Item>
<Form.Item label="邮箱通知" name="email_flag" initialValue={false} valuePropName="checked">
<Switch />
</Form.Item>
<Form.Item>
<Button onClick={() => setVisible(false)}></Button>
<Button style={{ margin: '0 10px', backgroundColor: "#FF8C00", borderColor: '#FF8C00' }} type="primary" htmlType="submit" onClick={() => currentType.current = 1}></Button>
<Button type="primary" htmlType="submit" onClick={() => currentType.current = 2}></Button>
</Form.Item>
</Form>
</Modal>
</div>
)
}

56
src/pages/system-log/emailLog.tsx

@ -0,0 +1,56 @@
import api from "@/api"
import MyTable from "@/components/MyTable"
import React from "react"
const EmailLog = () => {
const columns = [
{
title: '接受帐号',
dataIndex: 'account',
width: 200,
},
{
title: '详细',
dataIndex: 'detail',
width: 200,
},
{
title: 'ID',
width: 200,
dataIndex: 'id',
},
{
title: '状态',
width: 200,
dataIndex: 'status',
},
{
title: '时间',
width: 200,
dataIndex: 'time',
render: (text) => new Date(text * 1000).toLocaleString(), // 将时间戳转换为人类可读的格式
},
{
title: '标题',
width: 200,
dataIndex: 'title',
},
{
title: '类型',
dataIndex: 'type',
},
];
return (
<div>
<MyTable
apiFun={api.get_emailRecord}
columns={columns}
/>
</div>
)
}
export default EmailLog

56
src/pages/system-log/operationLog.tsx

@ -0,0 +1,56 @@
import api from "@/api"
import MyTable from "@/components/MyTable"
import React from "react"
const OperationLog = () => {
const columns = [
{
title: '接受帐号',
dataIndex: 'account',
width: 260
},
{
title: '详细',
dataIndex: 'detail',
width: 200
},
{
title: 'ID',
dataIndex: 'id',
width: 200
},
{
title: '状态',
dataIndex: 'status',
width: 200
},
{
title: '时间',
dataIndex: 'time',
render: (text) => new Date(text * 1000).toLocaleString(), // 将时间戳转换为人类可读的格式
width: 200
},
{
title: '标题',
dataIndex: 'title',
width: 200
},
{
title: '类型',
dataIndex: 'type',
},
];
return (
<div>
<MyTable
apiFun={api.get_operationRecord}
columns={columns}
/>
</div>
)
}
export default OperationLog

57
src/pages/system-log/walletLog.tsx

@ -0,0 +1,57 @@
import api from "@/api"
import MyTable from "@/components/MyTable"
import React, { useRef } from "react"
const WalletLog = () => {
const tableRef = useRef(null)
const columns = [
{
title: '金额',
dataIndex: 'amount',
width: 200
},
{
title: '剩余金额',
dataIndex: 'balance',
width: 200
},
{
title: 'MT帐号',
dataIndex: 'count',
width: 200
},
{
title: 'ID',
dataIndex: 'id',
width: 200
},
{
title: '流水号',
dataIndex: 'order',
width: 200
},
{
title: '时间',
dataIndex: 'time',
render: (text) => new Date(text * 1000).toLocaleString(), // 将时间戳转换为人类可读的格式
},
{
title: '类型',
dataIndex: 'type',
},
];
return (
<div>
<MyTable
ref={tableRef}
apiFun={api.get_walletRecord}
columns={columns}
/>
</div>
)
}
export default WalletLog

92
src/pages/system/email-list.tsx

@ -0,0 +1,92 @@
import api from "@/api"
import MyTable from "@/components/MyTable"
import { EditOutlined } from "@ant-design/icons"
import { Button, Form, Modal, notification } from "antd"
import TextArea from "antd/lib/input/TextArea"
import React, { useRef, useState } from "react"
const EmailList = () => {
const [visible, setVisible] = useState(false)
const currentItem = useRef({} as any)
const tableRef = useRef(null)
const [form] = Form.useForm()
const columns = [
{
title: '操作',
width: 100,
render: (row) => {
return (
<div style={{ display: "flex", alignItems: 'center' }}>
<EditOutlined style={{ marginRight: 20 }} onClick={() => updateNotify(row)} />
</div>
);
}
},
{
title: '标题',
dataIndex: 'title',
width: 200
},
{
title: '内容',
dataIndex: 'content',
render: (content) => (
<div style={{ maxWidth: 700 }}>{content}</div>
)
}
]
const updateNotify = (item) => {
currentItem.current = item;
form.setFieldsValue(item)
setVisible(true)
}
const onFinish = async (values) => {
setVisible(false)
const res: any = await api.update_emailList({
...values,
id: currentItem.current.id
})
if (res.code === 0) {
tableRef.current.update()
form.resetFields()
notification.success({
message: "修改成功"
})
}
}
return (
<div>
<MyTable
apiFun={api.get_emailList}
columns={columns}
ref={tableRef}
/>
<Modal
visible={visible}
onCancel={() => setVisible(false)}
title={`修改《${currentItem.current.title}》邮件模版`}
footer={() => null}
>
<Form form={form} onFinish={onFinish}>
<Form.Item label="标题" name="title">
<TextArea />
</Form.Item>
<Form.Item label="内容" name="content">
<TextArea style={{ minHeight: 200 }} />
</Form.Item>
<Form.Item style={{ display: 'flex' }} label="操作">
<Button onClick={() => setVisible(false)}></Button>
<Button style={{ marginLeft: 20 }} type="primary" htmlType="submit"></Button>
</Form.Item>
</Form>
</Modal>
</div>
)
}
export default EmailList

109
src/pages/system/notify.tsx

@ -1,12 +1,33 @@
import api from "@/api"
import MyTable from "@/components/MyTable"
import { getTime } from "@/utils"
import { Tooltip } from "antd"
import React from "react"
import { DeleteFilled, EditOutlined } from "@ant-design/icons"
import { Button, Form, Input, Modal, Popconfirm, Switch, Tooltip, notification } from "antd"
import React, { useEffect, useRef, useState } from "react"
const SystemNofify = () => {
const tableRef = useRef(null)
const [visbleModel, setVisibleModal] = useState(false)
const [form] = Form.useForm()
const currentType = useRef('')
const currentItem = useRef({} as any)
const columns = [
{
title: '操作',
width: 100,
render: (row) => {
return (
<div style={{ display: "flex", alignItems: 'center' }}>
<EditOutlined style={{ marginRight: 20 }} onClick={() => updateNotify(row)} />
<Popconfirm title={`确定删除吗?`} onConfirm={() => deleteNotify(row)}>
<DeleteFilled />
</Popconfirm>
</div>
);
}
},
{
"dataIndex": "title", "title": "标题", width: 340, render: (text) => (
<Tooltip title={text}>
@ -25,12 +46,96 @@ const SystemNofify = () => {
{ "dataIndex": "time", "title": "时间", render: (time) => (<div>{getTime(time * 1000)}</div>) },
]
const updateNotify = async (item) => {
currentType.current = 'update';
currentItem.current = item;
setVisibleModal(true)
form.setFieldsValue({
title: item.title,
content: item.content,
status_code: item.status_code === 1 ? true : false
})
}
const deleteNotify = async (item) => {
const res: any = await api.delete_nofity({
id: item.id
})
if (res.code === 0) {
notification.success({
message: '删除成功'
})
tableRef.current.update()
}
}
const onFinish = async (values) => {
setVisibleModal(false)
const params = {
...values,
status_code: values.status_code ? 1 : 2
}
let res: any = {};
if (currentType.current === 'update') {
params.id = currentItem.current.id
res = await api.update_nofity({
...params
})
} else {
res = await api.add_nofity({
...params
})
}
if (res.code === 0) {
notification.success({
message: currentType.current === 'update' ? '修改成功' : '添加成功'
})
tableRef.current.update()
form.resetFields()
}
}
return (
<div>
<MyTable
apiFun={api.get_systemNofify}
columns={columns}
ref={tableRef}
header={
<div style={{ marginBottom: 20 }}>
<Button type="primary" onClick={() => setVisibleModal(true)}></Button>
</div>
}
/>
<Modal
visible={visbleModel}
title="新增公告"
onCancel={() => {
currentType.current = 'add';
setVisibleModal(false)
}}
footer={() => null}
>
<Form form={form} onFinish={onFinish}>
<Form.Item label="标题" name="title" rules={[{ required: true, message: '请输入标题' }]}>
<Input placeholder="请输入标题" />
</Form.Item>
<Form.Item label="内容" name="content" rules={[{ required: true, message: '请输入内容' }]}>
<Input placeholder="请输入内容" />
</Form.Item>
<Form.Item label="状态" name="status_code" valuePropName="checked" initialValue={true}>
<Switch />
</Form.Item>
<Form.Item style={{ display: 'flex' }}>
<Button onClick={() => setVisibleModal(false)}></Button>
<Button style={{ marginLeft: 20 }} type="primary" htmlType="submit"></Button>
</Form.Item>
</Form>
</Modal>
</div>
)
}

118
src/pages/system/receive.tsx

@ -1,10 +1,32 @@
import api from "@/api"
import MyTable from "@/components/MyTable"
import React from "react"
import { DeleteFilled, EditOutlined } from "@ant-design/icons"
import { Button, Form, Input, Modal, Popconfirm, Switch, notification } from "antd"
import React, { useRef, useState } from "react"
const SystemReceive = () => {
const [visible, setVisible] = useState(false)
const currentType = useRef('' as 'update' | 'add')
const currentItem = useRef({} as any)
const [form] = Form.useForm()
const tableRef = useRef(null)
const columns = [
{
title: '操作',
width: 100,
render: (row) => {
return (
<div style={{ display: "flex", alignItems: 'center' }}>
<EditOutlined style={{ marginRight: 20 }} onClick={() => updateNotify(row)} />
<Popconfirm title={`确定删除吗?`} onConfirm={() => deleteNotify(row)}>
<DeleteFilled />
</Popconfirm>
</div>
);
}
},
{ "dataIndex": "address", "title": "钱包地址", width: 200 },
{ "dataIndex": "fee", "title": "手续费" },
{ "dataIndex": "name", "title": "名称", width: 200 },
@ -13,12 +35,106 @@ const SystemReceive = () => {
{ "dataIndex": "type", "title": "钱包类型" }
]
const deleteNotify = async (item) => {
const res: any = await api.delete_receiveManage({
id: item.id
})
if (res.code === 0) {
notification.success({
message: '删除成功'
})
tableRef.current.update()
}
}
const onFinish = async (values) => {
setVisible(false)
const parmas = {
...values,
status_code: values.status_code ? 1 : 2,
google_code: Number(values.google_code)
}
let res: any = {}
if (currentType.current === 'add') {
res = await api.add_receiveManage({
...parmas
})
} else {
res = await api.update_receiveManage({
...parmas,
id: currentItem.current.id
})
}
if (res.code === 0) {
tableRef.current.update()
notification.success({
message: currentType.current === 'add' ? '添加成功' : '修改成功'
})
form.resetFields()
}
}
const updateNotify = (item) => {
currentType.current = 'update';
currentItem.current = item;
form.setFieldsValue({
...item,
status_code: item.status_code === 1 ? true : false
})
setVisible(true)
}
return (
<div>
<MyTable
apiFun={api.get_systemReceive}
columns={columns}
ref={tableRef}
header={
<div style={{ marginBottom: 20 }}>
<Button type="primary" onClick={() => {
currentType.current = 'add';
setVisible(true)
}}></Button>
</div>
}
/>
<Modal
visible={visible}
onCancel={() => setVisible(false)}
footer={() => null}
title="添加平台收款"
>
<Form form={form} onFinish={onFinish}>
<Form.Item name="name" label="名称" rules={[{ required: true, message: '请输入名称' }]}>
<Input placeholder="请输入名称" />
</Form.Item>
<Form.Item name="address" label="钱包地址" rules={[{ required: true, message: '请输入钱包地址' }]}>
<Input placeholder="请输入钱包地址" />
</Form.Item>
<Form.Item name="fee" label="手续费" rules={[{ required: true, message: '请输入手续费' }]}>
<Input placeholder="请输入手续费" />
</Form.Item>
<Form.Item name="symbol" label="币符号" rules={[{ required: true, message: '请输入币符号' }]}>
<Input placeholder="请输入币符号" />
</Form.Item>
<Form.Item name="type" label="钱包类型" rules={[{ required: true, message: '请输入钱包类型' }]}>
<Input placeholder="请输入钱包类型" />
</Form.Item>
<Form.Item name="google_code" label="谷歌验证码" rules={[{ required: true, message: '请输入谷歌验证码' }]}>
<Input placeholder="请输入谷歌验证码" />
</Form.Item>
<Form.Item name="status_code" label="状态" valuePropName="checked" initialValue={true}>
<Switch />
</Form.Item>
<Form.Item style={{ display: 'flex' }}>
<Button onClick={() => setVisible(false)}></Button>
<Button style={{ marginLeft: 20 }} type="primary" htmlType="submit"></Button>
</Form.Item>
</Form>
</Modal>
</div>
)
}

156
src/pages/system/simulation-list.tsx

@ -0,0 +1,156 @@
import api from "@/api"
import MyTable from "@/components/MyTable"
import { EditOutlined } from "@ant-design/icons"
import { Button, Form, Input, Modal, notification } from "antd"
import React, { useRef, useState } from "react"
const SimulationList = () => {
const currentItem = useRef({} as any)
const [form] = Form.useForm()
const [visible, setVisible] = useState(false)
const tableRef = useRef(null)
const columns = [
{
title: '操作',
width: 100,
render: (row) => {
return (
<div style={{ display: "flex", alignItems: 'center' }}>
<EditOutlined style={{ marginRight: 20 }} onClick={() => updateNotify(row)} />
</div>
);
}
},
{
title: '考核数量',
dataIndex: 'assess_num',
key: 'assess_num',
},
{
title: '佣金收益',
dataIndex: 'commis_income',
key: 'commis_income',
},
{
title: '直推考核业绩',
dataIndex: 'direct',
key: 'direct',
},
{
title: 'ID',
dataIndex: 'id',
key: 'id',
},
{
title: '级别',
dataIndex: 'level',
key: 'level',
},
{
title: '盈利分红',
dataIndex: 'profit_dividends',
key: 'profit_dividends',
},
{
title: '平级佣金',
dataIndex: 'same_commis',
key: 'same_commis',
},
{
title: '平级分红',
dataIndex: 'same_dividends',
key: 'same_dividends',
},
{
title: '团队考核级别',
dataIndex: 'team_level',
key: 'team_level',
},
// {
// title: '团队考核级别代码',
// dataIndex: 'team_level_code',
// key: 'team_level_code',
// },
{
title: '团队考核级别的数量',
dataIndex: 'team_num',
key: 'team_num',
},
];
const updateNotify = (item) => {
currentItem.current = item;
form.setFieldsValue(item)
setVisible(true)
}
const onFinish = async (values) => {
setVisible(false)
const res: any = await api.set_simulationList({
...values,
id: currentItem.current.id,
assess_num: Number(values.assess_num),
team_level_code: Number(values.team_level_code),
team_num: Number(values.team_num),
})
if (res.code === 0) {
tableRef.current.update()
form.resetFields()
notification.success({
message: '修改成功'
})
}
}
return (
<div>
<MyTable
apiFun={api.get_simulationList}
columns={columns}
ref={tableRef}
/>
<Modal
visible={visible}
onCancel={() => setVisible(false)}
footer={() => null}
title="修改模拟参数"
>
<Form form={form} onFinish={onFinish}>
<Form.Item label="考核数量" name="assess_num" rules={[{ required: true, message: '请输入考核数量' }]}>
<Input placeholder="请输入考核数量" />
</Form.Item>
<Form.Item label="佣金收益" name="commis_income" rules={[{ required: true, message: '请输入佣金收益' }]}>
<Input placeholder="请输入佣金收益" />
</Form.Item>
<Form.Item label="直推考核业绩" name="direct" rules={[{ required: true, message: '请输入直推考核业绩' }]}>
<Input placeholder="请输入直推考核业绩" />
</Form.Item>
<Form.Item label="盈利分红" name="profit_dividends" rules={[{ required: true, message: '请输入盈利分红' }]}>
<Input placeholder="请输入盈利分红" />
</Form.Item>
<Form.Item label="平级佣金" name="same_commis" rules={[{ required: true, message: '请输入平级佣金' }]}>
<Input placeholder="请输入平级佣金" />
</Form.Item>
<Form.Item label="平级分红" name="same_dividends" rules={[{ required: true, message: '请输入平级分红' }]}>
<Input placeholder="请输入平级分红" />
</Form.Item>
<Form.Item label="团队考核级别的数量" name="team_num" rules={[{ required: true, message: '请输入团队考核级别的数量' }]}>
<Input placeholder="请输入团队考核级别的数量" />
</Form.Item>
<Form.Item label="团队考核级别" name="team_level_code">
<Input placeholder="请输入平级分红" disabled />
</Form.Item>
<Form.Item style={{ display: 'flex' }} label="操作">
<Button onClick={() => setVisible(false)}></Button>
<Button style={{ marginLeft: 20 }} type="primary" htmlType="submit"></Button>
</Form.Item>
</Form>
</Modal>
</div>
)
}
export default SimulationList

122
src/pages/system/withdraw.tsx

@ -1,25 +1,139 @@
import api from "@/api"
import MyTable from "@/components/MyTable"
import React from "react"
import { DeleteFilled, EditOutlined } from "@ant-design/icons"
import { Button, Form, Input, Modal, Popconfirm, Switch, notification } from "antd"
import React, { useRef, useState } from "react"
const SystemWithdraw = () => {
const [visible, setVisible] = useState(false)
const currentType = useRef('' as 'update' | 'add')
const currentItem = useRef({} as any)
const [form] = Form.useForm()
const tableRef = useRef(null)
const columns = [
{
title: '操作',
width: 100,
render: (row) => {
return (
<div style={{ display: "flex", alignItems: 'center' }}>
<EditOutlined style={{ marginRight: 20 }} onClick={() => updateNotify(row)} />
<Popconfirm title={`确定删除吗?`} onConfirm={() => deleteNotify(row)}>
<DeleteFilled />
</Popconfirm>
</div>
);
}
},
{ "dataIndex": "fee", "title": "手续费", width: 200 },
{ "dataIndex": "leastAmount", "title": "最小金额", width: 200 },
{ "dataIndex": "maxAmount", "title": "最大金额", width: 200 },
{ "dataIndex": "LeastAmount", "title": "最小金额", width: 200 },
{ "dataIndex": "MaxAmount", "title": "最大金额", width: 200 },
{ "dataIndex": "name", "title": "名称", width: 200 },
{ "dataIndex": "status", "title": "状态" },
{ "dataIndex": "status", "title": "状态", width: 200 },
{ "dataIndex": "symbol", "title": "币符号" }
]
const deleteNotify = async (item) => {
const res: any = await api.delete_withdrawManage({
id: item.id
})
if (res.code === 0) {
notification.success({
message: '删除成功'
})
tableRef.current.update()
}
}
const onFinish = async (values) => {
setVisible(false)
const parmas = {
...values,
status_code: values.status_code ? 1 : 2,
google_code: Number(values.google_code)
}
let res: any = {}
if (currentType.current === 'add') {
res = await api.add_withdrawManage({
...parmas
})
} else {
res = await api.update_withdrawManage({
...parmas,
id: currentItem.current.id
})
}
if (res.code === 0) {
tableRef.current.update()
notification.success({
message: currentType.current === 'add' ? '添加成功' : '修改成功'
})
form.resetFields()
}
}
const updateNotify = (item) => {
currentType.current = 'update';
currentItem.current = item;
form.setFieldsValue({
...item,
status_code: item.status_code === 1 ? true : false
})
setVisible(true)
}
return (
<div>
<MyTable
columns={columns}
apiFun={api.get_systemWithdraw}
ref={tableRef}
header={
<div style={{ marginBottom: 20 }}>
<Button type="primary" onClick={() => {
currentType.current = 'add';
setVisible(true)
}}></Button>
</div>
}
/>
<Modal
visible={visible}
onCancel={() => setVisible(false)}
footer={() => null}
title="添加取款方式"
>
<Form form={form} onFinish={onFinish}>
<Form.Item name="name" label="名称" rules={[{ required: true, message: '请输入名称' }]}>
<Input placeholder="请输入名称" />
</Form.Item>
<Form.Item name="least_amount" label="最小金额" rules={[{ required: true, message: '请输入最小金额' }]}>
<Input placeholder="请输入最小金额" />
</Form.Item>
<Form.Item name="max_amount" label="最大金额" rules={[{ required: true, message: '请输入最大金额' }]}>
<Input placeholder="请输入最大金额" />
</Form.Item>
<Form.Item name="fee" label="手续费" rules={[{ required: true, message: '请输入手续费' }]}>
<Input placeholder="请输入手续费" />
</Form.Item>
<Form.Item name="symbol" label="币符号" rules={[{ required: true, message: '请输入币符号' }]}>
<Input placeholder="请输入币符号" />
</Form.Item>
<Form.Item name="status_code" label="状态" valuePropName="checked" initialValue={true}>
<Switch />
</Form.Item>
<Form.Item style={{ display: 'flex' }}>
<Button onClick={() => setVisible(false)}></Button>
<Button style={{ marginLeft: 20 }} type="primary" htmlType="submit"></Button>
</Form.Item>
</Form>
</Modal>
</div>
)
}

4
src/pages/vip-manage/proxy-list.tsx

@ -125,6 +125,9 @@ const ProxyList = () => {
notification.success({
message: '添加成功'
});
setTimeout(() => {
tableRef.current.update();
}, 3000)
}
};
@ -154,6 +157,7 @@ const ProxyList = () => {
{ title: 'MT余额', dataIndex: 'account_amount' },
{ title: '钱包余额', dataIndex: 'balance' },
{ title: '本金', dataIndex: 'principal' },
{ title: '跟单账号', dataIndex: 'account_follow' },
{ title: '会员账号', dataIndex: 'email' },
{ title: '代理级别', dataIndex: 'level' },
{ title: '观察者密码', dataIndex: 'observer_password' },

74
src/route/routes.ts

@ -13,6 +13,13 @@ import SystemNotify from "@/pages/system/notify"
import SystemReceive from "@/pages/system/receive"
import AccountReview from "@/pages/account-review"
import InviteChart from "@/pages/chart"
import ProfitList from "@/pages/assets-manage/profit-list"
import EmailList from "@/pages/system/email-list"
import SimulationList from "@/pages/system/simulation-list"
import EmailLog from "@/pages/system-log/emailLog"
import OperationLog from "@/pages/system-log/operationLog"
import WalletLog from "@/pages/system-log/walletLog"
import GoogleBind from "@/pages/google"
const routes = [
{
@ -49,6 +56,22 @@ const routes = [
component: SystemNotify,
routes: []
},
{
path: '/email-list',
name: '邮件模版',
exact: true,
key: 'email-list',
component: EmailList,
routes: []
},
{
path: '/simulation-list',
name: '模拟参数设置',
exact: true,
key: 'simulation-list',
component: SimulationList,
routes: []
},
{
path: '/system-receive',
name: '平台收款管理',
@ -108,6 +131,14 @@ const routes = [
key: 'assets-list',
component: AssetsList,
routes: []
},
{
path: '/profit-list',
name: '利润结算列表',
exact: true,
key: 'profit-list',
component: ProfitList,
routes: []
}
]
},
@ -173,13 +204,52 @@ const routes = [
},
{
path: '/chart',
name: '仪表盘',
name: '代理树',
exact: true,
key: 'chart',
icon: HomeOutlined,
icon: SolutionOutlined,
component: InviteChart,
routes: []
},
{
path: '/system-log',
name: '系统日志',
exact: true,
key: 'system-log',
icon: SolutionOutlined,
type: 'subMenu',
routes: [
{
path: '/emailLog',
name: '邮件记录',
exact: true,
key: 'emailLog',
component: EmailLog,
},
{
path: '/operationLog',
name: '操作日志',
exact: true,
key: 'operationLog',
component: OperationLog,
},
{
path: '/walletLog',
name: '钱包明细',
exact: true,
key: 'walletLog',
component: WalletLog,
}
]
},
{
path: '/google-bind',
name: '绑定谷歌验证器',
exact: true,
key: 'google-bind',
component: GoogleBind,
icon: SolutionOutlined,
}
]

4
src/utils/axios.ts

@ -12,8 +12,8 @@ interface AxiosConfig {
}
export const getBaseUrl = () => {
return `http://203.161.61.234:8082/api/v1`
// return `https://matontrading.com/api/v1`
// return `http://203.161.61.234:8082/api/v1`
return `https://matontrading.com/api/v1`
}
export const getOriginUrl = () => {

Loading…
Cancel
Save