Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
gh
/
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 dfb551a6
authored
Jun 28, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
销售转化
1 parent
ba31f401
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
32 deletions
src/api/modules/sales.js
src/views/salesData/flow.vue
src/api/modules/sales.js
View file @
dfb551a
...
...
@@ -3,19 +3,19 @@
* @Author: huyue
* @Date: 2022-06-28 14:58:30
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 1
7:09:19
* @LastEditTime: 2022-06-28 1
8:10:58
*/
import
Request
from
'../request'
const
request
=
new
Request
()
const
getSales
=
params
=>
{
return
request
.
get
(
'brand/sale'
,
params
)
}
const
saleT
rans
=
params
=>
{
return
request
.
get
(
'brand/sale
Trans
'
,
params
)
// 获取品牌销售转化总数居
const
saleT
otal
=
params
=>
{
return
request
.
get
(
'brand/sale
total
'
,
params
)
}
export
default
{
getSales
,
saleT
rans
saleT
otal
}
src/views/salesData/flow.vue
View file @
dfb551a
...
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2022-06-23 15:05:21
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 1
7:44:43
* @LastEditTime: 2022-06-28 1
8:41:37
-->
<
template
>
<div
class=
"flow-box"
>
...
...
@@ -69,51 +69,82 @@ export default {
}
],
isActive
:
1
,
queryList
:
[
'enter'
,
'stayfile'
,
'test'
,
'placeorder'
,
'success'
]
funnelData
:
[
{
name
:
'客流'
,
type
:
'enter'
,
value
:
''
},
{
name
:
'留档'
,
type
:
'stayfile'
,
value
:
''
},
{
name
:
'试驾'
,
type
:
'test'
,
value
:
''
},
{
name
:
'订单'
,
type
:
'placeorder'
,
value
:
''
},
{
name
:
'成交'
,
type
:
'success'
,
value
:
''
}
],
option
:
{},
echartsFunnel
:
''
,
funnelDom
:
''
}
},
mounted
()
{
this
.
getChart
()
console
.
log
(
this
.
currentDate
)
this
.
funnelDom
=
document
.
getElementById
(
'flow'
)
this
.
echartsFunnel
=
echarts
.
init
(
this
.
funnelDom
)
// resize
window
.
addEventListener
(
'resize'
,
()
=>
{
this
.
echartsFunnel
.
resize
()
})
this
.
init
()
},
methods
:
{
init
()
{
this
.
getSaleTrans
()
},
getSaleTrans
(
queryItem
=
'enter'
)
{
getSaleTrans
()
{
const
params
=
{
req
:
{
corporateGroupName
:
'集团1'
,
queryItem
,
queryTime
:
this
.
getCurrentDate
(),
queryTime
:
'2022-06-23'
,
queryType
:
0
}
}
this
.
api
.
sales
.
saleT
rans
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
api
.
sales
.
saleT
otal
(
params
).
then
(
res
=>
{
console
.
log
(
res
.
data
)
if
(
res
.
code
===
'0'
)
{
const
{
data
:
data
}
=
res
console
.
log
(
JSON
.
parse
(
data
.
data
[
0
].
typeNum
))
res
.
data
.
dataList
[
0
].
num
.
forEach
((
item
,
index
)
=>
{
this
.
funnelData
[
index
].
value
=
item
})
this
.
draw
()
}
})
},
getChart
()
{
var
chartDom
=
document
.
getElementById
(
'flow'
)
var
myChart
=
echarts
.
init
(
chartDom
)
var
option
option
=
{
draw
()
{
this
.
option
=
{
tooltip
:
{
trigger
:
'item'
,
backgroundColor
:
'rgba(68,68,68,0.8)'
,
formatter
:
'{a} <br/>{b} : {c}
%
'
,
formatter
:
'{a} <br/>{b} : {c}'
,
textStyle
:
{
color
:
'#fff'
},
borderWidth
:
0
},
color
:
[
'rgba(245, 170, 2, .8)'
,
'rgba(235, 96, 2, .4)'
,
'rgba(235, 96, 2, .6)'
,
'rgba(235, 96, 2, .8)'
,
'rgba(235, 96, 2, 1)'
],
color
:
[
'rgba(235, 96, 2, 1)'
,
'rgba(235, 96, 2, .8)'
,
'rgba(235, 96, 2, .6)'
,
'rgba(235, 96, 2, .4)'
,
'rgba(245, 170, 2, .8)'
],
// color: [, , , , ].reverse(),
series
:
[
{
name
:
'漏斗图'
,
...
...
@@ -148,17 +179,22 @@ export default {
fontSize
:
20
}
},
data
:
[
{
value
:
20
,
name
:
'Order'
},
{
value
:
40
,
name
:
'Inquiry'
},
{
value
:
60
,
name
:
'Visit'
},
{
value
:
80
,
name
:
'Click'
},
{
value
:
100
,
name
:
'Show'
}
]
data
:
this
.
funnelData
// data: [
// { value: 20, name: 'Order' },
// { value: 40, name: 'Inquiry' },
// { value: 60, name: 'Visit' },
// { value: 80, name: 'Click' },
// { value: 100, name: 'Show' }
// ]
}
]
}
option
&&
myChart
.
setOption
(
option
)
this
.
echartsFunnel
.
setOption
(
this
.
option
)
// 鼠标划入
this
.
echartsFunnel
.
on
(
'mouseover'
,
data
=>
{
console
.
log
(
data
.
data
)
})
}
}
}
...
...
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