diff --git a/src/api/statistics/trade.ts b/src/api/statistics/trade.ts new file mode 100644 index 00000000..f7829ccb --- /dev/null +++ b/src/api/statistics/trade.ts @@ -0,0 +1,70 @@ +import request from '@/config/axios' +import dayjs from 'dayjs' +import { formatDate } from '@/utils/formatTime' + +/** 交易统计对照 Response VO */ +export interface TradeStatisticsComparisonRespVO { + value: T + reference: T +} + +/** 交易统计 Response VO */ +export interface TradeSummaryRespVO { + yesterdayOrderCount: number + monthOrderCount: number + yesterdayPayPrice: number + monthPayPrice: number +} + +/** 交易状况 Request VO */ +export interface TradeTrendReqVO { + times: [dayjs.ConfigType, dayjs.ConfigType] +} + +/** 交易状况统计 Response VO */ +export interface TradeTrendSummaryRespVO { + time: string + turnover: number + orderPayPrice: number + rechargePrice: number + expensePrice: number + balancePrice: number + brokerageSettlementPrice: number + orderRefundPrice: number +} + +// 查询交易统计 +export const getTradeStatisticsSummary = () => { + return request.get>({ + url: '/statistics/trade/summary' + }) +} + +// 获得交易状况统计 +export const getTradeTrendSummary = (params: TradeTrendReqVO) => { + return request.get>({ + url: '/statistics/trade/trend/summary', + params: formatDateParam(params) + }) +} + +// 获得交易状况明细 +export const getTradeTrendList = (params: TradeTrendReqVO) => { + return request.get({ + url: '/statistics/trade/trend/list', + params: formatDateParam(params) + }) +} + +// 导出交易状况明细 +export const exportTradeTrend = (params: TradeTrendReqVO) => { + return request.download({ + url: '/statistics/trade/trend/export-excel', + params: formatDateParam(params) + }) +} + +/** 时间参数需要格式化, 确保接口能识别 */ +const formatDateParam = (params: TradeTrendReqVO) => { + return { times: [formatDate(params.times[0]), formatDate(params.times[1])] } as TradeTrendReqVO +} diff --git a/src/components/CountTo/src/CountTo.vue b/src/components/CountTo/src/CountTo.vue index 1b1131a0..7a19bec7 100644 --- a/src/components/CountTo/src/CountTo.vue +++ b/src/components/CountTo/src/CountTo.vue @@ -11,21 +11,21 @@ const { getPrefixCls } = useDesign() const prefixCls = getPrefixCls('count-to') const props = defineProps({ - startVal: propTypes.number.def(0), - endVal: propTypes.number.def(2021), - duration: propTypes.number.def(3000), - autoplay: propTypes.bool.def(true), - decimals: propTypes.number.validate((value: number) => value >= 0).def(0), - decimal: propTypes.string.def('.'), - separator: propTypes.string.def(','), - prefix: propTypes.string.def(''), - suffix: propTypes.string.def(''), - useEasing: propTypes.bool.def(true), + startVal: propTypes.number.def(0), // 开始播放值 + endVal: propTypes.number.def(2021), // 最终值 + duration: propTypes.number.def(3000), // 动画时长 + autoplay: propTypes.bool.def(true), // 是否自动播放动画, 默认播放 + decimals: propTypes.number.validate((value: number) => value >= 0).def(0), // 显示的小数位数, 默认不显示小数 + decimal: propTypes.string.def('.'), // 小数分隔符号, 默认为点 + separator: propTypes.string.def(','), // 数字每三位的分隔符, 默认为逗号 + prefix: propTypes.string.def(''), // 前缀, 数值前面显示的内容 + suffix: propTypes.string.def(''), // 后缀, 数值后面显示的内容 + useEasing: propTypes.bool.def(true), // 是否使用缓动效果, 默认启用 easingFn: { type: Function as PropType<(t: number, b: number, c: number, d: number) => number>, default(t: number, b: number, c: number, d: number) { return (c * (-Math.pow(2, (-10 * t) / d) + 1) * 1024) / 1023 + b - } + } // 缓动函数 } }) diff --git a/src/layout/components/useRenderLayout.tsx b/src/layout/components/useRenderLayout.tsx index 46a1e60e..1110cd86 100644 --- a/src/layout/components/useRenderLayout.tsx +++ b/src/layout/components/useRenderLayout.tsx @@ -107,7 +107,7 @@ export const useRenderLayout = () => { > {tagsView.value ? ( - + ) : undefined} @@ -121,13 +121,13 @@ export const useRenderLayout = () => { const renderTopLeft = () => { return ( <> -
+
{logo.value ? : undefined}
-
- +
+
{ ]} > {logo.value ? : undefined} - +
{ const renderCutMenu = () => { return ( <> -
+
{logo.value ? : undefined}
-
+
+
+
+ {{ title }} + + + +
+
+ +
+
+ 环比 + + {{ Math.abs(toNumber(percent)) }}% + + +
+
+ + + diff --git a/src/views/statistics/trade/components/TradeTrendValue.vue b/src/views/statistics/trade/components/TradeTrendValue.vue new file mode 100644 index 00000000..e1e2e4fe --- /dev/null +++ b/src/views/statistics/trade/components/TradeTrendValue.vue @@ -0,0 +1,54 @@ + + + diff --git a/src/views/statistics/trade/index.vue b/src/views/statistics/trade/index.vue new file mode 100644 index 00000000..c6af0f5f --- /dev/null +++ b/src/views/statistics/trade/index.vue @@ -0,0 +1,428 @@ + + +