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 72f66fec
authored
Jul 22, 2022
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'gh_v1.2.0' of
http://192.168.3.233:8090/gh/data-view
into gh_v1.2.0
2 parents
ab3447b5
4053f749
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
23 deletions
src/api/modules/overview.js
src/components/ViewTitle.vue
src/views/salesData/flow.vue
src/views/salesData/trend.vue
src/api/modules/overview.js
View file @
72f66fe
// window.$HTTP
// window.$HTTP
export
default
{
export
default
{
/**获取品牌---总体模块信息(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus 的基础数据 和 前五排行/后五排行 ) */
/**
获取品牌---总体模块信息(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus 的基础数据 和 前五排行/后五排行 ) */
getBrandOverallbase
(
req
)
{
getBrandOverallbase
(
req
)
{
return
window
.
$HTTP
.
get
(
'brand/overallbase'
,
{
req
})
return
window
.
$HTTP
.
get
(
'brand/overallbase'
,
{
req
})
},
},
/*获取品牌---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
/*
获取品牌---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
getBrandOveralltrend
(
req
)
{
getBrandOveralltrend
(
req
)
{
return
window
.
$HTTP
.
get
(
'brand/overalltrend'
,
{
req
})
return
window
.
$HTTP
.
get
(
'brand/overalltrend'
,
{
req
})
},
},
/* 获取门店总体相关信息 */
/* 获取门店总体相关信息 */
getMerchantOverallbase
(
req
)
{
getMerchantOverallbase
(
req
)
{
return
window
.
$HTTP
.
get
(
'merchant/overallbase'
,
{
req
})
return
window
.
$HTTP
.
get
(
'merchant/overallbase'
,
{
req
})
},
},
/*获取门店---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
/*
获取门店---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
getMerchantOveralltrend
(
req
)
{
getMerchantOveralltrend
(
req
)
{
return
window
.
$HTTP
.
get
(
'merchant/overalltrend'
,
{
req
})
return
window
.
$HTTP
.
get
(
'merchant/overalltrend'
,
{
req
})
},
},
/**
* 获取接入门店数
*/
getMerchantNum
(
req
)
{
return
window
.
$HTTP
.
get
(
'brand/getMerchantNum'
,
{
req
})
}
}
}
src/components/ViewTitle.vue
View file @
72f66fe
...
@@ -8,10 +8,12 @@
...
@@ -8,10 +8,12 @@
<div
class=
"top flex"
>
<div
class=
"top flex"
>
<img
src=
"@/assets/images/time.svg"
class=
"icon"
/>
<img
src=
"@/assets/images/time.svg"
class=
"icon"
/>
<div
class=
"now"
>
{{
now
}}
</div>
<div
class=
"now"
>
{{
now
}}
</div>
<div
class=
"yesterday"
>
数据截止至
{{
yesterday
}}
</div>
</div>
</div>
<div
class=
"bottom flex"
>
<div
class=
"bottom flex"
>
<div
class=
"merchant"
>
已同步门店数:160
</div>
<div
class=
"merchant"
>
已同步门店数:
{{
merchantNum
.
totalNum
}}
</div>
数据截止至
{{
yesterday
}}
<div
class=
"merchant"
>
上月新接入店数:
{{
merchantNum
.
increLastMonthNum
}}
</div>
<div
class=
"merchant"
>
本月新接入店数:
{{
merchantNum
.
increThisMonthNum
}}
</div>
</div>
</div>
</div>
</div>
<div
class=
"center-control"
>
<div
class=
"center-control"
>
...
@@ -23,21 +25,35 @@
...
@@ -23,21 +25,35 @@
<
script
type=
"text/ecmascript-6"
>
<
script
type=
"text/ecmascript-6"
>
export
default
{
export
default
{
name
:
'ViewTitle'
,
name
:
'ViewTitle'
,
data
()
{
data
()
{
return
{
return
{
yesterday
:
''
,
yesterday
:
''
,
now
:
new
Date
().
format
(
'yyyy-MM-dd hh:mm:ss'
)
now
:
new
Date
().
format
(
'yyyy-MM-dd hh:mm:ss'
),
merchantNum
:
{
totalNum
:
'--'
,
increLastMonthNum
:
'--'
,
increThisMonthNum
:
'--'
}
}
}
},
},
mounted
()
{
mounted
()
{
this
.
yesterday
=
new
Date
(
new
Date
().
setDate
(
new
Date
().
getDate
()
-
1
)).
format
(
'yyyy-MM-dd'
)
this
.
yesterday
=
new
Date
(
new
Date
().
setDate
(
new
Date
().
getDate
()
-
1
)).
format
(
'yyyy-MM-dd'
)
this
.
timer
()
this
.
timer
()
this
.
getMerchantNum
()
},
},
methods
:
{
methods
:
{
timer
()
{
timer
()
{
setInterval
(()
=>
{
setInterval
(()
=>
{
this
.
now
=
new
Date
().
format
(
'yyyy-MM-dd hh:mm:ss'
)
this
.
now
=
new
Date
().
format
(
'yyyy-MM-dd hh:mm:ss'
)
},
1
e3
)
},
1
e3
)
},
getMerchantNum
()
{
this
.
api
.
overview
.
getMerchantNum
({}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
code
===
'0'
)
{
this
.
merchantNum
=
res
.
data
.
dataList
[
0
]
}
})
}
}
}
}
}
}
...
@@ -74,6 +90,11 @@ export default {
...
@@ -74,6 +90,11 @@ export default {
color
:
#ffffff
;
color
:
#ffffff
;
.top
{
.top
{
justify-content
:
flex-end
;
justify-content
:
flex-end
;
.yesterday
{
font-size
:
10px
;
color
:
#606266
;
margin-left
:
5px
;
}
}
}
.icon
{
.icon
{
width
:
16px
;
width
:
16px
;
...
@@ -88,6 +109,7 @@ export default {
...
@@ -88,6 +109,7 @@ export default {
color
:
#eb6001
;
color
:
#eb6001
;
margin-right
:
10px
;
margin-right
:
10px
;
padding-right
:
10px
;
padding-right
:
10px
;
line-height
:
2vh
;
position
:
relative
;
position
:
relative
;
&::after
{
&::after
{
position
:
absolute
;
position
:
absolute
;
...
@@ -97,7 +119,13 @@ export default {
...
@@ -97,7 +119,13 @@ export default {
width
:
1px
;
width
:
1px
;
height
:
1.5vh
;
height
:
1.5vh
;
content
:
''
;
content
:
''
;
background-color
:
#606266
;
background-color
:
#EB6001
;
}
&
:last-child
{
margin-right
:
0
;
&::after
{
width
:
0
;
}
}
}
}
}
}
}
...
...
src/views/salesData/flow.vue
View file @
72f66fe
...
@@ -20,8 +20,8 @@
...
@@ -20,8 +20,8 @@
<div
class=
"flow-right"
>
<div
class=
"flow-right"
>
<!--
<div
class=
"ranking-value"
>
{{
currentName
}}{{
isBrand
?
'门店'
:
'品牌'
}}
排名
</div>
-->
<!--
<div
class=
"ranking-value"
>
{{
currentName
}}{{
isBrand
?
'门店'
:
'品牌'
}}
排名
</div>
-->
<div
class=
"ranking-title"
>
<div
class=
"ranking-title"
>
<div
@
click=
"changeRank(1)"
:class=
"isActive == 1 ? 'active' : ''"
>
{{
currentName
}}
前5
{{
isBrand
?
'门店'
:
'品牌'
}}
</div>
<div
@
click=
"changeRank(1)"
:
style=
"
{'background-color': isActive == 1 ? bgColor : ''}" :
class="isActive == 1 ? 'active' : ''">
{{
currentName
}}
前5
{{
isBrand
?
'门店'
:
'品牌'
}}
</div>
<div
@
click=
"changeRank(2)"
:class=
"isActive == 2 ? 'active' : ''"
>
{{
currentName
}}
后5
{{
isBrand
?
'门店'
:
'品牌'
}}
</div>
<div
@
click=
"changeRank(2)"
:
style=
"
{'background-color': isActive == 2 ? bgColor : ''}" :
class="isActive == 2 ? 'active' : ''">
{{
currentName
}}
后5
{{
isBrand
?
'门店'
:
'品牌'
}}
</div>
</div>
</div>
<div
class=
"ranking-content"
>
<div
class=
"ranking-content"
>
<div
class=
"ranking-item"
v-for=
"(item, index) in flowData"
:key=
"index"
>
<div
class=
"ranking-item"
v-for=
"(item, index) in flowData"
:key=
"index"
>
...
@@ -95,7 +95,9 @@ export default {
...
@@ -95,7 +95,9 @@ export default {
topList
:
[],
topList
:
[],
lastList
:
[],
lastList
:
[],
isBrand
:
false
,
isBrand
:
false
,
currentName
:
''
currentName
:
''
,
bgColor
:
'#BF98FF'
,
colorList
:
[
'#BF98FF'
,
'#E60115'
,
'#4FA0FF'
,
'#EB6001'
,
'#F5AA01'
]
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -152,7 +154,7 @@ export default {
...
@@ -152,7 +154,7 @@ export default {
},
},
borderWidth
:
0
borderWidth
:
0
},
},
color
:
[
'#BF98FF'
,
'#E60115'
,
'#4FA0FF'
,
'#EB6001'
,
'#F5AA01'
]
,
color
:
this
.
colorList
,
series
:
[
series
:
[
{
{
name
:
'漏斗图'
,
name
:
'漏斗图'
,
...
@@ -195,12 +197,12 @@ export default {
...
@@ -195,12 +197,12 @@ export default {
this
.
echartsFunnel
.
on
(
this
.
echartsFunnel
.
on
(
'mouseover'
,
'mouseover'
,
utils
.
debounce
(
data
=>
{
utils
.
debounce
(
data
=>
{
this
.
getSaleTrans
(
this
.
paramsData
,
data
.
data
.
type
,
data
.
data
.
name
)
this
.
getSaleTrans
(
this
.
paramsData
,
data
.
data
.
type
,
data
.
data
.
name
,
data
.
dataIndex
)
}),
}),
1000
/
60
1000
/
60
)
)
},
},
getSaleTrans
(
val
,
queryItem
=
'enter'
,
name
=
'客流'
)
{
getSaleTrans
(
val
,
queryItem
=
'enter'
,
name
=
'客流'
,
index
=
0
)
{
const
params
=
{
const
params
=
{
req
:
{
req
:
{
queryItem
:
queryItem
,
queryItem
:
queryItem
,
...
@@ -235,6 +237,7 @@ export default {
...
@@ -235,6 +237,7 @@ export default {
}
}
this
.
flowData
=
this
.
isActive
==
1
?
this
.
topList
:
this
.
lastList
this
.
flowData
=
this
.
isActive
==
1
?
this
.
topList
:
this
.
lastList
this
.
currentName
=
name
this
.
currentName
=
name
this
.
bgColor
=
this
.
colorList
[
index
]
})
})
},
},
// 切换品牌排序
// 切换品牌排序
...
@@ -282,12 +285,12 @@ export default {
...
@@ -282,12 +285,12 @@ export default {
.ranking-content
{
.ranking-content
{
background-color
:
#262525
;
background-color
:
#262525
;
padding
:
0.4vh
0
;
padding
:
0.4vh
0
;
height
:
11vh
;
}
}
.ranking-item
{
.ranking-item
{
display
:
flex
;
display
:
flex
;
width
:
100%
;
width
:
100%
;
align-items
:
center
;
align-items
:
center
;
line-height
:
2.2vh
;
line-height
:
2.2vh
;
height
:
2.2vh
;
height
:
2.2vh
;
.ranking-sort
{
.ranking-sort
{
...
...
src/views/salesData/trend.vue
View file @
72f66fe
...
@@ -34,7 +34,8 @@ export default {
...
@@ -34,7 +34,8 @@ export default {
dataList
:
[],
dataList
:
[],
paramsData
:
[],
paramsData
:
[],
list
:
[
'enter'
,
'stayfile'
,
'test'
,
'placeorder'
,
'success'
],
list
:
[
'enter'
,
'stayfile'
,
'test'
,
'placeorder'
,
'success'
],
hasData
:
true
hasData
:
true
,
colorList
:
[
'#BF98FF'
,
'#E60115'
,
'#4FA0FF'
,
'#EB6001'
,
'#F5AA01'
]
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -107,7 +108,9 @@ export default {
...
@@ -107,7 +108,9 @@ export default {
const
date
=
this
.
dataList
[
0
][
index
].
statDate
const
date
=
this
.
dataList
[
0
][
index
].
statDate
var
txt
=
date
+
'<br />'
var
txt
=
date
+
'<br />'
e
.
forEach
(
item
=>
{
e
.
forEach
(
item
=>
{
txt
=
txt
+
item
.
seriesName
+
':'
+
item
.
value
+
'<br />'
console
.
log
(
item
)
item
.
marker
=
'<span style=\"display:inline-block;margin-right:4px;border-radius:5px;width:5px;height:5px;background-color:'
+
this
.
colorList
[
item
.
componentIndex
]
+
';\"></span>'
txt
=
txt
+
item
.
marker
+
item
.
seriesName
+
':'
+
item
.
value
+
'<br />'
})
})
return
txt
return
txt
}
}
...
@@ -191,6 +194,9 @@ export default {
...
@@ -191,6 +194,9 @@ export default {
})
})
this
.
echartsTrend
.
setOption
(
this
.
option
)
this
.
echartsTrend
.
setOption
(
this
.
option
)
this
.
chartAction
()
this
.
chartAction
()
this
.
echartsTrend
.
on
(
'globalout'
,
()
=>
{
this
.
chartAction
()
})
},
},
chartAction
(
type
)
{
chartAction
(
type
)
{
this
.
echartsTrend
.
dispatchAction
({
this
.
echartsTrend
.
dispatchAction
({
...
@@ -207,4 +213,11 @@ export default {
...
@@ -207,4 +213,11 @@ export default {
width
:
100%
;
width
:
100%
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.trend-dot
{
display
:
inline-block
;
width
:
2px
;
height
:
2px
;
border-radius
:
50%
;
background-color
:
#BF98FF
;
}
</
style
>
</
style
>
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