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
5358863f
authored
Apr 09, 2024
by
dhb52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 统一处理null数据为'未知'
parent
0e15d6c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
22 deletions
+22
-22
src/views/crm/statistics/customer/components/CustomerDealCycleByArea.vue
+11
-11
src/views/crm/statistics/customer/components/CustomerDealCycleByProduct.vue
+11
-11
No files found.
src/views/crm/statistics/customer/components/CustomerDealCycleByArea.vue
View file @
5358863f
...
...
@@ -11,13 +11,7 @@
<el-card
shadow=
"never"
class=
"mt-16px"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
label=
"序号"
align=
"center"
type=
"index"
width=
"80"
/>
<el-table-column
label=
"区域"
align=
"center"
prop=
"areaName"
min-width=
"200"
:formatter=
"(_, __, val: any) => val ?? '未知'"
/>
<el-table-column
label=
"区域"
align=
"center"
prop=
"areaName"
min-width=
"200"
/>
<el-table-column
label=
"成交周期(天)"
align=
"center"
...
...
@@ -112,13 +106,19 @@ const echartsOption = reactive<EChartsOption>({
/** 获取数据并填充图表 */
const
fetchAndFill
=
async
()
=>
{
// 1. 加载统计数据
const
customerDealCycleByArea
=
await
StatisticsCustomerApi
.
getCustomerDealCycleByArea
(
props
.
queryParams
)
const
customerDealCycleByArea
=
(
await
StatisticsCustomerApi
.
getCustomerDealCycleByArea
(
props
.
queryParams
)
).
map
((
s
:
CrmStatisticsCustomerDealCycleByAreaRespVO
)
=>
{
return
{
areaName
:
s
.
areaName
,
customerDealCycle
:
s
.
customerDealCycle
,
customerDealCount
:
s
.
customerDealCount
}
})
// 2.1 更新 Echarts 数据
if
(
echartsOption
.
xAxis
&&
echartsOption
.
xAxis
[
'data'
])
{
echartsOption
.
xAxis
[
'data'
]
=
customerDealCycleByArea
.
map
(
(
s
:
CrmStatisticsCustomerDealCycleByAreaRespVO
)
=>
s
.
areaName
??
'未知'
(
s
:
CrmStatisticsCustomerDealCycleByAreaRespVO
)
=>
s
.
areaName
)
}
if
(
echartsOption
.
series
&&
echartsOption
.
series
[
0
]
&&
echartsOption
.
series
[
0
][
'data'
])
{
...
...
src/views/crm/statistics/customer/components/CustomerDealCycleByProduct.vue
View file @
5358863f
...
...
@@ -11,13 +11,7 @@
<el-card
shadow=
"never"
class=
"mt-16px"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
label=
"序号"
align=
"center"
type=
"index"
width=
"80"
/>
<el-table-column
label=
"产品名称"
align=
"center"
prop=
"productName"
min-width=
"200"
:formatter=
"(_, __, val: any) => val ?? '未知'"
/>
<el-table-column
label=
"产品名称"
align=
"center"
prop=
"productName"
min-width=
"200"
/>
<el-table-column
label=
"成交周期(天)"
align=
"center"
...
...
@@ -112,13 +106,19 @@ const echartsOption = reactive<EChartsOption>({
/** 获取数据并填充图表 */
const
fetchAndFill
=
async
()
=>
{
// 1. 加载统计数据
const
customerDealCycleByProduct
=
await
StatisticsCustomerApi
.
getCustomerDealCycleByProduct
(
props
.
queryParams
)
const
customerDealCycleByProduct
=
(
await
StatisticsCustomerApi
.
getCustomerDealCycleByProduct
(
props
.
queryParams
)
).
map
((
s
:
CrmStatisticsCustomerDealCycleByProductRespVO
)
=>
{
return
{
productName
:
s
.
productName
??
'未知'
,
customerDealCycle
:
s
.
customerDealCount
,
customerDealCount
:
s
.
customerDealCount
}
})
// 2.1 更新 Echarts 数据
if
(
echartsOption
.
xAxis
&&
echartsOption
.
xAxis
[
'data'
])
{
echartsOption
.
xAxis
[
'data'
]
=
customerDealCycleByProduct
.
map
(
(
s
:
CrmStatisticsCustomerDealCycleByProductRespVO
)
=>
s
.
productName
??
'未知'
(
s
:
CrmStatisticsCustomerDealCycleByProductRespVO
)
=>
s
.
productName
)
}
if
(
echartsOption
.
series
&&
echartsOption
.
series
[
0
]
&&
echartsOption
.
series
[
0
][
'data'
])
{
...
...
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