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
request
from
'@/config/axios'
import
dayjs
from
'dayjs'
import
dayjs
from
'dayjs'
import
{
TradeStatisticsComparisonRespVO
}
from
'@/api/mall/statistics/trade
'
import
{
DataComparisonRespVO
}
from
'@/api/mall/statistics/common
'
import
{
formatDate
}
from
'@/utils/formatTime'
import
{
formatDate
}
from
'@/utils/formatTime'
/** 会员分析 Request VO */
/** 会员分析 Request VO */
...
@@ -10,17 +10,17 @@ export interface MemberAnalyseReqVO {
...
@@ -10,17 +10,17 @@ export interface MemberAnalyseReqVO {
/** 会员分析 Response VO */
/** 会员分析 Response VO */
export
interface
MemberAnalyseRespVO
{
export
interface
MemberAnalyseRespVO
{
visit
o
rCount
:
number
visit
Use
rCount
:
number
orderUserCount
:
number
orderUserCount
:
number
payUserCount
:
number
payUserCount
:
number
atv
:
number
atv
:
number
comparison
:
TradeStatistics
ComparisonRespVO
<
MemberAnalyseComparisonRespVO
>
comparison
:
Data
ComparisonRespVO
<
MemberAnalyseComparisonRespVO
>
}
}
/** 会员分析对照数据 Response VO */
/** 会员分析对照数据 Response VO */
export
interface
MemberAnalyseComparisonRespVO
{
export
interface
MemberAnalyseComparisonRespVO
{
u
serCount
:
number
registerU
serCount
:
number
active
UserCount
:
number
visit
UserCount
:
number
rechargeUserCount
:
number
rechargeUserCount
:
number
}
}
...
@@ -29,8 +29,8 @@ export interface MemberAreaStatisticsRespVO {
...
@@ -29,8 +29,8 @@ export interface MemberAreaStatisticsRespVO {
areaId
:
number
areaId
:
number
areaName
:
string
areaName
:
string
userCount
:
number
userCount
:
number
orderCreateCount
:
number
orderCreate
User
Count
:
number
orderPayCount
:
number
orderPay
User
Count
:
number
orderPayPrice
:
number
orderPayPrice
:
number
}
}
...
@@ -106,7 +106,7 @@ export const getMemberTerminalStatisticsList = () => {
...
@@ -106,7 +106,7 @@ export const getMemberTerminalStatisticsList = () => {
// 获得用户数量量对照
// 获得用户数量量对照
export
const
getUserCountComparison
=
()
=>
{
export
const
getUserCountComparison
=
()
=>
{
return
request
.
get
<
TradeStatistics
ComparisonRespVO
<
MemberCountRespVO
>>
({
return
request
.
get
<
Data
ComparisonRespVO
<
MemberCountRespVO
>>
({
url
:
'/statistics/member/user-count-comparison'
url
:
'/statistics/member/user-count-comparison'
})
})
}
}
...
...
src/api/mall/statistics/trade.ts
View file @
e1a72779
import
request
from
'@/config/axios'
import
request
from
'@/config/axios'
import
dayjs
from
'dayjs'
import
dayjs
from
'dayjs'
import
{
formatDate
}
from
'@/utils/formatTime'
import
{
formatDate
}
from
'@/utils/formatTime'
import
{
DataComparisonRespVO
}
from
'@/api/mall/statistics/common'
/** 交易统计对照 Response VO */
export
interface
TradeStatisticsComparisonRespVO
<
T
>
{
value
:
T
reference
:
T
}
/** 交易统计 Response VO */
/** 交易统计 Response VO */
export
interface
TradeSummaryRespVO
{
export
interface
TradeSummaryRespVO
{
...
@@ -24,11 +19,11 @@ export interface TradeTrendReqVO {
...
@@ -24,11 +19,11 @@ export interface TradeTrendReqVO {
/** 交易状况统计 Response VO */
/** 交易状况统计 Response VO */
export
interface
TradeTrendSummaryRespVO
{
export
interface
TradeTrendSummaryRespVO
{
time
:
string
time
:
string
turnover
:
number
turnover
Price
:
number
orderPayPrice
:
number
orderPayPrice
:
number
rechargePrice
:
number
rechargePrice
:
number
expensePrice
:
number
expensePrice
:
number
balance
Price
:
number
orderWalletPay
Price
:
number
brokerageSettlementPrice
:
number
brokerageSettlementPrice
:
number
orderRefundPrice
:
number
orderRefundPrice
:
number
}
}
...
@@ -65,31 +60,31 @@ export interface TradeOrderTrendRespVO {
...
@@ -65,31 +60,31 @@ export interface TradeOrderTrendRespVO {
// 查询交易统计
// 查询交易统计
export
const
getTradeStatisticsSummary
=
()
=>
{
export
const
getTradeStatisticsSummary
=
()
=>
{
return
request
.
get
<
TradeStatistics
ComparisonRespVO
<
TradeSummaryRespVO
>>
({
return
request
.
get
<
Data
ComparisonRespVO
<
TradeSummaryRespVO
>>
({
url
:
'/statistics/trade/summary'
url
:
'/statistics/trade/summary'
})
})
}
}
// 获得交易状况统计
// 获得交易状况统计
export
const
getTradeTrendSummary
=
(
params
:
TradeTrendReqVO
)
=>
{
export
const
getTradeTrendSummary
=
(
params
:
TradeTrendReqVO
)
=>
{
return
request
.
get
<
TradeStatistics
ComparisonRespVO
<
TradeTrendSummaryRespVO
>>
({
return
request
.
get
<
Data
ComparisonRespVO
<
TradeTrendSummaryRespVO
>>
({
url
:
'/statistics/trade/trend/summary'
,
url
:
'/statistics/trade/trend/summary'
,
params
:
formatDateParam
(
params
)
params
:
formatDateParam
(
params
)
})
})
}
}
// 获得交易状况明细
// 获得交易状况明细
export
const
getTrade
Trend
List
=
(
params
:
TradeTrendReqVO
)
=>
{
export
const
getTrade
Statistics
List
=
(
params
:
TradeTrendReqVO
)
=>
{
return
request
.
get
<
TradeTrendSummaryRespVO
[]
>
({
return
request
.
get
<
TradeTrendSummaryRespVO
[]
>
({
url
:
'/statistics/trade/
trend/
list'
,
url
:
'/statistics/trade/list'
,
params
:
formatDateParam
(
params
)
params
:
formatDateParam
(
params
)
})
})
}
}
// 导出交易状况明细
// 导出交易状况明细
export
const
exportTrade
Trend
=
(
params
:
TradeTrendReqVO
)
=>
{
export
const
exportTrade
StatisticsExcel
=
(
params
:
TradeTrendReqVO
)
=>
{
return
request
.
download
({
return
request
.
download
({
url
:
'/statistics/trade/
trend/
export-excel'
,
url
:
'/statistics/trade/export-excel'
,
params
:
formatDateParam
(
params
)
params
:
formatDateParam
(
params
)
})
})
}
}
...
@@ -101,7 +96,7 @@ export const getOrderCount = async () => {
...
@@ -101,7 +96,7 @@ export const getOrderCount = async () => {
// 获得交易订单数量对照
// 获得交易订单数量对照
export
const
getOrderComparison
=
async
()
=>
{
export
const
getOrderComparison
=
async
()
=>
{
return
await
request
.
get
<
TradeStatistics
ComparisonRespVO
<
TradeOrderSummaryRespVO
>>
({
return
await
request
.
get
<
Data
ComparisonRespVO
<
TradeOrderSummaryRespVO
>>
({
url
:
`/statistics/trade/order-comparison`
url
:
`/statistics/trade/order-comparison`
})
})
}
}
...
@@ -112,7 +107,7 @@ export const getOrderCountTrendComparison = (
...
@@ -112,7 +107,7 @@ export const getOrderCountTrendComparison = (
beginTime
:
dayjs
.
ConfigType
,
beginTime
:
dayjs
.
ConfigType
,
endTime
:
dayjs
.
ConfigType
endTime
:
dayjs
.
ConfigType
)
=>
{
)
=>
{
return
request
.
get
<
TradeStatistics
ComparisonRespVO
<
TradeOrderTrendRespVO
>
[]
>
({
return
request
.
get
<
Data
ComparisonRespVO
<
TradeOrderTrendRespVO
>
[]
>
({
url
:
'/statistics/trade/order-count-trend'
,
url
:
'/statistics/trade/order-count-trend'
,
params
:
{
type
,
beginTime
:
formatDate
(
beginTime
),
endTime
:
formatDate
(
endTime
)
}
params
:
{
type
,
beginTime
:
formatDate
(
beginTime
),
endTime
:
formatDate
(
endTime
)
}
})
})
...
...
src/views/mall/home/index.vue
View file @
e1a72779
...
@@ -66,10 +66,8 @@
...
@@ -66,10 +66,8 @@
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
*
as
TradeStatisticsApi
from
'@/api/mall/statistics/trade'
import
*
as
TradeStatisticsApi
from
'@/api/mall/statistics/trade'
import
*
as
MemberStatisticsApi
from
'@/api/mall/statistics/member'
import
*
as
MemberStatisticsApi
from
'@/api/mall/statistics/member'
import
{
import
{
DataComparisonRespVO
}
from
'@/api/mall/statistics/common'
TradeOrderSummaryRespVO
,
import
{
TradeOrderSummaryRespVO
}
from
'@/api/mall/statistics/trade'
TradeStatisticsComparisonRespVO
}
from
'@/api/mall/statistics/trade'
import
{
MemberCountRespVO
}
from
'@/api/mall/statistics/member'
import
{
MemberCountRespVO
}
from
'@/api/mall/statistics/member'
import
{
fenToYuan
}
from
'@/utils'
import
{
fenToYuan
}
from
'@/utils'
import
ComparisonCard
from
'./components/ComparisonCard.vue'
import
ComparisonCard
from
'./components/ComparisonCard.vue'
...
@@ -84,8 +82,8 @@ import MemberFunnelCard from '@/views/mall/statistics/member/components/MemberFu
...
@@ -84,8 +82,8 @@ import MemberFunnelCard from '@/views/mall/statistics/member/components/MemberFu
defineOptions
({
name
:
'MallHome'
})
defineOptions
({
name
:
'MallHome'
})
const
loading
=
ref
(
true
)
// 加载中
const
loading
=
ref
(
true
)
// 加载中
const
orderComparison
=
ref
<
TradeStatistics
ComparisonRespVO
<
TradeOrderSummaryRespVO
>>
()
// 交易对照数据
const
orderComparison
=
ref
<
Data
ComparisonRespVO
<
TradeOrderSummaryRespVO
>>
()
// 交易对照数据
const
userComparison
=
ref
<
TradeStatistics
ComparisonRespVO
<
MemberCountRespVO
>>
()
// 用户对照数据
const
userComparison
=
ref
<
Data
ComparisonRespVO
<
MemberCountRespVO
>>
()
// 用户对照数据
/** 查询交易对照卡片数据 */
/** 查询交易对照卡片数据 */
const
getOrderComparison
=
async
()
=>
{
const
getOrderComparison
=
async
()
=>
{
...
...
src/views/mall/statistics/member/components/MemberFunnelCard.vue
View file @
e1a72779
...
@@ -12,13 +12,13 @@
...
@@ -12,13 +12,13 @@
<div
class=
"h-full w-75% bg-blue-50 <lg:w-35% <xl:w-55%"
>
<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=
"ml-15 h-full flex flex-col justify-center"
>
<div
class=
"font-bold"
>
<div
class=
"font-bold"
>
注册用户数量:{{ analyseData?.comparison?.value?.
u
serCount || 0 }}
注册用户数量:{{ analyseData?.comparison?.value?.
registerU
serCount || 0 }}
</div>
</div>
<div
class=
"mt-2 text-3.5"
>
<div
class=
"mt-2 text-3.5"
>
环比增长率:{{
环比增长率:{{
calculateRelativeRate(
calculateRelativeRate(
analyseData?.comparison?.value?.
u
serCount,
analyseData?.comparison?.value?.
registerU
serCount,
analyseData?.comparison?.reference?.
u
serCount
analyseData?.comparison?.reference?.
registerU
serCount
)
)
}}%
}}%
</div>
</div>
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<div
<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"
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>
<span>
访客
</span>
</div>
</div>
</div>
</div>
...
@@ -35,13 +35,13 @@
...
@@ -35,13 +35,13 @@
<div
class=
"h-full w-75% flex bg-cyan-50 <lg:w-35% <xl:w-55%"
>
<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=
"ml-15 h-full flex flex-col justify-center"
>
<div
class=
"font-bold"
>
<div
class=
"font-bold"
>
活跃用户数量:{{ analyseData?.comparison?.value?.
active
UserCount || 0 }}
活跃用户数量:{{ analyseData?.comparison?.value?.
visit
UserCount || 0 }}
</div>
</div>
<div
class=
"mt-2 text-3.5"
>
<div
class=
"mt-2 text-3.5"
>
环比增长率:{{
环比增长率:{{
calculateRelativeRate(
calculateRelativeRate(
analyseData?.comparison?.value?.
active
UserCount,
analyseData?.comparison?.value?.
visit
UserCount,
analyseData?.comparison?.reference?.
active
UserCount
analyseData?.comparison?.reference?.
visit
UserCount
)
)
}}%
}}%
</div>
</div>
...
...
src/views/mall/statistics/member/index.vue
View file @
e1a72779
...
@@ -82,14 +82,14 @@
...
@@ -82,14 +82,14 @@
/>
/>
<el-table-column
<el-table-column
label=
"订单创建数量"
label=
"订单创建数量"
prop=
"orderCreateCount"
prop=
"orderCreate
User
Count"
align=
"center"
align=
"center"
min-width=
"135"
min-width=
"135"
sortable
sortable
/>
/>
<el-table-column
<el-table-column
label=
"订单支付数量"
label=
"订单支付数量"
prop=
"orderPayCount"
prop=
"orderPay
User
Count"
align=
"center"
align=
"center"
min-width=
"135"
min-width=
"135"
sortable
sortable
...
...
src/views/mall/statistics/trade/index.vue
View file @
e1a72779
...
@@ -84,11 +84,11 @@
...
@@ -84,11 +84,11 @@
icon-bg-color=
"text-blue-500"
icon-bg-color=
"text-blue-500"
prefix=
"¥"
prefix=
"¥"
:decimals=
"2"
:decimals=
"2"
:value=
"fenToYuan(trendSummary?.value?.turnover || 0)"
:value=
"fenToYuan(trendSummary?.value?.turnover
Price
|| 0)"
:percent=
"
:percent=
"
calculateRelativeRate(
calculateRelativeRate(
trendSummary?.value?.turnover,
trendSummary?.value?.turnover
Price
,
trendSummary?.reference?.turnover
trendSummary?.reference?.turnover
Price
)
)
"
"
/>
/>
...
@@ -156,11 +156,11 @@
...
@@ -156,11 +156,11 @@
icon-bg-color=
"text-cyan-500"
icon-bg-color=
"text-cyan-500"
prefix=
"¥"
prefix=
"¥"
:decimals=
"2"
:decimals=
"2"
:value=
"fenToYuan(trendSummary?.value?.
balance
Price || 0)"
:value=
"fenToYuan(trendSummary?.value?.
orderWalletPay
Price || 0)"
:percent=
"
:percent=
"
calculateRelativeRate(
calculateRelativeRate(
trendSummary?.value?.
balance
Price,
trendSummary?.value?.
orderWalletPay
Price,
trendSummary?.reference?.
balance
Price
trendSummary?.reference?.
orderWalletPay
Price
)
)
"
"
/>
/>
...
@@ -214,11 +214,8 @@ import * as TradeStatisticsApi from '@/api/mall/statistics/trade'
...
@@ -214,11 +214,8 @@ import * as TradeStatisticsApi from '@/api/mall/statistics/trade'
import
TradeStatisticValue
from
'./components/TradeStatisticValue.vue'
import
TradeStatisticValue
from
'./components/TradeStatisticValue.vue'
import
TradeTrendValue
from
'./components/TradeTrendValue.vue'
import
TradeTrendValue
from
'./components/TradeTrendValue.vue'
import
{
EChartsOption
}
from
'echarts'
import
{
EChartsOption
}
from
'echarts'
import
{
import
{
DataComparisonRespVO
}
from
'@/api/mall/statistics/common'
TradeStatisticsComparisonRespVO
,
import
{
TradeSummaryRespVO
,
TradeTrendSummaryRespVO
}
from
'@/api/mall/statistics/trade'
TradeSummaryRespVO
,
TradeTrendSummaryRespVO
}
from
'@/api/mall/statistics/trade'
import
{
calculateRelativeRate
,
fenToYuan
}
from
'@/utils'
import
{
calculateRelativeRate
,
fenToYuan
}
from
'@/utils'
import
download
from
'@/utils/download'
import
download
from
'@/utils/download'
import
{
CardTitle
}
from
'@/components/Card'
import
{
CardTitle
}
from
'@/components/Card'
...
@@ -231,14 +228,14 @@ const message = useMessage() // 消息弹窗
...
@@ -231,14 +228,14 @@ const message = useMessage() // 消息弹窗
const
loading
=
ref
(
true
)
// 加载中
const
loading
=
ref
(
true
)
// 加载中
const
trendLoading
=
ref
(
true
)
// 交易状态加载中
const
trendLoading
=
ref
(
true
)
// 交易状态加载中
const
exportLoading
=
ref
(
false
)
// 导出的加载中
const
exportLoading
=
ref
(
false
)
// 导出的加载中
const
summary
=
ref
<
TradeStatistics
ComparisonRespVO
<
TradeSummaryRespVO
>>
()
// 交易统计数据
const
summary
=
ref
<
Data
ComparisonRespVO
<
TradeSummaryRespVO
>>
()
// 交易统计数据
const
trendSummary
=
ref
<
TradeStatistics
ComparisonRespVO
<
TradeTrendSummaryRespVO
>>
()
// 交易状况统计数据
const
trendSummary
=
ref
<
Data
ComparisonRespVO
<
TradeTrendSummaryRespVO
>>
()
// 交易状况统计数据
const
shortcutDateRangePicker
=
ref
()
const
shortcutDateRangePicker
=
ref
()
/** 折线图配置 */
/** 折线图配置 */
const
lineChartOptions
=
reactive
<
EChartsOption
>
({
const
lineChartOptions
=
reactive
<
EChartsOption
>
({
dataset
:
{
dataset
:
{
dimensions
:
[
'date'
,
'turnover'
,
'orderPayPrice'
,
'rechargePrice'
,
'expensePrice'
],
dimensions
:
[
'date'
,
'turnover
Price
'
,
'orderPayPrice'
,
'rechargePrice'
,
'expensePrice'
],
source
:
[]
source
:
[]
},
},
grid
:
{
grid
:
{
...
@@ -293,7 +290,7 @@ const lineChartOptions = reactive<EChartsOption>({
...
@@ -293,7 +290,7 @@ const lineChartOptions = reactive<EChartsOption>({
/** 处理交易状况查询 */
/** 处理交易状况查询 */
const
getTradeTrendData
=
async
()
=>
{
const
getTradeTrendData
=
async
()
=>
{
trendLoading
.
value
=
true
trendLoading
.
value
=
true
await
Promise
.
all
([
getTradeTrendSummary
(),
getTrade
Trend
List
()])
await
Promise
.
all
([
getTradeTrendSummary
(),
getTrade
Statistics
List
()])
trendLoading
.
value
=
false
trendLoading
.
value
=
false
}
}
...
@@ -309,13 +306,13 @@ const getTradeTrendSummary = async () => {
...
@@ -309,13 +306,13 @@ const getTradeTrendSummary = async () => {
}
}
/** 查询交易状况数据列表 */
/** 查询交易状况数据列表 */
const
getTrade
Trend
List
=
async
()
=>
{
const
getTrade
Statistics
List
=
async
()
=>
{
// 查询数据
// 查询数据
const
times
=
shortcutDateRangePicker
.
value
.
times
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
)
{
for
(
let
item
of
list
)
{
item
.
turnover
=
fenToYuan
(
item
.
turnover
)
item
.
turnover
Price
=
fenToYuan
(
item
.
turnoverPrice
)
item
.
orderPayPrice
=
fenToYuan
(
item
.
orderPayPrice
)
item
.
orderPayPrice
=
fenToYuan
(
item
.
orderPayPrice
)
item
.
rechargePrice
=
fenToYuan
(
item
.
rechargePrice
)
item
.
rechargePrice
=
fenToYuan
(
item
.
rechargePrice
)
item
.
expensePrice
=
fenToYuan
(
item
.
expensePrice
)
item
.
expensePrice
=
fenToYuan
(
item
.
expensePrice
)
...
@@ -334,7 +331,7 @@ const handleExport = async () => {
...
@@ -334,7 +331,7 @@ const handleExport = async () => {
// 发起导出
// 发起导出
exportLoading
.
value
=
true
exportLoading
.
value
=
true
const
times
=
shortcutDateRangePicker
.
value
.
times
const
times
=
shortcutDateRangePicker
.
value
.
times
const
data
=
await
TradeStatisticsApi
.
exportTrade
Trend
({
times
})
const
data
=
await
TradeStatisticsApi
.
exportTrade
StatisticsExcel
({
times
})
download
.
excel
(
data
,
'交易状况.xls'
)
download
.
excel
(
data
,
'交易状况.xls'
)
}
catch
{
}
catch
{
}
finally
{
}
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