Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
factory_front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinjianhui
factory_front
Commits
f4412e85
Commit
f4412e85
authored
Dec 31, 2025
by
wusiyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 概览数据优化
parent
dee09f0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
14 deletions
+56
-14
src/views/Dashboard.vue
+56
-14
No files found.
src/views/Dashboard.vue
View file @
f4412e85
...
...
@@ -262,10 +262,10 @@
<el-tooltip
class=
"item"
effect=
"light"
placement=
"bottom-end"
>
<
template
#
content
>
<div
style=
"display: flex; align-items: center; gap: 4px"
>
<div
class=
"up-icon-red"
></div>
<div>
为正向趋势,
</div>
<div
class=
"down-icon-green"
></div>
<div>
为负向趋势
</div>
<div>
为正向趋势
</div>
<div
class=
"up-icon-red"
></div>
<div>
为负向趋势,
</div>
</div>
</
template
>
<div
class=
"card-item"
>
...
...
@@ -420,7 +420,7 @@
<el-tooltip
class=
"item"
effect=
"light"
content=
"所有订单中的异常单总单数"
content=
"所有订单中的异常单总
订单
单数"
placement=
"bottom"
>
<div
class=
"card-icon"
></div>
...
...
@@ -659,6 +659,22 @@ const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
})
.
replace
(
/
\/
/g
,
'-'
)
const
lastWeek
=
new
Date
(
new
Date
().
setDate
(
new
Date
().
getDate
()
-
7
))
.
toLocaleDateString
(
'zh-CN'
,
{
year
:
'numeric'
,
month
:
'2-digit'
,
day
:
'2-digit'
,
})
.
replace
(
/
\/
/g
,
'-'
)
const
lastMonth
=
new
Date
(
new
Date
().
setMonth
(
new
Date
().
getMonth
()
-
1
))
.
toLocaleDateString
(
'zh-CN'
,
{
year
:
'numeric'
,
month
:
'2-digit'
,
day
:
'2-digit'
,
})
.
replace
(
/
\/
/g
,
'-'
)
// 获取统计数据
const
statisticData
=
ref
<
StatisticData
|
null
>
(
null
)
...
...
@@ -987,7 +1003,7 @@ const getStatisticDataApi = async () => {
if
(
!
isEmpty
)
{
updateOrderTrendChart
(
res
.
data
,
0
)
}
updateChart
(
chartInstances
[
0
],
chartConfig1
,
isEmpty
)
updateChart
(
chartInstances
[
0
],
chartConfig1
,
isEmpty
,
chartTimes1
.
value
)
orderChart1Loading
.
value
=
!
(
res
.
data
&&
res
.
data
.
length
>
0
)
}
})
...
...
@@ -1006,7 +1022,13 @@ const getStatisticDataApi = async () => {
if
(
!
isEmpty
)
{
updateShipmentTrendChart
(
res
.
data
,
0
)
}
updateChart
(
chartInstances
[
1
],
chartConfig2
,
isEmpty
,
true
)
updateChart
(
chartInstances
[
1
],
chartConfig2
,
isEmpty
,
chartTimes2
.
value
,
true
,
)
orderChart2Loading
.
value
=
!
(
res
.
data
&&
res
.
data
.
length
>
0
)
}
})
...
...
@@ -1030,6 +1052,8 @@ const getStatisticDataApi = async () => {
chartConfig3
,
isEmpty
,
true
,
chartTimes3
.
value
,
overtimeTooltipFormatter
,
)
orderChart3Loading
.
value
=
!
(
res
.
data
&&
res
.
data
.
length
>
0
)
...
...
@@ -1085,14 +1109,26 @@ const getchartTimes = async (v: string, type: string) => {
if
(
!
isEmpty
)
{
updateOrderTrendChart
(
data
,
v
)
}
updateChart
(
chartInstances
[
0
],
chartConfig1
,
isEmpty
)
updateChart
(
chartInstances
[
0
],
chartConfig1
,
isEmpty
,
false
,
chartTimes1
.
value
,
)
orderChart1Loading
.
value
=
!
(
data
&&
data
.
length
>
0
)
}
else
if
(
type
==
'SHIPMENT_TREND'
)
{
const
isEmpty
=
checkShipmentTrendDataEmpty
(
data
)
if
(
!
isEmpty
)
{
updateShipmentTrendChart
(
data
,
v
)
}
updateChart
(
chartInstances
[
1
],
chartConfig2
,
isEmpty
,
true
)
updateChart
(
chartInstances
[
1
],
chartConfig2
,
isEmpty
,
true
,
chartTimes2
.
value
,
)
orderChart2Loading
.
value
=
!
(
data
&&
data
.
length
>
0
)
}
else
{
const
isEmpty
=
checkOvertimeTrendDataEmpty
(
data
)
...
...
@@ -1104,6 +1140,7 @@ const getchartTimes = async (v: string, type: string) => {
chartConfig3
,
isEmpty
,
true
,
chartTimes3
.
value
,
overtimeTooltipFormatter
,
)
orderChart3Loading
.
value
=
!
(
data
&&
data
.
length
>
0
)
...
...
@@ -1114,11 +1151,15 @@ const getchartTimes = async (v: string, type: string) => {
}
// 根据横坐标数据生成周期提示文字
const
generatePeriodText
=
(
xAxisData
:
string
[]):
string
=>
{
const
startDate
=
xAxisData
[
0
]
const
endDate
=
xAxisData
[
xAxisData
.
length
-
1
]
return
`当前周期(
${
startDate
}
至
${
endDate
}
)暂无订单数据\n\n请在订单流转后等待数据更新查看趋势`
const
generatePeriodText
=
(
timeRange
:
string
):
string
=>
{
if
(
timeRange
===
'0'
)
{
return
`当前周期(
${
yesterday
}
至
${
today
}
)暂无订单数据\n\n请在订单流转后等待数据更新查看趋势`
}
else
if
(
timeRange
===
'1'
)
{
return
`当前周期(
${
lastWeek
}
至
${
today
}
)暂无订单数据\n\n请在订单流转后等待数据更新查看趋势`
}
else
if
(
timeRange
===
'2'
)
{
return
`当前周期(
${
lastMonth
}
至
${
today
}
)暂无订单数据\n\n请在订单流转后等待数据更新查看趋势`
}
return
''
}
// 更新图表(统一处理空状态和正常状态)
...
...
@@ -1127,11 +1168,12 @@ const updateChart = (
config
:
Ref
<
ChartConfig
>
,
isEmpty
:
boolean
,
isPercent
=
false
,
timeRange
:
string
,
customFormatter
?:
(
params
:
TooltipParam
[])
=>
string
,
)
=>
{
if
(
!
instance
)
return
if
(
isEmpty
)
{
const
periodText
=
generatePeriodText
(
config
.
value
.
xAxisData
)
const
periodText
=
generatePeriodText
(
timeRange
)
setNotopt
(
instance
,
config
,
periodText
,
isPercent
)
}
else
{
// 使用 notMerge: true 完全替换配置,确保从空状态切换回来时配置正确
...
...
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