Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
abc9416b
提交
abc9416b
authored
11月 03, 2023
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 优化图表
上级
9eb6dcc7
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
30 行增加
和
11 行删除
+30
-11
Index.vue
src/modules/analyze/user/views/Index.vue
+30
-11
没有找到文件。
src/modules/analyze/user/views/Index.vue
浏览文件 @
abc9416b
...
@@ -16,12 +16,17 @@ async function fetchInfo() {
...
@@ -16,12 +16,17 @@ async function fetchInfo() {
onMounted
(
fetchInfo
)
onMounted
(
fetchInfo
)
// 用户性别分布
// 用户性别分布
const
gender
=
ref
({
1
:
0
,
2
:
0
})
const
gender
=
reactive
({
1
:
0
,
2
:
0
})
const
userTotal
=
ref
(
0
)
async
function
fetchGender
()
{
async
function
fetchGender
()
{
const
res
=
await
api
.
getMemberGender
()
const
res
=
await
api
.
getMemberGender
()
gender
.
value
=
res
.
data
.
items
.
reduce
((
result
,
item
)
=>
{
userTotal
.
value
=
res
.
data
.
total
Object
.
assign
(
gender
,
res
.
data
.
items
.
reduce
((
result
,
item
)
=>
{
return
{
...
result
,
[
item
.
group_name
]:
parseInt
(
item
.
total
)
}
return
{
...
result
,
[
item
.
group_name
]:
parseInt
(
item
.
total
)
}
},
{})
},
{})
)
}
}
onMounted
(
fetchGender
)
onMounted
(
fetchGender
)
...
@@ -43,8 +48,8 @@ const genderOption = computed(() => {
...
@@ -43,8 +48,8 @@ const genderOption = computed(() => {
axisTick
:
{
show
:
false
},
axisTick
:
{
show
:
false
},
axisLabel
:
{
axisLabel
:
{
formatter
:
function
(
value
,
index
)
{
formatter
:
function
(
value
,
index
)
{
const
total
=
gender
.
value
[
1
]
+
gender
.
value
[
2
]
const
total
=
gender
[
1
]
+
gender
[
2
]
return
value
+
'
\
n'
+
(
index
===
0
?
((
gender
.
value
[
1
]
/
total
)
*
100
).
toFixed
(
1
)
:
((
gender
.
value
[
2
]
/
total
)
*
100
).
toFixed
(
1
))
+
'%'
return
value
+
'
\
n'
+
(
index
===
0
?
((
gender
[
1
]
/
total
)
*
100
).
toFixed
(
1
)
:
((
gender
[
2
]
/
total
)
*
100
).
toFixed
(
1
))
+
'%'
}
}
}
}
},
},
...
@@ -62,8 +67,8 @@ const genderOption = computed(() => {
...
@@ -62,8 +67,8 @@ const genderOption = computed(() => {
symbolOffset
:
[
20
,
0
],
symbolOffset
:
[
20
,
0
],
symbolMargin
:
10
,
symbolMargin
:
10
,
data
:
[
data
:
[
{
value
:
gender
.
value
[
1
],
symbol
:
man
,
itemStyle
:
{
color
:
'#767aca'
}
},
{
value
:
gender
[
1
],
symbol
:
man
,
itemStyle
:
{
color
:
'#767aca'
}
},
{
value
:
gender
.
value
[
2
],
symbol
:
woman
,
itemStyle
:
{
color
:
'#d26080'
}
}
{
value
:
gender
[
2
],
symbol
:
woman
,
itemStyle
:
{
color
:
'#d26080'
}
}
]
]
}
}
]
]
...
@@ -339,25 +344,29 @@ onMounted(fetchCardInstallment)
...
@@ -339,25 +344,29 @@ onMounted(fetchCardInstallment)
<div
class=
"box"
>
<div
class=
"box"
>
<h3>
用户性别分布
</h3>
<h3>
用户性别分布
</h3>
<div
class=
"box-inner"
>
<div
class=
"box-inner"
>
<v-chart
class=
"chart"
:option=
"genderOption"
ref=
"chart"
style=
"height: 280px"
/>
<v-chart
class=
"chart"
:option=
"genderOption"
ref=
"chart"
style=
"height: 280px"
v-if=
"userTotal"
/>
<el-empty
v-else
/>
</div>
</div>
</div>
</div>
<div
class=
"box"
>
<div
class=
"box"
>
<h3>
用户年龄分布
</h3>
<h3>
用户年龄分布
</h3>
<div
class=
"box-inner"
>
<div
class=
"box-inner"
>
<v-chart
class=
"chart"
:option=
"ageOption"
ref=
"chart"
style=
"height: 280px"
/>
<v-chart
class=
"chart"
:option=
"ageOption"
ref=
"chart"
style=
"height: 280px"
v-if=
"age.length"
/>
<el-empty
v-else
/>
</div>
</div>
</div>
</div>
<div
class=
"box"
>
<div
class=
"box"
>
<h3>
信用卡级别分布
</h3>
<h3>
信用卡级别分布
</h3>
<div
class=
"box-inner"
>
<div
class=
"box-inner"
>
<v-chart
class=
"chart"
:option=
"levelOption"
ref=
"chart"
style=
"height: 280px"
/>
<v-chart
class=
"chart"
:option=
"levelOption"
ref=
"chart"
style=
"height: 280px"
v-if=
"cardLevel.length"
/>
<el-empty
v-else
/>
</div>
</div>
</div>
</div>
<div
class=
"box"
>
<div
class=
"box"
>
<h3>
月收入分布
</h3>
<h3>
月收入分布
</h3>
<div
class=
"box-inner"
>
<div
class=
"box-inner"
>
<v-chart
class=
"chart"
:option=
"monthlyOption"
ref=
"chart"
style=
"height: 280px"
/>
<v-chart
class=
"chart"
:option=
"monthlyOption"
ref=
"chart"
style=
"height: 280px"
v-if=
"monthly.length"
/>
<el-empty
v-else
/>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -385,7 +394,8 @@ onMounted(fetchCardInstallment)
...
@@ -385,7 +394,8 @@ onMounted(fetchCardInstallment)
<div
class=
"box"
>
<div
class=
"box"
>
<h3>
事件分析
</h3>
<h3>
事件分析
</h3>
<div
class=
"box-inner"
>
<div
class=
"box-inner"
>
<v-chart
class=
"chart"
:option=
"eventOption"
ref=
"chart"
style=
"height: 380px"
/>
<v-chart
class=
"chart"
:option=
"eventOption"
ref=
"chart"
style=
"height: 380px"
v-if=
"event.length"
/>
<el-empty
v-else
/>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -393,6 +403,7 @@ onMounted(fetchCardInstallment)
...
@@ -393,6 +403,7 @@ onMounted(fetchCardInstallment)
<div
class=
"box"
>
<div
class=
"box"
>
<h3>
信用卡开卡
</h3>
<h3>
信用卡开卡
</h3>
<div
class=
"card"
>
<div
class=
"card"
>
<template
v-if=
"cardOpen.length"
>
<div
class=
"item"
v-for=
"(item, index) in cardOpen"
:key=
"index"
>
<div
class=
"item"
v-for=
"(item, index) in cardOpen"
:key=
"index"
>
<!--
<div
class=
"item-left"
>
{{
item
.
group_name
}}
</div>
-->
<!--
<div
class=
"item-left"
>
{{
item
.
group_name
}}
</div>
-->
<div
class=
"item-center"
>
<div
class=
"item-center"
>
...
@@ -402,11 +413,14 @@ onMounted(fetchCardInstallment)
...
@@ -402,11 +413,14 @@ onMounted(fetchCardInstallment)
</div>
</div>
<div
class=
"item-right"
>
{{
item
.
total
}}
人
</div>
<div
class=
"item-right"
>
{{
item
.
total
}}
人
</div>
</div>
</div>
</
template
>
<el-empty
v-else
/>
</div>
</div>
</div>
</div>
<div
class=
"box"
>
<div
class=
"box"
>
<h3>
积分翻倍及消费满减
</h3>
<h3>
积分翻倍及消费满减
</h3>
<div
class=
"card"
>
<div
class=
"card"
>
<
template
v-if=
"cardIntegral.length"
>
<div
class=
"item"
v-for=
"(item, index) in cardIntegral"
:key=
"index"
>
<div
class=
"item"
v-for=
"(item, index) in cardIntegral"
:key=
"index"
>
<!--
<div
class=
"item-left"
>
{{
item
.
group_name
}}
</div>
-->
<!--
<div
class=
"item-left"
>
{{
item
.
group_name
}}
</div>
-->
<div
class=
"item-center"
>
<div
class=
"item-center"
>
...
@@ -416,11 +430,14 @@ onMounted(fetchCardInstallment)
...
@@ -416,11 +430,14 @@ onMounted(fetchCardInstallment)
</div>
</div>
<div
class=
"item-right"
>
{{
item
.
total
}}
人
</div>
<div
class=
"item-right"
>
{{
item
.
total
}}
人
</div>
</div>
</div>
</
template
>
<el-empty
v-else
/>
</div>
</div>
</div>
</div>
<div
class=
"box"
>
<div
class=
"box"
>
<h3>
分期还款
</h3>
<h3>
分期还款
</h3>
<div
class=
"card"
>
<div
class=
"card"
>
<
template
v-if=
"cardInstallment.length"
>
<div
class=
"item"
v-for=
"(item, index) in cardInstallment"
:key=
"index"
>
<div
class=
"item"
v-for=
"(item, index) in cardInstallment"
:key=
"index"
>
<!--
<div
class=
"item-left"
>
{{
item
.
group_name
}}
</div>
-->
<!--
<div
class=
"item-left"
>
{{
item
.
group_name
}}
</div>
-->
<div
class=
"item-center"
>
<div
class=
"item-center"
>
...
@@ -430,6 +447,8 @@ onMounted(fetchCardInstallment)
...
@@ -430,6 +447,8 @@ onMounted(fetchCardInstallment)
</div>
</div>
<div
class=
"item-right"
>
{{
item
.
total
}}
人
</div>
<div
class=
"item-right"
>
{{
item
.
total
}}
人
</div>
</div>
</div>
</
template
>
<el-empty
v-else
/>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论