Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
gh
/
dj-data-view
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7664bc98
authored
Oct 28, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed
1 parent
4c2ca37e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
114 additions
and
49 deletions
src/api/modules/user.js
src/components/ViewContentRight.vue
src/components/barChart.vue
src/components/options.js
src/views/user/analyse.vue
src/views/user/area.vue
src/views/user/brand.vue
src/api/modules/user.js
View file @
7664bc9
...
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2022-06-28 16:55:48
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 1
3:55:36
* @LastEditTime: 2022-10-27 1
5:23:24
*/
// 私域用户池总览数据
const
getoverview
=
params
=>
{
...
...
@@ -18,6 +18,12 @@ const getDistribution = params => {
const
getTrend
=
params
=>
{
return
window
.
$HTTP
.
get
(
'privateDomainUserPool/getTrend'
,
params
)
}
const
getCustomerValueAnalysis
=
params
=>
{
return
window
.
$HTTP
.
get
(
'privateDomainUserPool/getCustomerValueAnalysis'
,
params
)
}
const
getValueDistribution
=
params
=>
{
return
window
.
$HTTP
.
get
(
'privateDomainUserPool/getValueDistribution'
,
params
)
}
// // 获取品牌售后其他信息
// const aftersaleother = params => {
...
...
@@ -29,4 +35,4 @@ const getTrend = params => {
// return window.$HTTP.get('merchant/aftersaleother', params)
// }
export
default
{
getoverview
,
getDistribution
,
getTrend
}
export
default
{
getoverview
,
getDistribution
,
getTrend
,
getCustomerValueAnalysis
,
getValueDistribution
}
src/components/ViewContentRight.vue
View file @
7664bc9
...
...
@@ -2,8 +2,8 @@
* @Description:
* @Author: huyue
* @Date: 2022-06-23 10:52:23
* @LastEditors:
huyue
* @LastEditTime: 2022-
06-24 14:44:50
* @LastEditors:
前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-
10-28 09:34:04
-->
<
template
>
<div
class=
"right"
>
...
...
@@ -18,14 +18,15 @@
<view-chart></view-chart>
<view-line-group>
<div
slot=
"1"
><Analyse
:height=
"defaultHeight"
></Analyse></div>
<div
slot=
"2"
><Brand
:height=
"defaultHeight"
></Brand></div>
<div
slot=
"3"
><Area
:height=
"defaultHeight"
></Area></div>
<div
slot=
"2"
><Brand
:height=
"defaultHeight"
:brandList=
"brandList"
></Brand></div>
<div
slot=
"3"
><Area
:height=
"defaultHeight"
:areaList=
"areaList"
></Area></div>
</view-line-group>
</div>
</div>
</
template
>
<
script
type=
"text/ecmascript-6"
>
const
queryItem
=
[
'Importantvalue'
,
'Importantdevelopments'
,
'Importantrecall'
,
'Importantretention'
,
'Generalvalue'
,
'Generaldevelopments'
,
'Generalrecall'
,
'Generalretention'
]
import
datas
from
'../utils/data'
import
Business
from
'../views/saas/business'
import
Project
from
'../views/saas/project'
...
...
@@ -45,11 +46,32 @@ export default {
},
data
()
{
return
{
defaultHeight
:
datas
.
DefaultData
.
defaultLineHeight
defaultHeight
:
datas
.
DefaultData
.
defaultLineHeight
,
brandList
:
[],
areaList
:
[]
}
},
mounted
()
{},
methods
:
{}
mounted
()
{
this
.
getValueDistribution
(
7
);
this
.
$bus
.
$on
(
'drawChart'
,
data
=>
{
this
.
getValueDistribution
(
data
)
})
},
methods
:
{
getValueDistribution
(
itemKey
)
{
const
params
=
{
req
:
{
queryItem
:
queryItem
[
7
-
itemKey
]
}
}
this
.
api
.
user
.
getValueDistribution
(
params
).
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
this
.
areaList
=
res
.
data
.
dataList
[
0
].
rankDistributions
this
.
brandList
=
res
.
data
.
dataList
[
1
].
rankDistributions
}
})
}
}
}
</
script
>
...
...
src/components/barChart.vue
View file @
7664bc9
...
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:43:46
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-2
6 17:06:07
* @LastEditTime: 2022-10-2
8 10:08:29
* @FilePath: \dj-data-view\src\components\barChart.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
...
...
@@ -39,8 +39,8 @@ export default {
type
:
String
,
default
:
'品牌'
},
data
List
:
{
type
:
Array
,
analysis
List
:
{
type
:
[
Array
,
Object
]
,
default
:
()
=>
[]
},
// 0-月表;1-日表
...
...
@@ -77,6 +77,7 @@ export default {
rankFlag
:
'top'
,
lineOptions
:
[],
rankList
:
[],
areaList2
:
this
.
areaList
,
echartsLine
:
''
,
moveAttr
:
{
// speed: 900,
...
...
@@ -86,14 +87,31 @@ export default {
timer
:
null
}
},
created
()
{
const
{
rotate
}
=
this
const
obj
=
{
rotate
// created() {
// const { rotate, analysisList } = this
// const obj = {
// rotate,
// analysisList
// }
// this.lineOptions = this.revese ? getBarReverseOptions(obj) : getBarOptions(obj)
// },
watch
:
{
analysisList
:
{
handler
()
{
const
{
rotate
,
analysisList
}
=
this
const
obj
=
{
rotate
,
analysisList
}
this
.
lineOptions
=
this
.
revese
?
getBarReverseOptions
(
obj
)
:
getBarOptions
(
obj
)
this
.
chartBindEvent
()
},
deep
:
true
,
immediate
:
true
}
this
.
lineOptions
=
this
.
revese
?
getBarReverseOptions
()
:
getBarOptions
(
obj
)
},
mounted
()
{
console
.
log
(
this
.
areaList
,
999
)
this
.
lineDom
=
document
.
getElementById
(
this
.
domId
)
this
[
this
.
domId
]
=
echarts
.
init
(
this
.
lineDom
)
this
.
chartBindEvent
()
...
...
@@ -105,16 +123,11 @@ export default {
this
[
this
.
domId
].
getZr
().
on
(
'mousemove'
,
utils
.
debounce
(
params
=>
{
console
.
log
(
params
)
const
pointInPixel
=
[
params
.
offsetX
,
params
.
offsetY
]
const
pointInGrid
=
this
[
this
.
domId
].
convertFromPixel
({
seriesIndex
:
0
},
pointInPixel
)
const
yIndex
=
pointInGrid
[
1
]
const
op
=
this
[
this
.
domId
].
getOption
()
const
name
=
op
.
yAxis
[
0
].
data
[
yIndex
]
console
.
log
(
name
,
yIndex
)
this
.
$bus
.
$emit
(
'drawChart'
,
name
)
}),
500
this
.
$bus
.
$emit
(
'drawChart'
,
yIndex
)
},
500
)
)
}
}
...
...
src/components/options.js
View file @
7664bc9
...
...
@@ -2,18 +2,23 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:46:24
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-2
7 14:31:44
* @LastEditTime: 2022-10-2
8 12:32:22
* @FilePath: \dj-data-view\src\components\barOptions.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
function
getBarOptions
(
obj
)
{
console
.
log
(
obj
)
const
{
analysisList
,
rotate
}
=
obj
const
num
=
analysisList
.
map
(
item
=>
item
.
num
)
console
.
log
(
num
)
const
name
=
analysisList
.
map
(
item
=>
item
.
name
)
var
options
=
{
xAxis
:
{
type
:
'category'
,
axisLabel
:
{
color
:
'#fff'
,
fontSize
:
'0.
8
em'
,
rotate
:
obj
.
rotate
fontSize
:
'0.
75
em'
,
rotate
},
splitLine
:
{
show
:
false
...
...
@@ -24,7 +29,7 @@ function getBarOptions(obj) {
axisLine
:
{
show
:
false
},
data
:
[
'广汽本田'
,
'广汽丰田'
,
'一汽奥迪'
,
'宝马'
,
'奔驰'
,
'其他'
]
data
:
name
},
grid
:
{
left
:
'8%'
,
...
...
@@ -57,13 +62,15 @@ function getBarOptions(obj) {
color
:
'#6578FF'
},
barWidth
:
'35%'
,
data
:
[
120
,
200
,
150
,
80
,
70
,
110
,
130
]
data
:
num
}
]
}
return
options
}
function
getBarReverseOptions
(
obj
)
{
const
{
analysisList
}
=
obj
const
value
=
Object
.
values
(
analysisList
)
var
options
=
{
tooltip
:
{
trigger
:
'axis'
,
...
...
@@ -139,7 +146,7 @@ function getBarReverseOptions(obj) {
}
}
},
data
:
[
30
,
120
,
200
,
150
,
80
,
70
,
110
,
130
]
data
:
value
}
]
}
...
...
@@ -173,7 +180,8 @@ function getLineOptions(obj) {
type
:
'category'
,
axisLabel
:
{
color
:
'#fff'
,
fontSize
:
'0.8em'
fontSize
:
'0.7em'
,
rotate
:
30
},
splitLine
:
{
show
:
false
...
...
@@ -190,7 +198,7 @@ function getLineOptions(obj) {
left
:
'6%'
,
right
:
'6%'
,
top
:
'14%'
,
bottom
:
'
1
%'
,
bottom
:
'
3
%'
,
containLabel
:
true
},
yAxis
:
{
...
...
@@ -202,8 +210,8 @@ function getLineOptions(obj) {
}
},
axisLabel
:
{
color
:
'#
fff
'
,
fontSize
:
'0.
8
em'
color
:
'#
ccc
'
,
fontSize
:
'0.
7
em'
},
splitNumber
:
4
},
...
...
src/views/user/analyse.vue
View file @
7664bc9
...
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-2
5 15:16:19
* @LastEditTime: 2022-10-2
7 15:17:26
* @FilePath: \dj-data-view\src\views\user\analyse.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
...
...
@@ -13,7 +13,7 @@
<div
class=
"title-h3"
>
客户价值分析
</div>
</div>
<div
class=
"container"
>
<bar-chart
domId=
"analyseChart"
:revese=
"true"
boxHeight=
"14.54vh"
></bar-chart>
<bar-chart
domId=
"analyseChart"
:revese=
"true"
boxHeight=
"14.54vh"
:analysisList=
"analysisList"
></bar-chart>
</div>
</div>
</
template
>
...
...
@@ -22,7 +22,21 @@
export
default
{
name
:
'Analyse'
,
data
()
{
return
{}
return
{
analysisList
:
''
}
},
mounted
()
{
this
.
getCustomerValueAnalysis
()
},
methods
:
{
getCustomerValueAnalysis
()
{
this
.
api
.
user
.
getCustomerValueAnalysis
().
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
this
.
analysisList
=
res
.
data
.
dataList
[
0
]
}
})
}
}
}
</
script
>
...
...
src/views/user/area.vue
View file @
7664bc9
...
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-2
6 16:58:27
* @LastEditTime: 2022-10-2
7 17:28:40
* @FilePath: \dj-data-view\src\views\user\area.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
...
...
@@ -13,7 +13,7 @@
<span>
区域分布
</span>
</div>
<div
class=
"container"
>
<bar-chart
domId=
"areaChart"
></bar-chart>
<bar-chart
domId=
"areaChart"
:analysisList=
"areaList"
></bar-chart>
</div>
</div>
</
template
>
...
...
@@ -24,10 +24,11 @@ export default {
data
()
{
return
{}
},
mounted
()
{
this
.
$bus
.
$on
(
'drawChart'
,
data
=>
{
console
.
log
(
data
)
})
props
:
{
areaList
:
{
type
:
Array
,
default
:
()
=>
[]
}
}
}
</
script
>
...
...
src/views/user/brand.vue
View file @
7664bc9
...
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-2
6 16:58:18
* @LastEditTime: 2022-10-2
7 17:28:13
* @FilePath: \dj-data-view\src\views\user\brand.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
...
...
@@ -13,7 +13,7 @@
<span>
品牌分布
</span>
</div>
<div
class=
"container"
>
<bar-chart
domId=
"brandChart"
:rotate=
"30"
></bar-chart>
<bar-chart
domId=
"brandChart"
:rotate=
"30"
:analysisList=
"brandList"
></bar-chart>
</div>
</div>
</
template
>
...
...
@@ -23,10 +23,11 @@ export default {
data
()
{
return
{}
},
mounted
()
{
this
.
$bus
.
$on
(
'drawChart'
,
data
=>
{
console
.
log
(
data
)
})
props
:
{
brandList
:
{
type
:
Array
,
default
:
()
=>
[]
}
}
}
</
script
>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment