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
c3cad3f3
authored
Nov 24, 2023
by
owen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商城:修复会员统计时间范围选择昨天时, 会强制查询两天的问题
parent
253401ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
src/components/ShortcutDateRangePicker/index.vue
+0
-5
src/utils/formatTime.ts
+4
-1
src/views/mall/statistics/trade/index.vue
+9
-0
No files found.
src/components/ShortcutDateRangePicker/index.vue
View file @
c3cad3f3
...
...
@@ -74,11 +74,6 @@ const emits = defineEmits<{
}
>
()
/** 触发时间范围选中事件 */
const
emitDateRangePicker
=
async
()
=>
{
// 开始与截止在同一天的, 折线图出不来, 需要延长一天
if
(
DateUtil
.
isSameDay
(
times
.
value
[
0
],
times
.
value
[
1
]))
{
// 前天
times
.
value
[
0
]
=
DateUtil
.
formatDate
(
dayjs
(
times
.
value
[
0
]).
subtract
(
1
,
'd'
))
}
emits
(
'change'
,
times
.
value
)
}
...
...
src/utils/formatTime.ts
View file @
c3cad3f3
...
...
@@ -335,5 +335,8 @@ export function getDateRange(
beginDate
:
dayjs
.
ConfigType
,
endDate
:
dayjs
.
ConfigType
):
[
string
,
string
]
{
return
[
dayjs
(
beginDate
).
startOf
(
'd'
).
toString
(),
dayjs
(
endDate
).
endOf
(
'd'
).
toString
()]
return
[
dayjs
(
beginDate
).
startOf
(
'd'
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
dayjs
(
endDate
).
endOf
(
'd'
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
]
}
src/views/mall/statistics/trade/index.vue
View file @
c3cad3f3
...
...
@@ -219,6 +219,8 @@ import { TradeSummaryRespVO, TradeTrendSummaryRespVO } from '@/api/mall/statisti
import
{
calculateRelativeRate
,
fenToYuan
}
from
'@/utils'
import
download
from
'@/utils/download'
import
{
CardTitle
}
from
'@/components/Card'
import
*
as
DateUtil
from
'@/utils/formatTime'
import
dayjs
from
'dayjs'
/** 交易统计 */
defineOptions
({
name
:
'TradeStatistics'
})
...
...
@@ -289,6 +291,13 @@ const lineChartOptions = reactive<EChartsOption>({
/** 处理交易状况查询 */
const
getTradeTrendData
=
async
()
=>
{
trendLoading
.
value
=
true
// 1. 处理时间: 开始与截止在同一天的, 折线图出不来, 需要延长一天
const
times
=
shortcutDateRangePicker
.
value
.
times
if
(
DateUtil
.
isSameDay
(
times
[
0
],
times
[
1
]))
{
// 前天
times
[
0
]
=
DateUtil
.
formatDate
(
dayjs
(
times
[
0
]).
subtract
(
1
,
'd'
))
}
// 查询数据
await
Promise
.
all
([
getTradeTrendSummary
(),
getTradeStatisticsList
()])
trendLoading
.
value
=
false
}
...
...
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