From dd30202a7f1d6cb5255ee05715d0d1fd3a6b4395 Mon Sep 17 00:00:00 2001 From: zzy Date: Fri, 23 Sep 2022 17:44:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E7=9C=8B?= =?UTF-8?q?=E6=9D=BF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/access.ts | 3 + src/constants/enum/timeType.ts | 6 +- src/pages/DataBoard/CoreData/List/index.tsx | 138 +++++++++--------- src/pages/Login/index.less | 4 + src/pages/Recharge/CoinType/List/index.tsx | 15 +- src/pages/Recharge/Wallet/List/index.tsx | 3 + src/pages/System/Permissions/List/index.tsx | 3 + .../Role/components/AuthPermissionsDrawer.tsx | 27 ++-- src/pages/System/SecretKey/index.tsx | 49 ++++++- src/pages/User/List/index.tsx | 29 ++++ src/routes/index.ts | 18 --- src/routes/routePath.ts | 10 +- src/services/dataBorad/coreData.ts | 39 +---- src/services/system/secretKey.ts | 25 ++++ src/widget/MoreData.tsx | 10 +- 15 files changed, 224 insertions(+), 155 deletions(-) diff --git a/src/access.ts b/src/access.ts index ca84238..dbb9d5c 100644 --- a/src/access.ts +++ b/src/access.ts @@ -18,6 +18,9 @@ export default function access(initialState: { }, canShowButton: (buttonName) => { // return true; + if (routeList == null || routeList == undefined || routeList.length == 0) { + return true; + } return routeList.includes(buttonName); }, }; diff --git a/src/constants/enum/timeType.ts b/src/constants/enum/timeType.ts index 326e3b6..7a6237b 100644 --- a/src/constants/enum/timeType.ts +++ b/src/constants/enum/timeType.ts @@ -1,6 +1,6 @@ export enum TimeType { - DAY = 'day', - WEEK = 'week', - MONTH = 'month', + DAY = '1', + WEEK = '2', + MONTH = '3', } export default TimeType; diff --git a/src/pages/DataBoard/CoreData/List/index.tsx b/src/pages/DataBoard/CoreData/List/index.tsx index 5c1254e..660ab42 100644 --- a/src/pages/DataBoard/CoreData/List/index.tsx +++ b/src/pages/DataBoard/CoreData/List/index.tsx @@ -2,110 +2,79 @@ import React, { useRef, useState } from 'react'; import Table, { ProColumns, ActionType } from '@/components/Table'; import moment from 'moment'; import TimeType from '@/constants/enum/timeType'; -import { getData } from '@/utils/getData'; import MoreData from '@/widget/MoreData'; -import { - getCoreData, - getPayData, - getTodayUserData, - getMonthPayData, - getNewUserData, -} from '@/services/dataBorad/coreData'; +import { getCoreData, getListData } from '@/services/dataBorad/coreData'; import { Card, Col, Row, Select } from 'antd'; +import { fetchTableData } from '@/utils/table'; const CoreData: React.FC = () => { const tableRef = useRef(); - const [timeType, setTimeType] = useState(TimeType.DAY); - // const [date, setDate] = useState(getData); - const [userDate, setUserDate] = useState(getData(getTodayUserData)); - const [newUserdate, setNewUserDate] = useState(getData(getNewUserData)); - const [payData, setPayDate] = useState(getData(getMonthPayData)); - const [allPay, setAllPayDate] = useState(getData(getPayData)); + const TimeTypeList = [ + { + label: '每日', + value: TimeType.DAY, + }, + { + label: '每周', + value: TimeType.WEEK, + }, + { + label: '每月', + value: TimeType.MONTH, + }, + ]; + + const [coreData, setCoreData] = useState({ + today_active_user: '', + today_new_user: '', + month_recharge: '', + recharge_sum: '', + }); const columns: ProColumns[] = [ { title: '时间类型', - dataIndex: 'coinType', + dataIndex: 'code', hideInTable: true, initialValue: TimeType.DAY, - renderFormItem: (item, { type, defaultRender, ...rest }, form) => { - return ( -