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 @@
...
@@ -3,19 +3,19 @@
* @Author: huyue
* @Author: huyue
* @Date: 2022-06-28 14:58:30
* @Date: 2022-06-28 14:58:30
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 1
7:09:19
* @LastEditTime: 2022-06-28 1
8:10:58
*/
*/
import
Request
from
'../request'
import
Request
from
'../request'
const
request
=
new
Request
()
const
request
=
new
Request
()
const
getSales
=
params
=>
{
const
getSales
=
params
=>
{
return
request
.
get
(
'brand/sale'
,
params
)
return
request
.
get
(
'brand/sale'
,
params
)
}
}
// 获取品牌销售转化总数居
const
saleT
rans
=
params
=>
{
const
saleT
otal
=
params
=>
{
return
request
.
get
(
'brand/sale
Trans
'
,
params
)
return
request
.
get
(
'brand/sale
total
'
,
params
)
}
}
export
default
{
export
default
{
getSales
,
getSales
,
saleT
rans
saleT
otal
}
}
src/views/salesData/flow.vue
View file @
dfb551a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Author: huyue
* @Date: 2022-06-23 15:05:21
* @Date: 2022-06-23 15:05:21
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 1
7:44:43
* @LastEditTime: 2022-06-28 1
8:41:37
-->
-->
<
template
>
<
template
>
<div
class=
"flow-box"
>
<div
class=
"flow-box"
>
...
@@ -69,51 +69,82 @@ export default {
...
@@ -69,51 +69,82 @@ export default {
}
}
],
],
isActive
:
1
,
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
()
{
mounted
()
{
this
.
getChart
()
this
.
funnelDom
=
document
.
getElementById
(
'flow'
)
console
.
log
(
this
.
currentDate
)
this
.
echartsFunnel
=
echarts
.
init
(
this
.
funnelDom
)
// resize
window
.
addEventListener
(
'resize'
,
()
=>
{
this
.
echartsFunnel
.
resize
()
})
this
.
init
()
this
.
init
()
},
},
methods
:
{
methods
:
{
init
()
{
init
()
{
this
.
getSaleTrans
()
this
.
getSaleTrans
()
},
},
getSaleTrans
(
queryItem
=
'enter'
)
{
getSaleTrans
()
{
const
params
=
{
const
params
=
{
req
:
{
req
:
{
corporateGroupName
:
'集团1'
,
corporateGroupName
:
'集团1'
,
queryItem
,
queryTime
:
'2022-06-23'
,
queryTime
:
this
.
getCurrentDate
(),
queryType
:
0
queryType
:
0
}
}
}
}
this
.
api
.
sales
.
saleT
rans
(
params
).
then
(
res
=>
{
this
.
api
.
sales
.
saleT
otal
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
console
.
log
(
res
.
data
)
if
(
res
.
code
===
'0'
)
{
if
(
res
.
code
===
'0'
)
{
const
{
data
:
data
}
=
res
res
.
data
.
dataList
[
0
].
num
.
forEach
((
item
,
index
)
=>
{
console
.
log
(
JSON
.
parse
(
data
.
data
[
0
].
typeNum
))
this
.
funnelData
[
index
].
value
=
item
})
this
.
draw
()
}
}
})
})
},
},
getChart
()
{
draw
()
{
var
chartDom
=
document
.
getElementById
(
'flow'
)
this
.
option
=
{
var
myChart
=
echarts
.
init
(
chartDom
)
var
option
option
=
{
tooltip
:
{
tooltip
:
{
trigger
:
'item'
,
trigger
:
'item'
,
backgroundColor
:
'rgba(68,68,68,0.8)'
,
backgroundColor
:
'rgba(68,68,68,0.8)'
,
formatter
:
'{a} <br/>{b} : {c}
%
'
,
formatter
:
'{a} <br/>{b} : {c}'
,
textStyle
:
{
textStyle
:
{
color
:
'#fff'
color
:
'#fff'
},
},
borderWidth
:
0
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
:
[
series
:
[
{
{
name
:
'漏斗图'
,
name
:
'漏斗图'
,
...
@@ -148,17 +179,22 @@ export default {
...
@@ -148,17 +179,22 @@ export default {
fontSize
:
20
fontSize
:
20
}
}
},
},
data
:
[
data
:
this
.
funnelData
{
value
:
20
,
name
:
'Order'
},
// data: [
{
value
:
40
,
name
:
'Inquiry'
},
// { value: 20, name: 'Order' },
{
value
:
60
,
name
:
'Visit'
},
// { value: 40, name: 'Inquiry' },
{
value
:
80
,
name
:
'Click'
},
// { value: 60, name: 'Visit' },
{
value
:
100
,
name
:
'Show'
}
// { 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