Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e1a72779
authored
Oct 16, 2023
by
owen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计:Review修改
parent
195309db
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
58 deletions
+53
-58
src/api/mall/statistics/common.ts
+5
-0
src/api/mall/statistics/member.ts
+8
-8
src/api/mall/statistics/trade.ts
+11
-16
src/views/mall/home/index.vue
+4
-6
src/views/mall/statistics/member/components/MemberFunnelCard.vue
+7
-7
src/views/mall/statistics/member/index.vue
+2
-2
src/views/mall/statistics/trade/index.vue
+16
-19
No files found.
src/api/mall/statistics/common.ts
0 → 100644
View file @
e1a72779
/** 数据对照 Response VO */
export
interface
DataComparisonRespVO
<
T
>
{
value
:
T
reference
:
T
}
src/api/mall/statistics/member.ts
View file @
e1a72779
import
request
from
'@/config/axios'
import
dayjs
from
'dayjs'
import
{
TradeStatisticsComparisonRespVO
}
from
'@/api/mall/statistics/trade
'
import
{
DataComparisonRespVO
}
from
'@/api/mall/statistics/common
'
import
{
formatDate
}
from
'@/utils/formatTime'
/** 会员分析 Request VO */
...
...
@@ -10,17 +10,17 @@ export interface MemberAnalyseReqVO {
/** 会员分析 Response VO */
export
interface
MemberAnalyseRespVO
{
visit
o
rCount
:
number
visit
Use
rCount
:
number
orderUserCount
:
number
payUserCount
:
number
atv
:
number
comparison
:
TradeStatistics
ComparisonRespVO
<
MemberAnalyseComparisonRespVO
>
comparison
:
Data
ComparisonRespVO
<
MemberAnalyseComparisonRespVO
>
}
/** 会员分析对照数据 Response VO */
export
interface
MemberAnalyseComparisonRespVO
{
u
serCount
:
number
active
UserCount
:
number
registerU
serCount
:
number
visit
UserCount
:
number
rechargeUserCount
:
number
}
...
...
@@ -29,8 +29,8 @@ export interface MemberAreaStatisticsRespVO {
areaId
:
number
areaName
:
string
userCount
:
number
orderCreateCount
:
number
orderPayCount
:
number
orderCreate
User
Count
:
number
orderPay
User
Count
:
number
orderPayPrice
:
number
}
...
...
@@ -106,7 +106,7 @@ export const getMemberTerminalStatisticsList = () => {
// 获得用户数量量对照
export
const
getUserCountComparison
=
()
=>
{
return
request
.
get
<
TradeStatistics
ComparisonRespVO
<
MemberCountRespVO
>>
({
return
request
.
get
<
Data
ComparisonRespVO
<
MemberCountRespVO
>>
({
url
:
'/statistics/member/user-count-comparison'
})
}
...
...
src/api/mall/statistics/trade.ts
View file @
e1a72779
import
request
from
'@/config/axios'
import
dayjs
from
'dayjs'
import
{
formatDate
}
from
'@/utils/formatTime'
/** 交易统计对照 Response VO */
export
interface
TradeStatisticsComparisonRespVO
<
T
>
{
value
:
T
reference
:
T
}
import
{
DataComparisonRespVO
}
from
'@/api/mall/statistics/common'
/** 交易统计 Response VO */
export
interface
TradeSummaryRespVO
{
...
...
@@ -24,11 +19,11 @@ export interface TradeTrendReqVO {
/** 交易状况统计 Response VO */
export
interface
TradeTrendSummaryRespVO
{
time
:
string
turnover
:
number
turnover
Price
:
number
orderPayPrice
:
number
rechargePrice
:
number
expensePrice
:
number
balance
Price
:
number
orderWalletPay
Price
:
number
brokerageSettlementPrice
:
number
orderRefundPrice
:
number
}
...
...
@@ -65,31 +60,31 @@ export interface TradeOrderTrendRespVO {
// 查询交易统计
export
const
getTradeStatisticsSummary
=
()
=>
{
return
request
.
get
<
TradeStatistics
ComparisonRespVO
<
TradeSummaryRespVO
>>
({
return
request
.
get
<
Data
ComparisonRespVO
<
TradeSummaryRespVO
>>
({
url
:
'/statistics/trade/summary'
})
}
// 获得交易状况统计
export
const
getTradeTrendSummary
=
(
params
:
TradeTrendReqVO
)
=>
{
return
request
.
get
<
TradeStatistics
ComparisonRespVO
<
TradeTrendSummaryRespVO
>>
({
return
request
.
get
<
Data
ComparisonRespVO
<
TradeTrendSummaryRespVO
>>
({
url
:
'/statistics/trade/trend/summary'
,
params
:
formatDateParam
(
params
)
})
}
// 获得交易状况明细
export
const
getTrade
Trend
List
=
(
params
:
TradeTrendReqVO
)
=>
{
export
const
getTrade
Statistics
List
=
(
params
:
TradeTrendReqVO
)
=>
{
return
request
.
get
<
TradeTrendSummaryRespVO
[]
>
({
url
:
'/statistics/trade/
trend/
list'
,
url
:
'/statistics/trade/list'
,
params
:
formatDateParam
(
params
)
})
}
// 导出交易状况明细
export
const
exportTrade
Trend
=
(
params
:
TradeTrendReqVO
)
=>
{
export
const
exportTrade
StatisticsExcel
=
(
params
:
TradeTrendReqVO
)
=>
{
return
request
.
download
({
url
:
'/statistics/trade/
trend/
export-excel'
,
url
:
'/statistics/trade/export-excel'
,
params
:
formatDateParam
(
params
)
})
}
...
...
@@ -101,7 +96,7 @@ export const getOrderCount = async () => {
// 获得交易订单数量对照
export
const
getOrderComparison
=
async
()
=>
{
return
await
request
.
get
<
TradeStatistics
ComparisonRespVO
<
TradeOrderSummaryRespVO
>>
({
return
await
request
.
get
<
Data
ComparisonRespVO
<
TradeOrderSummaryRespVO
>>
({
url
:
`/statistics/trade/order-comparison`
})
}
...
...
@@ -112,7 +107,7 @@ export const getOrderCountTrendComparison = (
beginTime
:
dayjs
.
ConfigType
,
endTime
:
dayjs
.
ConfigType
)
=>
{
return
request
.
get
<
TradeStatistics
ComparisonRespVO
<
TradeOrderTrendRespVO
>
[]
>
({
return
request
.
get
<
Data
ComparisonRespVO
<
TradeOrderTrendRespVO
>
[]
>
({
url
:
'/statistics/trade/order-count-trend'
,
params
:
{
type
,
beginTime
:
formatDate
(
beginTime
),
endTime
:
formatDate
(
endTime
)
}
})
...
...
src/views/mall/home/index.vue
View file @
e1a72779
...
...
@@ -66,10 +66,8 @@
<
script
lang=
"ts"
setup
>
import
*
as
TradeStatisticsApi
from
'@/api/mall/statistics/trade'
import
*
as
MemberStatisticsApi
from
'@/api/mall/statistics/member'
import
{
TradeOrderSummaryRespVO
,
TradeStatisticsComparisonRespVO
}
from
'@/api/mall/statistics/trade'
import
{
DataComparisonRespVO
}
from
'@/api/mall/statistics/common'
import
{
TradeOrderSummaryRespVO
}
from
'@/api/mall/statistics/trade'
import
{
MemberCountRespVO
}
from
'@/api/mall/statistics/member'
import
{
fenToYuan
}
from
'@/utils'
import
ComparisonCard
from
'./components/ComparisonCard.vue'
...
...
@@ -84,8 +82,8 @@ import MemberFunnelCard from '@/views/mall/statistics/member/components/MemberFu
defineOptions
({
name
:
'MallHome'
})
const
loading
=
ref
(
true
)
// 加载中
const
orderComparison
=
ref
<
TradeStatistics
ComparisonRespVO
<
TradeOrderSummaryRespVO
>>
()
// 交易对照数据
const
userComparison
=
ref
<
TradeStatistics
ComparisonRespVO
<
MemberCountRespVO
>>
()
// 用户对照数据
const
orderComparison
=
ref
<
Data
ComparisonRespVO
<
TradeOrderSummaryRespVO
>>
()
// 交易对照数据
const
userComparison
=
ref
<
Data
ComparisonRespVO
<
MemberCountRespVO
>>
()
// 用户对照数据
/** 查询交易对照卡片数据 */
const
getOrderComparison
=
async
()
=>
{
...
...
src/views/mall/statistics/member/components/MemberFunnelCard.vue
View file @
e1a72779
...
...
@@ -12,13 +12,13 @@
<div
class=
"h-full w-75% bg-blue-50 <lg:w-35% <xl:w-55%"
>
<div
class=
"ml-15 h-full flex flex-col justify-center"
>
<div
class=
"font-bold"
>
注册用户数量:{{ analyseData?.comparison?.value?.
u
serCount || 0 }}
注册用户数量:{{ analyseData?.comparison?.value?.
registerU
serCount || 0 }}
</div>
<div
class=
"mt-2 text-3.5"
>
环比增长率:{{
calculateRelativeRate(
analyseData?.comparison?.value?.
u
serCount,
analyseData?.comparison?.reference?.
u
serCount
analyseData?.comparison?.value?.
registerU
serCount,
analyseData?.comparison?.reference?.
registerU
serCount
)
}}%
</div>
...
...
@@ -27,7 +27,7 @@
<div
class=
"trapezoid1 ml--38.5 mt-1.5 h-full w-77 flex flex-col items-center justify-center bg-blue-5 text-3.5 text-white"
>
<span
class=
"text-6 font-bold"
>
{{ analyseData?.visit
o
rCount || 0 }}
</span>
<span
class=
"text-6 font-bold"
>
{{ analyseData?.visit
Use
rCount || 0 }}
</span>
<span>
访客
</span>
</div>
</div>
...
...
@@ -35,13 +35,13 @@
<div
class=
"h-full w-75% flex bg-cyan-50 <lg:w-35% <xl:w-55%"
>
<div
class=
"ml-15 h-full flex flex-col justify-center"
>
<div
class=
"font-bold"
>
活跃用户数量:{{ analyseData?.comparison?.value?.
active
UserCount || 0 }}
活跃用户数量:{{ analyseData?.comparison?.value?.
visit
UserCount || 0 }}
</div>
<div
class=
"mt-2 text-3.5"
>
环比增长率:{{
calculateRelativeRate(
analyseData?.comparison?.value?.
active
UserCount,
analyseData?.comparison?.reference?.
active
UserCount
analyseData?.comparison?.value?.
visit
UserCount,
analyseData?.comparison?.reference?.
visit
UserCount
)
}}%
</div>
...
...
src/views/mall/statistics/member/index.vue
View file @
e1a72779
...
...
@@ -82,14 +82,14 @@
/>
<el-table-column
label=
"订单创建数量"
prop=
"orderCreateCount"
prop=
"orderCreate
User
Count"
align=
"center"
min-width=
"135"
sortable
/>
<el-table-column
label=
"订单支付数量"
prop=
"orderPayCount"
prop=
"orderPay
User
Count"
align=
"center"
min-width=
"135"
sortable
...
...
src/views/mall/statistics/trade/index.vue
View file @
e1a72779
...
...
@@ -84,11 +84,11 @@
icon-bg-color=
"text-blue-500"
prefix=
"¥"
:decimals=
"2"
:value=
"fenToYuan(trendSummary?.value?.turnover || 0)"
:value=
"fenToYuan(trendSummary?.value?.turnover
Price
|| 0)"
:percent=
"
calculateRelativeRate(
trendSummary?.value?.turnover,
trendSummary?.reference?.turnover
trendSummary?.value?.turnover
Price
,
trendSummary?.reference?.turnover
Price
)
"
/>
...
...
@@ -156,11 +156,11 @@
icon-bg-color=
"text-cyan-500"
prefix=
"¥"
:decimals=
"2"
:value=
"fenToYuan(trendSummary?.value?.
balance
Price || 0)"
:value=
"fenToYuan(trendSummary?.value?.
orderWalletPay
Price || 0)"
:percent=
"
calculateRelativeRate(
trendSummary?.value?.
balance
Price,
trendSummary?.reference?.
balance
Price
trendSummary?.value?.
orderWalletPay
Price,
trendSummary?.reference?.
orderWalletPay
Price
)
"
/>
...
...
@@ -214,11 +214,8 @@ import * as TradeStatisticsApi from '@/api/mall/statistics/trade'
import
TradeStatisticValue
from
'./components/TradeStatisticValue.vue'
import
TradeTrendValue
from
'./components/TradeTrendValue.vue'
import
{
EChartsOption
}
from
'echarts'
import
{
TradeStatisticsComparisonRespVO
,
TradeSummaryRespVO
,
TradeTrendSummaryRespVO
}
from
'@/api/mall/statistics/trade'
import
{
DataComparisonRespVO
}
from
'@/api/mall/statistics/common'
import
{
TradeSummaryRespVO
,
TradeTrendSummaryRespVO
}
from
'@/api/mall/statistics/trade'
import
{
calculateRelativeRate
,
fenToYuan
}
from
'@/utils'
import
download
from
'@/utils/download'
import
{
CardTitle
}
from
'@/components/Card'
...
...
@@ -231,14 +228,14 @@ const message = useMessage() // 消息弹窗
const
loading
=
ref
(
true
)
// 加载中
const
trendLoading
=
ref
(
true
)
// 交易状态加载中
const
exportLoading
=
ref
(
false
)
// 导出的加载中
const
summary
=
ref
<
TradeStatistics
ComparisonRespVO
<
TradeSummaryRespVO
>>
()
// 交易统计数据
const
trendSummary
=
ref
<
TradeStatistics
ComparisonRespVO
<
TradeTrendSummaryRespVO
>>
()
// 交易状况统计数据
const
summary
=
ref
<
Data
ComparisonRespVO
<
TradeSummaryRespVO
>>
()
// 交易统计数据
const
trendSummary
=
ref
<
Data
ComparisonRespVO
<
TradeTrendSummaryRespVO
>>
()
// 交易状况统计数据
const
shortcutDateRangePicker
=
ref
()
/** 折线图配置 */
const
lineChartOptions
=
reactive
<
EChartsOption
>
({
dataset
:
{
dimensions
:
[
'date'
,
'turnover'
,
'orderPayPrice'
,
'rechargePrice'
,
'expensePrice'
],
dimensions
:
[
'date'
,
'turnover
Price
'
,
'orderPayPrice'
,
'rechargePrice'
,
'expensePrice'
],
source
:
[]
},
grid
:
{
...
...
@@ -293,7 +290,7 @@ const lineChartOptions = reactive<EChartsOption>({
/** 处理交易状况查询 */
const
getTradeTrendData
=
async
()
=>
{
trendLoading
.
value
=
true
await
Promise
.
all
([
getTradeTrendSummary
(),
getTrade
Trend
List
()])
await
Promise
.
all
([
getTradeTrendSummary
(),
getTrade
Statistics
List
()])
trendLoading
.
value
=
false
}
...
...
@@ -309,13 +306,13 @@ const getTradeTrendSummary = async () => {
}
/** 查询交易状况数据列表 */
const
getTrade
Trend
List
=
async
()
=>
{
const
getTrade
Statistics
List
=
async
()
=>
{
// 查询数据
const
times
=
shortcutDateRangePicker
.
value
.
times
const
list
=
await
TradeStatisticsApi
.
getTrade
Trend
List
({
times
})
const
list
=
await
TradeStatisticsApi
.
getTrade
Statistics
List
({
times
})
// 处理数据
for
(
let
item
of
list
)
{
item
.
turnover
=
fenToYuan
(
item
.
turnover
)
item
.
turnover
Price
=
fenToYuan
(
item
.
turnoverPrice
)
item
.
orderPayPrice
=
fenToYuan
(
item
.
orderPayPrice
)
item
.
rechargePrice
=
fenToYuan
(
item
.
rechargePrice
)
item
.
expensePrice
=
fenToYuan
(
item
.
expensePrice
)
...
...
@@ -334,7 +331,7 @@ const handleExport = async () => {
// 发起导出
exportLoading
.
value
=
true
const
times
=
shortcutDateRangePicker
.
value
.
times
const
data
=
await
TradeStatisticsApi
.
exportTrade
Trend
({
times
})
const
data
=
await
TradeStatisticsApi
.
exportTrade
StatisticsExcel
({
times
})
download
.
excel
(
data
,
'交易状况.xls'
)
}
catch
{
}
finally
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment