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 e31509de
authored
Jul 01, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'dev_v1.0.0' of
http://192.168.3.233:8090/gh/data-view
into dev_v1.0.0
2 parents
9df07251
8cefb039
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
27 deletions
src/views/salesData/flow.vue
src/views/salesData/trend.vue
src/views/salesData/flow.vue
View file @
e31509d
...
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2022-06-23 15:05:21
* @LastEditors: huyue
* @LastEditTime: 2022-06-30 1
8:34:48
* @LastEditTime: 2022-06-30 1
9:40:27
-->
<
template
>
<div>
...
...
@@ -57,27 +57,27 @@ export default {
{
name
:
'客流'
,
type
:
'enter'
,
value
:
''
value
:
100
},
{
name
:
'留档'
,
type
:
'stayfile'
,
value
:
''
value
:
80
},
{
name
:
'试驾'
,
type
:
'test'
,
value
:
''
value
:
60
},
{
name
:
'订单'
,
type
:
'placeorder'
,
value
:
''
value
:
40
},
{
name
:
'成交'
,
type
:
'success'
,
value
:
''
value
:
20
}
],
option
:
{},
...
...
@@ -111,11 +111,12 @@ export default {
}
}
var
brandName
=
val
.
brand
?
val
.
brand
.
name
:
''
this
.
api
.
sales
[
brandName
?
'storeTotal'
:
'saleTotal'
](
params
).
then
(
res
=>
{
this
.
api
.
sales
[
brandName
?
'storeTotal'
:
'saleTotal'
](
params
)
.
then
(
res
=>
{
if
(
res
.
code
===
'0'
)
{
if
(
res
.
data
.
dataList
.
length
)
{
res
.
data
.
dataList
[
0
].
num
.
forEach
((
item
,
index
)
=>
{
this
.
funnelData
[
index
].
value
=
item
this
.
funnelData
[
index
].
num
=
item
})
this
.
hasData
=
res
.
data
.
dataList
[
0
].
num
.
every
(
i
=>
i
!=
0
)
if
(
this
.
hasData
)
this
.
draw
()
...
...
@@ -124,15 +125,21 @@ export default {
}
}
})
.
catch
(()
=>
{
this
.
hasData
=
false
})
},
draw
()
{
this
.
option
=
{
tooltip
:
{
trigger
:
'item'
,
backgroundColor
:
'rgba(68,68,68,0.8)'
,
formatter
:
'{a} <br/>{b} : {c}'
,
formatter
:
e
=>
{
return
`
${
e
.
data
.
name
}
:
${
e
.
data
.
num
}
`
},
textStyle
:
{
color
:
'#fff'
color
:
'#fff'
,
fontSize
:
8
},
borderWidth
:
0
},
...
...
@@ -145,9 +152,7 @@ export default {
top
:
8
,
bottom
:
8
,
width
:
'100%'
,
min
:
0
,
// max: 10000,
minSize
:
'25%'
,
minSize
:
'30%'
,
maxSize
:
'100%'
,
sort
:
'descending'
,
gap
:
2
,
...
...
@@ -172,12 +177,6 @@ export default {
}
},
data
:
this
.
funnelData
// data: [
// { value: 20, name: 'Order' },
// { value: 40, name: 'Inquiry' },
// { value: 60, name: 'Visit' },
// { value: 80, name: 'Click' },
// { value: 100, name: 'Show' }
// ]
}
]
...
...
src/views/salesData/trend.vue
View file @
e31509d
...
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2022-06-23 15:05:21
* @LastEditors: huyue
* @LastEditTime: 2022-06-30 1
8:35:10
* @LastEditTime: 2022-06-30 1
9:38:58
-->
<
template
>
<div>
...
...
@@ -60,12 +60,17 @@ export default {
this
.
list
.
forEach
((
i
,
idx
)
=>
{
p
[
idx
]
=
new
Promise
((
resolve
,
reject
)
=>
{
params
.
req
.
queryItem
=
i
this
.
api
.
sales
[
api
](
params
).
then
(
res
=>
{
this
.
api
.
sales
[
api
](
params
)
.
then
(
res
=>
{
resolve
(
res
.
data
.
dataList
)
})
.
catch
(()
=>
{
reject
()
})
})
Promise
.
all
([
p
[
0
],
p
[
1
],
p
[
2
],
p
[
3
],
p
[
4
]]).
then
(
results
=>
{
})
Promise
.
all
([
p
[
0
],
p
[
1
],
p
[
2
],
p
[
3
],
p
[
4
]])
.
then
(
results
=>
{
this
.
dataList
=
results
const
flag
=
results
.
map
(
item
=>
{
if
(
item
.
length
)
{
...
...
@@ -77,6 +82,9 @@ export default {
this
.
$set
(
this
,
'hasData'
,
!
flag
.
every
(
i
=>
!
i
))
this
.
draw
()
})
.
catch
(()
=>
{
this
.
hasData
=
false
})
},
draw
()
{
this
.
option
=
{
...
...
@@ -85,7 +93,39 @@ export default {
show
:
true
,
borderWidth
:
0
,
backgroundColor
:
'rgba(68,68,68,0.80)'
,
// position: [20, 20],
// position: (point, params, dom, rect, size) => {
// var x = 0 // x坐标位置
// var y = 0 // y坐标位置
// // 当前鼠标位置
// var pointX = point[0]
// var pointY = point[1]
// // 外层div大小
// // var viewWidth = size.viewSize[0];
// // var viewHeight = size.viewSize[1];
// // 提示框大小
// var boxWidth = size.contentSize[0]
// var boxHeight = size.contentSize[1]
// // boxWidth > pointX 说明鼠标左边放不下提示框
// if (boxWidth > pointX) {
// x = 5
// } else {
// // 左边放的下
// x = pointX - boxWidth
// }
// // boxHeight > pointY 说明鼠标上边放不下提示框
// if (boxHeight > pointY) {
// y = 5
// } else {
// // 上边放得下
// y = pointY - boxHeight
// }
// return [x, y]
// },
textStyle
:
{
color
:
'#FFFFFF'
,
fontSize
:
8
...
...
@@ -95,7 +135,7 @@ export default {
var
txt
=
''
e
.
forEach
(
item
=>
{
if
(
txt
)
{
txt
=
txt
+
'<br>'
txt
=
txt
+
'<br
/
>'
}
txt
=
txt
+
item
.
seriesName
+
':'
+
item
.
value
})
...
...
@@ -114,12 +154,17 @@ export default {
type
:
'category'
,
axisLabel
:
{
color
:
'#606266'
,
fontSize
:
'0.8em'
fontSize
:
10
},
data
:
[
'Mon'
,
'Tue'
,
'Wed'
,
'Thu'
,
'Fri'
,
'Sat'
,
'Sun'
]
data
:
[]
},
yAxis
:
{
type
:
'value'
type
:
'value'
,
splitLine
:
{
lineStyle
:
{
color
:
'#606266'
}
}
},
series
:
[
{
...
...
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